Skip to content

TiberiusTech/xcstrings-audit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xcstrings-audit

Small command-line tool that tells you which translations are missing in your Xcode string catalogs (.xcstrings).

I localize my apps in up to 25 languages. Xcode shows completion percentages per catalog, but there's no quick way to answer "which keys are still untranslated in German, across the whole project?" without clicking around. This answers it in one command — and fails your CI build if you want it to.

$ xcstrings-audit MyApp/

Localizable.xcstrings  (source: en)
  de       [##################..] 92%  241/262
  en       [####################] 100%  262/262
  it       [####################] 100%  262/262
  ...

21 missing translations in total.

Usage

xcstrings-audit <file-or-directory> ...   # directories are walked recursively
xcstrings-audit --verbose MyApp/          # list every missing / stale key
xcstrings-audit --lang de,fr MyApp/       # only check some languages
xcstrings-audit --strict MyApp/           # exit 1 if anything is missing
xcstrings-audit --min-coverage 90 MyApp/  # exit 1 if any language is below 90%
xcstrings-audit --json MyApp/             # machine-readable output

--strict and --min-coverage are the CI use case. Add one as a build step and a PR can't merge with half-translated strings again — --min-coverage is the pragmatic choice while a language is being brought up to speed. --json exists so a CI job can post the numbers wherever you want them.

What counts as missing

  • a key with no entry for a language → missing
  • state new → missing
  • state needs_review → not missing, but reported separately
  • plural/device variations: a group is only as translated as its worst variant — one translated but other still new means missing
  • shouldTranslate: false keys are skipped entirely
  • stale keys (still in the catalog, no longer in code) are excluded from every language's count — translating them is wasted money — and reported on their own line instead
  • keys with no explicit source-language entry are fine (they fall back to the key itself, that's how catalogs work)

Install

swift build -c release
cp .build/release/xcstrings-audit /usr/local/bin/

No dependencies, just Foundation. Needs macOS 13+ and Swift 5.9.

Tests

swift test

MIT license.

About

CLI that finds missing translations in Xcode string catalogs (.xcstrings). Zero dependencies.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages