Summary
Set up an automated GitHub Actions workflow that detects new or changed English strings and auto-translates them using the Claude API (or DeepL), opening a PR with draft translations for admin review before merge.
Background
The hardest ongoing maintenance problem with localization is keeping translations up to date as new strings are added. This ticket designs and implements a low-cost automation that:
- Detects when
en.lproj/Localizable.strings changes on the develop branch
- Identifies which keys are new or changed
- Uses Claude (claude-haiku-4-5 for cost efficiency) to translate those keys into all supported languages
- Opens a draft PR with the new translations for @JoeMatt to review and merge
Design
Workflow trigger
on:
push:
branches: [develop]
paths:
- '**/en.lproj/Localizable.strings'
- '**/en.lproj/Strings.strings'
Translation script (Scripts/auto_translate.py or Swift)
- Reads the diff of strings files
- Calls Claude API with prompt: "Translate these iOS app strings from English to {language}. Return only the .strings file format. Preserve format arguments like %@, %d. Do not translate proper nouns like 'Provenance', 'RetroArch', button names."
- Languages: zh-Hans, ja, ko, es, pt-BR, de, fr, it, nl, ru, ar
- Outputs translated
.strings entries
Cost control
- Only translate new/changed keys (delta, not full file)
- Use
claude-haiku-4-5-20251001 (cheapest model) for batch translations
- Estimated cost: <$0.01 per translation run for typical string additions
PR creation
- Draft PR titled "[Auto-translation] New strings for {languages}"
- Body includes diff of changes + a checklist for each language to review
- Label:
translations,needs-review
- Assigned to @JoeMatt
Tasks
Languages Priority
Phase 1 (most requested): zh-Hans, ja, ko, de, es, pt-BR
Phase 2 (existing): it, nl, ru
Phase 3 (new): ar, fr
Acceptance Criteria
- Pushing a change to any
en.lproj/*.strings file triggers the workflow
- A draft PR appears within 5 minutes with translated strings
- The PR body lists which keys were translated and which were skipped
- Admin can merge directly or edit strings before merging
- Cost per run is <$0.05
Cost Estimate
- ~200 new strings per release × 10 languages × ~20 tokens each = ~40,000 tokens
- At Haiku rates (~$0.25/MTok input): ~$0.01 per full translation run
Part of #2862
Summary
Set up an automated GitHub Actions workflow that detects new or changed English strings and auto-translates them using the Claude API (or DeepL), opening a PR with draft translations for admin review before merge.
Background
The hardest ongoing maintenance problem with localization is keeping translations up to date as new strings are added. This ticket designs and implements a low-cost automation that:
en.lproj/Localizable.stringschanges on thedevelopbranchDesign
Workflow trigger
Translation script (
Scripts/auto_translate.pyor Swift).stringsentriesCost control
claude-haiku-4-5-20251001(cheapest model) for batch translationsPR creation
translations,needs-reviewTasks
Scripts/auto_translate.py(or.shwrapper) using Anthropic Python SDK.github/workflows/auto-translate.ymlworkflowANTHROPIC_API_KEYto repo Actions secrets (document in DEVELOPER.md)<!-- translation-skip -->comment convention for strings that should not be auto-translatedDEVELOPER.mdunder a "Localization" sectionLanguages Priority
Phase 1 (most requested): zh-Hans, ja, ko, de, es, pt-BR
Phase 2 (existing): it, nl, ru
Phase 3 (new): ar, fr
Acceptance Criteria
en.lproj/*.stringsfile triggers the workflowCost Estimate
Part of #2862