localeguard
v0.5.0
Published
Open-source localization quality gate for React and TypeScript projects. Detects missing keys, broken interpolation, and invalid locale files before merge.
Maintainers
Readme
localeguard
Prevent untranslated, inconsistent, and broken localization from reaching production. An open-source localization quality gate for React and TypeScript.
npm install --save-dev localeguard
npx localeguard init # writes localeguard.config.json
npx localeguard checkLocaleGuard detects, in a single CI-safe command:
- Missing / extra / duplicate translation keys
- Invalid locale JSON (reported with line numbers)
- Interpolation mismatches — e.g.
{{userName}}dropped in a translation - Hardcoded JSX text and unlocalized
aria-label/title/alt/placeholder
It exits non-zero when a blocking issue is found, so it fails CI automatically.
Run localeguard check --no-code to check locale files only, or
--reporter json for machine-readable output.
# .github/workflows/i18n.yml
- run: npx localeguard checkSee the full documentation, including configuration and the "How is this different?" comparison.
