Locale CI CLI (locales:ci)
Purpose: Run the same non-interactive checks that matter in pull requests and CI in one shot—so translation/key drift and invalid JSON fail the build before merge, without requiring developers to run sync or cleanup locally first.
apps/web/scripts/locales/ci/index.ts runs, in order:
- Parse every
locales/*.jsonfile — fails if any file is invalid JSON. locales:validate-style scan — literalt()/labelKeypaths used inapps/web/src/**must exist as string leaves inlocales/en.json.locales:validate:quality-style report — key-shape drift (missing/extra paths vsen.json) and English-identical strings (grouped by key). Uses shared logic fromvalidate/quality.tsand parity helpers inscripts/locales/shared/parity.ts.
It does not write files, prompt, or call Google Translate—safe for CI.
Commands
From apps/web:
bash
pnpm locales:ciStrict failure when translations still match English (optional):
bash
pnpm locales:ci -- --strict
# or
LOCALES_CI_STRICT_IDENTICAL=1 pnpm locales:ciGitHub Actions
The workflow .github/workflows/locales.yml runs pnpm -C apps/web locales:ci on changes under locales/, src/, or locale scripts.
Related
- validate.md —
locales:validateandlocales:validate:quality - sync.md —
locales:sync(run locally when drift is reported) - examples.md