Files
planka/package.json
Daniel Hiller 9069b24cfb 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.
2026-09-08 19:54:27 +02:00

47 lines
2.0 KiB
JSON

{
"name": "planka",
"version": "2.2.1",
"private": true,
"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 .",
"gv": "npm i --package-lock-only --ignore-scripts && genversion --source . --template server/version-template.ejs server/version.js && genversion --source . --template client/version-template.ejs client/src/version.js",
"postinstall": "npm i --prefix server && npm i --prefix client",
"lint": "npm run server:lint && npm run client:lint",
"prepare": "husky",
"server:build": "npm run build --prefix server",
"server:console": "npm run console --prefix server",
"server:db:clean-orphaned-records": "npm run db:clean-orphaned-records --prefix server",
"server:db:create-admin-user": "npm run db:create-admin-user --prefix server",
"server:db:init": "npm run db:init --prefix server",
"server:db:migrate": "npm run db:migrate --prefix server",
"server:db:seed": "npm run db:seed --prefix server",
"server:db:upgrade": "npm run db:upgrade --prefix server",
"server:lint": "npm run lint --prefix server",
"server:start": "npm start --prefix server",
"server:start:prod": "npm run start:prod --prefix server",
"server:swagger:generate": "npm run swagger:generate --prefix server",
"server:test": "npm test --prefix server",
"start": "concurrently -n server,client \"npm run server:start\" \"npm run client:start\"",
"test": "npm run server:test && npm run client:test"
},
"lint-staged": {
"client/src/**/*.{js,jsx}": [
"npm run client:lint"
],
"server/**/*.js": [
"npm run server:lint"
]
},
"dependencies": {
"concurrently": "^10.0.4",
"genversion": "^3.2.0",
"husky": "^9.1.7",
"lint-staged": "^16.4.0"
}
}