Score your react-i18next locale files on every push and fail the build when a language regresses.
react-i18next returns the raw key when a translation is missing, so a key absent from one language ships a string like cart.checkout.cta straight to a user with no error and no failing test. Your component tests run in the source language and never see it.
Polylens scans the JSON files behind react-i18next, scores each language 0 to 100, lists every missing key, broken {{interpolation}}, mismatched plural suffix and stale string, and fails CI when any language regresses. Setup is one curl call; your strings stay in your repo.
Locale format: JSON namespaces (public/locales/{lng}/{ns}.json). Point the gate at your public/locales or src/locales directory.
react-i18next falls back to the key string when a translation is absent, so cart.checkout.cta ships verbatim. Polylens flags every key present in your source language but missing from a target.
A translator who rewrites {{count}} or {{name}} silently breaks the interpolation. Polylens diffs every placeholder between source and target.
react-i18next plural suffixes (key_one, key_other) that exist in one language but not another produce wrong output for most counts. Polylens validates plural completeness.
Change the English and four languages keep the old meaning with nothing missing. Polylens detects staleness from scan history alone.
name: i18n health
on:
pull_request:
paths: ['public/locales/**']
jobs:
polylens:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsSO https://polylens.sh/polylens-ci.mjs
- run: node polylens-ci.mjs ./public/locales
env:
POLYLENS_TOKEN: ${{ secrets.POLYLENS_TOKEN }}
FAIL_ON: error
NO_REGRESSION: 'true'Add your project token as the POLYLENS_TOKEN repository secret. A failing gate returns HTTP 422, so the build goes red like any other test.
Add one step to your pipeline that posts your locale files to Polylens. The gate returns HTTP 422 when a language regresses, so the build fails like any other test. No SDK, one curl call, and your strings never leave your repo.
Yes. Missing keys are the first of 13 issue classes Polylens detects, alongside broken placeholders, untranslated copy, malformed plurals, and stale strings. Every missing key is listed per language in the dashboard.
No. react-i18next renders your translations at runtime; Polylens is the quality gate that scores the locale files before they ship. They sit on opposite ends of the pipeline and work together.
Wire react-i18next into a CI gate in ten minutes. Free for one project, no card, strings stay in your repo.