Prompt
How do I automate translation updates when source strings change?
Latest observation
Nov 2, 2026
OpenAI APIWeb search: off
A good way to automate translation updates is to put a translation workflow around your source strings so changes are detected, extracted, synced to your translation platform, and then pulled back into your app automatically.
Typical setup
-
Keep source strings in a canonical file
- Example:
en.json,messages.po,arb,resx, etc. - Treat this as the source of truth.
- Example:
-
Use stable keys, not source text as keys
- Good:
"checkout.button.pay": "Pay now" - Bad:
"Pay now": "Pay now" - This prevents translations from breaking when wording changes slightly.
- Good:
-
Detect string changes in CI
- Add a job that:
- extracts strings,
- compares them with the previous version,
- flags new/removed/changed keys.
- This can run on every pull request.
- Add a job that:
-
Sync with a translation management system
- Use tools like:
- Lokalise
- Phrase
- Crowdin
- Transifex
- Most support:
- auto-upload of new source strings,
- auto-download of completed translations,
- webhooks or API-based sync.
- Use tools like:
-
Automate pull/push with scripts
- Example flow:
extract-localesupload-to-TMS- translators work
download-translationscommit-updated-files
- Trigger this via CI/CD or a scheduled job.
- Example flow:
-
Handle updated source strings intelligently
- If a source string changes:
- mark old translations as outdated,
- preserve existing translations for translators to review,
- optionally fuzzy-match similar strings.
- Many TMS platforms do this automatically.
- If a source string changes:
-
Add review gates
- For changed strings, require:
- human review for content changes,
- automated checks for missing translations,
- fallback behavior at runtime.
- For changed strings, require:
Example GitHub Actions flow
name: Sync translations
on:
push:
branches: [main]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract source strings
run: npm run i18n:extract
- name: Upload source strings
run: npm run i18n:upload
env:
TMS_API_KEY: ${{ secrets.TMS_API_KEY }}
- name: Download translated files
run: npm run i18n:download
env:
TMS_API_KEY: ${{ secrets.TMS_API_KEY }}
- name: Commit updated translations
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add locales/
git commit -m "chore(i18n): update translations" || exit 0
git push
Best practices
- Use translation keys that are descriptive and stable.
- Include context for translators.
- Avoid concatenating strings in code.
- Track pluralization and gender properly.
- Keep a fallback language in your app.
- Make translation updates part of CI, not a manual task.
- Store translation files in version control if that fits your workflow.
If you want a minimal DIY approach
You can automate with:
- a script that scans source files for keys,
- a diff against locale files,
- API calls to your translation vendor,
- and a commit-back step in CI.
If you tell me your stack, I can suggest a concrete setup:
- web app/framework,
- file format,
- and whether you use a translation platform or want a pure Git-based workflow.