From chadpod-xcstrings-localizer-claude-code-plugin
Localize Xcode .xcstrings files. Use when the user asks to "localize", "translate strings", "add translations", or mentions .xcstrings files. Supports scoped translation by file, folder, target, or string pattern.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin chadpod-xcstrings-localizer-claude-code-pluginThis skill uses the workspace's default tool permissions.
Translate Xcode String Catalog (.xcstrings) files directly in Claude Code.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Translate Xcode String Catalog (.xcstrings) files directly in Claude Code.
Use this skill when the user says things like:
Ask the user to clarify scope if not specified:
| Scope Type | Example Request | How to Filter |
|---|---|---|
| All files | "localize my app" | Find all **/*.xcstrings |
| Single file | "translate Localizable.xcstrings" | Use that specific file |
| By folder | "translate strings in Source/Login/" | Glob Source/Login/**/*.xcstrings |
| By target | "translate Widget strings" | Check Xcode project for target membership |
| By pattern | "translate error messages" | Filter string keys matching pattern |
| By language | "add Spanish only" | Only add missing Spanish translations |
# Find all xcstrings files in project
find . -name "*.xcstrings" -type f
Or use Glob: **/*.xcstrings
Check the Xcode project for configured languages:
grep -A 30 "knownRegions" *.xcodeproj/project.pbxproj | grep -E '^\s+"[a-z]{2}(-[A-Z]{2})?"'
Common language codes:
en - English (usually source)es - Spanishfr - Frenchde - Germanja - Japanesezh-Hans - Chinese Simplifiedzh-Hant - Chinese Traditionalko - Koreanpt-BR - Portuguese (Brazil)it - ItalianAn .xcstrings file is JSON with this structure:
{
"sourceLanguage": "en",
"version": "1.0",
"strings": {
"string_key": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "English text"
}
},
"es": {
"stringUnit": {
"state": "translated",
"value": "Texto en español"
}
}
}
}
}
}
Key fields:
sourceLanguage: The base language (usually "en")strings: Object keyed by string keylocalizations: Object keyed by language codestringUnit.state: Translation statestringUnit.value: The translated textTranslation states:
translated - Has a valid translationnew - Newly added, needs translationneeds_review - Source changed, translation may be stalestale - Marked as outdatedSpecial metadata:
shouldTranslate: false - Skip this string (e.g., brand names)comment - Context for translatorsA string needs translation if:
localizationsnew or needs_reviewshouldTranslate is NOT falseCRITICAL: Format specifiers must be preserved exactly in translations.
| Specifier | Meaning | Example |
|---|---|---|
%@ | Object/String | "Hello %@" → "Hola %@" |
%d, %i | Integer | "%d items" → "%d elementos" |
%ld, %lld | Long integer | Same as %d |
%f | Float | "%.2f miles" → "%.2f millas" |
%1$@, %2$@ | Positional args | "%1$@ sent %2$@" → "%2$@ enviado por %1$@" |
%#@count@ | Plural reference | Keep exactly as-is |
%% | Literal % | Keep as %% |
Positional arguments: Languages may reorder arguments. Use positional form (%1$@) to allow reordering.
Plural strings have a special structure:
{
"item_count": {
"localizations": {
"en": {
"variations": {
"plural": {
"one": {
"stringUnit": {
"state": "translated",
"value": "%d item"
}
},
"other": {
"stringUnit": {
"state": "translated",
"value": "%d items"
}
}
}
}
}
}
}
}
Plural categories by language:
one, otherone, many, otherone, few, many, otherzero, one, two, few, many, otherReport findings first:
Found 3 .xcstrings files:
- Localizable.xcstrings (245 strings, missing: es 12, fr 245)
- InfoPlist.xcstrings (5 strings, fully translated)
- Widget.xcstrings (18 strings, missing: es 3, fr 18)
Target languages from project: en, es, fr
Which would you like to translate?
Confirm target language(s) if not specified
Translate in batches (suggest 10-20 strings at a time for large files)
Show translations for review before writing:
"welcome_message":
en: "Welcome back, %@!"
es: "¡Bienvenido de nuevo, %@!"
"item_count" (plural):
en.one: "%d item"
en.other: "%d items"
es.one: "%d elemento"
es.other: "%d elementos"
Write back with state set to translated
When updating the file:
state: "translated" for new translationscomment field provides translator context%@, %d, etc.User: "Add Spanish translations to my app"
Localizable.xcstringsen, es, fr