The translation bugs code review keeps missing
说明与用途
Locale Guard 自动检测翻译错误,防止错误代码被合并到项目中。
问题
Translation placeholders and plural forms are missed by code reviews because reviewers cannot read the target languages, leading to runtime errors and missing context in UI.
结果
Locale Guard reduced translation bugs by automatically flagging issues during PR review, enabling maintainers to fix them within a day and preventing runtime errors in multiple languages.
工作流
- 1. Add Locale Guard action to PR workflow YAML
- 2. Action reads locale files using library-specific parsers
- 3. Compare each language to base locale
- 4. Detect missing keys, placeholder differences, compile errors, plural form gaps, and untranslated text
- 5. Post a single comment on the PR with findings and code blocks for quick fixes
- 6. Fail the check only on new or changed issues, ignoring legacy ones
证据
Locale Guard runs on every pull request. It reads the locale files with each library's own message parser, compares every language with the base one, and writes one comment with: missing keys, placeholders, ICU arguments and tags that differ from the base message, messages that don't compile, plural forms each language needs, from Intl.PluralRules, text that was never translated
All three fixes were merged by the maintainers within a day.
- 记录日期: 2026-10-18T12:56:04.309Z