langcodec-cli (Command Line)
Universal CLI for converting, inspecting, merging, and editing localization files.
- Formats: Apple
.strings,.xcstrings, Androidstrings.xml, CSV, TSV - Commands: convert, merge, view, stats, debug, edit
Install
Commands
convert
Auto-detects formats from extensions. For JSON/YAML custom formats, see --input-format in the root README.
merge
view
Prints entries. Plurals are labeled with Type: Plural and show categories.
stats
Shows per-language totals, counts by status, and completion percent (excludes DoNotTranslate). Use --json for machine-readable output.
debug
edit
Unified in-place editing (add/update/remove) across one or many files.
Basics:
# Add or update a key
# Remove a key (omit or empty value)
# Multiple files or globs (quote patterns)
# Preview only
# Write to a different file (single input only)
Options:
- --inputs/-i: One or more input files. Supports glob patterns when quoted.
- --lang/-l: Language code (required when an input contains multiple languages).
- --key/-k: Entry key to modify.
- --value/-v: New value. If omitted or empty, the entry is removed.
- --comment: Optional translator note.
- --status: translated|needs_review|new|do_not_translate|stale.
- --output/-o: Optional output path. Not allowed with multiple inputs.
- --dry-run: Print what would change and exit without writing.
- --continue-on-error: Process all inputs; report failures at the end (non-zero exit if any fail).
Supported formats: .strings, .xml (Android), .xcstrings, .csv, .tsv. Custom JSON/YAML/.langcodec edit is currently not enabled.
Notes
- Android plurals
<plurals>are supported. - Language inference:
en.lproj/Localizable.strings,values-es/strings.xml, basevalues/→enby default. - Globbing: use quotes for patterns in merge and edit (e.g.,
'**/*.xml').
License
MIT