chore: Add a locale completeness check
An incomplete locale falls back to English at runtime, so a gap breaks nothing and nobody notices it on their own. 2.2.1 shipped fifty-six user-facing strings that existed only in English and German, and it took someone looking for something else to find them. `npm run client:locales:check` compares every locale against the reference and exits non-zero when one is behind. It compares `login.js` and `core.js` separately and never merges them. `login.js` is the embedded bundle and is all that exists until a session is established, so a key present only in `core.js` is still missing from every screen shown before login — the two-factor challenge among them. Merging the two hides exactly that, which is how the six strings of the challenge stayed English in thirty-three languages. Keys are compared on their base name, with the CLDR plural category stripped, because how many categories a language needs is a property of that language: English has two, Japanese one, Arabic six. Comparing the suffixed names would have demanded an English `_one` from Japanese, where i18next never reads it. Each plural key is then checked against the categories the language itself declares, through the same Intl.PluralRules that i18next resolves with — a missing category falls back to `_other` silently, and Russian `few` and `many` are reachable with counts a user really sees. It is deliberately not part of `lint`: a pull request that adds a string is expected to leave the other locales behind for a while, and a check that fails every such request would only be switched off. This one belongs before a release.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"client:build": "npm run build --prefix client",
|
||||
"client:lint": "npm run lint --prefix client",
|
||||
"client:locales:check": "npm run locales:check --prefix client",
|
||||
"client:start": "npm start --prefix client",
|
||||
"client:test": "npm test --prefix client",
|
||||
"docker:build": "docker build -t planka .",
|
||||
|
||||
Reference in New Issue
Block a user