Xcode's percentage is not coverage.
The String Catalog editor counts an entry as done when it has a value, including entries
whose state is new or needs_review. It also has no opinion about a translation that
dropped a %@, or an Arabic plural that only defines other. Those are the failures users
see first.
$ xca --missing Sources
1 catalog(s) · 7 keys · source: en
ar 5/7 71% ███████████░░░░░ missing 2 · review 1
de 5/7 71% ███████████░░░░░ missing 2
Placeholder mismatches (1)
ar Home.subtitle placeholders differ: source has %@, %d, translation has %@
Plural categories (1)
ar items_count missing plural categories: zero, one, two, few, many
Stale keys (1)
Old.title
Missing translations (4)
ar Profile.follow
ar Old.title
de Settings.language
de Old.title
filled / total per language, where a key counts as filled only if it has a non-empty
value. needs_review and new count toward coverage but are reported separately, because
a review backlog is a different problem from a missing string. The source language is
tracked too, and hidden from the default view.
- Missing / empty keys, listed with
--missing. - Placeholders.
%@,%lld,%.1fare compared as types and counts.%lldand%dare treated as equivalent. Plural entries are compared per category,othertoother, so word order in%1$@ … %2$ddoes not produce a false alarm. - Arabic plurals. If an entry uses plural variations, the Arabic translation must have
all six CLDR categories:
zero,one,two,few,many,other. - Stale keys, from
extractionState. - Badge.
--badgewrites a shields.io endpoint file with a colour based on coverage.
git clone https://github.com/hfip/xcstrings-audit.git
cd xcstrings-audit
pipx install .Both xcstrings-audit and xca are installed. Python 3.9+, no dependencies, 29 tests.
xca Sources/ # every .xcstrings under a folder
xca --lang ar . # one language
xca --missing . # print the keys, not just the count
xca --min-coverage 90 Sources/ # gate: exit 1 below 90%
xca --strict . # gate on any problem, including stale keys
xca --json . > report.json
xca --badge badge.json . # shields.io endpoint for the README--lang must exist in the catalogs. An unknown code exits 2 instead of quietly showing
an empty report.
Exit codes: 0 clean, 1 gate failed, 2 usage or parse error.
The badge is generated for the language you pass with --lang, otherwise for the language
with the lowest coverage.
- It never writes to the catalog. Safe on every pull request.
- Only
.xcstrings. Legacy.stringsand.stringsdictare not parsed yet. - The plural rule set is Arabic-specific. Other languages get the placeholder and missing checks, not a category audit.
- It cannot prove a translation is good, only that it is present and structurally intact.
نسبة التعريب في Xcode مضللة: تعتبر المفتاح منتهياً بمجرد ما يكون له قيمة، حتى لو حالته
new أو needs_review. وما تنبهك إذا ضاع %@ من الترجمة، أو إذا الجمع العربي فيه
other بس.
xcstrings-audit يقرأ الملف ويعطيك الصورة الحقيقية:
xca --missing .
xca --min-coverage 90 Sources/ # يفشل الـ CI إذا نزلت التغطية
xca --strict . # يفشل على أي مشكلة، مو بس النسبةPart of the Arabic dev tools collection.
MIT. See LICENSE.