CI: translation coverage job

A separate 'translations' job runs the i18n checker on every push and
PR and writes a coverage table per language to the run summary, with
the missing, broken and unused keys listed. The checker now also fails
when a language file is not offered in SOT_LANGS or cached in sw.js.
This commit is contained in:
Frederic Jung 2026-10-26 06:04:28 +01:00
parent 0ecce20dec
commit 4e95b9b397
No known key found for this signature in database
3 changed files with 50 additions and 7 deletions

View file

@ -58,7 +58,7 @@ A tour of the code is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
Every player-facing string goes through `tr()`, `trn()` or `N_()`. Dictionaries live
in `site/i18n/` (English text → translation). To add a language, copy `it.js`, translate
the values, register the language in the language list in `site/index.html`, and run
`node scripts/i18n-check.js <lang>` until it reports nothing missing, unused or broken.
`node scripts/i18n-check.js <lang>` until it reports nothing missing, unused or broken. The CI job "translations" runs the same check on every pull request, shows each language's coverage in the run summary, and also fails if a new language is not added to the language list or to the offline cache in `site/sw.js`.
Language pull requests must be reviewed by a human who speaks the language, and
checked in the game itself, not only in the dictionary file. Passing the checker is