How to Validate i18next JSON Locale Files in CI
Turn broken locale files into pull-request failures instead of runtime bugs
Why CI matters for locale files
i18next JSON files are code-adjacent. A translated string can be linguistically fine and still break a UI if it drops {{count}}, removes a nested key, or leaves the file as invalid JSON.
A small automated check gives reviewers a stable baseline before they spend time judging tone, context, and product language.
Add a GitHub Actions check
This job uses the free JSON Translate Check Action to compare translated files against the source locale on every pull request:
.github/workflows/locales.yml
name: Locale checks
on:
pull_request:
jobs:
json-locales:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate translated JSON locale files
uses: OlsOls2/json-translate-check-action@v1
with:
source: locales/en.json
targets: locales/fr.json,locales/de.jsonAdd a package script
If your team prefers local checks before pushing, add a script to package.json:
package.json
"scripts": {
"check:locales": "json-translate-check --source locales/en.json --target locales/fr.json,locales/de.json"
}Developers can then run npm run check:locales before opening a pull request.
What to review manually
Automation should handle the shape of the file. Humans should still review the meaning of the translation, especially:
- Checkout, billing, and upgrade screens.
- Authentication and account recovery messages.
- Errors, empty states, and destructive-action confirmations.
- Strings with plural logic, interpolation, and product-specific terminology.
Translate, then validate
Use JSON Translate for the translation step, then use @json-translate/check as a guardrail before merge. That gives you fast draft translations plus repeatable structural QA.
Related workflow
Start with the i18next JSON translator, then run the free locale checker CLI.
Ready to Translate Your JSON Files?
Put your knowledge into practice with our powerful JSON translation tool.
Start Translating Now