Skip to content

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:

  1. Parse every locales/*.json file — fails if any file is invalid JSON.
  2. locales:validate-style scan — literal t() / labelKey paths used in apps/web/src/** must exist as string leaves in locales/en.json.
  3. locales:validate:quality-style report — key-shape drift (missing/extra paths vs en.json) and English-identical strings (grouped by key). Uses shared logic from validate/quality.ts and parity helpers in scripts/locales/shared/parity.ts.

It does not write files, prompt, or call Google Translate—safe for CI.

Commands

From apps/web:

bash
pnpm locales:ci

Strict failure when translations still match English (optional):

bash
pnpm locales:ci -- --strict
# or
LOCALES_CI_STRICT_IDENTICAL=1 pnpm locales:ci

GitHub Actions

The workflow .github/workflows/locales.yml runs pnpm -C apps/web locales:ci on changes under locales/, src/, or locale scripts.