Locale checks for CI
Purpose: Fail PRs when locale JSON is invalid, literal keys are missing from en.json, or key-shape drift appears—without running destructive sync/cleanup in CI.
Current commands (i18nprune)
The legacy locales:ci script and apps/web/scripts/locales/ci/** were removed with the i18nprune migration.
From repo root:
bash
pnpm -C apps/web locales:validate
pnpm -C apps/web locales:qualityFrom apps/web:
bash
pnpm locales:validate
pnpm locales:qualityWhat each step covers
locales:validate— valid JSON; literalt()/labelKeypaths exist inen.json; dynamic-site warnings.locales:quality— per-locale key parity vsen.json; source-identical leaf counts (withpolicies.parityexcludes).
Neither command writes files or calls translation APIs.
Stricter policy (optional)
Use i18nprune flags directly when wiring GitHub Actions, e.g.:
bash
cd apps/web && pnpm exec i18nprune validate -j
cd apps/web && pnpm exec i18nprune quality -jFor combined audit + fail gates (dynamic count, source-identical policy), use native i18nprune kits:
bash
cd apps/web && pnpm exec i18nprune kits honest --strict -fon missing,source-identical
# optional: -mxdy 80 to fail when dynamic sites exceed a budgetGitHub Actions
No dedicated .github/workflows/locales.yml in this repo yet. Add a job that runs the two pnpm -C apps/web commands above on changes under apps/web/locales/ and apps/web/src/.
Related
- validate.md
- sync.md — run locally when drift is reported
maintainer/systems/i18n.md