Audit Localization Catalog
localization-auditAudits .xcstrings, .strings, and .stringsdict catalogs to find missing translations, placeholder mismatches, and unused or missing keys compared to Swift source code.
Instructions
localization-audit
Audit .xcstrings, .strings, or .stringsdict catalogs for localization gaps, placeholder mismatches, and unused or missing keys relative to Swift source code.
What it does
Pure file analysis — no simulator required. Parses localization catalogs and reports:
Per-locale missing/untranslated keys
Keys with needs_review, new, or stale states
Format-specifier placeholder count mismatches across locales
Keys in Swift source but absent from catalog (missing_from_catalog)
Keys in catalog but absent from Swift source (unused_in_source)
Parameters
catalogPath (string, required): Path to .xcstrings, .strings, or .stringsdict catalog file
sourceDir (string, optional): Swift source root for unused/missing key cross-reference
strict (boolean, optional): Set isError:true in response if any findings are present
verbose (boolean, optional): Include detailed per-key breakdown in summary text
Supported Catalog Formats
.xcstrings: Xcode 15+ JSON catalog with multi-locale support
.strings: Legacy single-locale plist (binary/XML/text format)
.stringsdict: Pluralization rules plist
Returns
JSON response with:
catalogPath,sourceLanguage,totalKeys,localesgaps: array of { key, locale, reason } objectsmissingFromCatalog: keys in Swift source not in catalogunusedInSource: keys in catalog not referenced in Swift sourceplaceholderMismatches: keys where placeholder counts differ across localessummary: compact human-readable summary text
structuredContent: { totalKeys, localeCount, gapCount, placeholderMismatchCount }
Examples
Audit .xcstrings catalog
await localizationAuditTool({
catalogPath: '/path/to/Localizable.xcstrings'
})Full audit with source cross-reference
await localizationAuditTool({
catalogPath: '/path/to/Localizable.xcstrings',
sourceDir: './MyApp',
verbose: true
})Strict mode (error on any findings)
await localizationAuditTool({
catalogPath: '/path/to/Localizable.xcstrings',
strict: true
})Gap Reasons
missing: Key has no translation for that locale
needs_review: Translation exists but marked for review
new: Translation is new and unverified
stale: Translation is outdated relative to source
Placeholder Matching
Extracts printf-style format specifiers (%@, %d, %s, %lld, positional %1$@, etc.) and reports keys where the count differs between source and a target locale. Empty-value locales are skipped (gaps reported separately).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| strict | No | ||
| verbose | No | ||
| sourceDir | No | ||
| catalogPath | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gapCount | Yes | ||
| totalKeys | Yes | ||
| localeCount | Yes | ||
| placeholderMismatchCount | Yes |