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