Chki18n
A command-line tool that checks translation files against i18n conventions, published for JavaScript, Dart and Python. It reports missing keys, duplicated values and other common mistakes, and runs in CI as readily as on a laptop.
About this project
Chki18n is a command-line tool that checks translation files against the conventions an internationalised project depends on. It reads the locale files a project already has and reports what is wrong with them, which is a check that otherwise happens only when a missing string reaches a screen.
It runs twenty-five checks and reports each at the level of the harm it does. Errors are what will break the interface: a file that cannot be read or parsed, a key defined twice, a locale missing from a group, a key present in one language and missing in another, and interpolation placeholders that do not match the primary locale in name or in count. Warnings are what will merely embarrass — an empty value, two keys carrying the same text, a value identical to the source language and therefore untranslated, digits dropped or changed in translation, lost markup, one original translated two ways, an invisible character, a missing plural form, and a key no other language still uses. Pointed at the source code as well, it reports keys nothing references and keys the code asks for that no file defines.
It runs as a command, in a CI job or from your own code, and is published for JavaScript, Dart and Python, all three running the same checks in the same order and printing the same report. It reads JSON translation files today, and it checks rather than translates: nothing in a file is rewritten by running it.
Features
Documentation site
TypeScript types
Multiple languages
Verified by tests
Cross-platform
Command-line interface
