Follow the core's whole roll-out: 18 more languages, the Canadian variants included #44

Merged
tiagoagueda merged 1 commit from 43-languages into main 2026-10-23 08:23:58 +00:00
Owner

Closes #43

What changed

  • scripts/languages.py: SPELLED gains the five codes it stopped on. English and French keep the bare folder a browser falls back to from any region (en, fr), and a second variety is named by its region: en_CA, fr_CA, and es_MX beside es. Chinese is told apart by script, which a folder cannot say, so it is named by region as Chrome names its own catalogues, zh_CN and zh_TW, and keeps zh-Hans and zh-Hant in its tag.
  • src/lib/languages.js, regenerated from the core's main: 58 languages, up from 40. The core has started 57 (one translated string or more, in status.json), plus English. The other 27 of its 84 catalogues are still empty, so the extension does not follow them yet; languages.py adds each one when the core starts it.
  • 18 new catalogues, each {}: ar az be bn cnr en_CA es_MX fo fr_CA hi id kk nn rm sw ur zh_CN zh_TW. Weblate fills them (postulo/postulo#706). scripts/build.mjs already leaves an incomplete catalogue out of the package, so none of them ships, and no unfamiliar folder reaches a browser, before it is complete.
  • test/i18n.test.mjs:
    • The folder is read from the tag's own subtags. Intl.Locale applies CLDR's aliases and turned Montenegrin's cnr into sr-ME; cnr is kept as the core writes it, and named as the one tag whose canonical form Intl disagrees with.
    • Chinese takes its folder's region from its script.
    • The "scope keeps its name" test skips a catalogue that has no sentence yet.

Right to left

ar and ur are the first right-to-left languages here. Nothing more was needed: the build writes each catalogue's direction from languages.js (rtl for both), and i18n.js sets document.documentElement.dir from it on every page.

Not done here (from #43's checklist)

  • The Weblate component has new_lang: none. Once this is merged, Weblate should pick the 18 files up on its next pull; check that extension-chromium lists them.
  • Trying a browser set to fr-CA and en-CA, and packing with folders Chrome does not know (fr_CA, cnr, kab later), belongs to #29, in a real Chromium. Until a catalogue is complete the build leaves it out, so the question only arises once Weblate has filled one.

Tests

  • npm test: 184 passed.
  • npm run build: both targets build; the new languages are reported as left out until complete.
  • npm run lint:firefox: 0 errors, 0 warnings.
  • node scripts/guard.mjs against main: no translation written outside Weblate.
  • python scripts/languages.py --check against the core's main: matches.

🤖 Generated with Claude Code

Closes #43 ## What changed - `scripts/languages.py`: `SPELLED` gains the five codes it stopped on. English and French keep the bare folder a browser falls back to from any region (`en`, `fr`), and a second variety is named by its region: `en_CA`, `fr_CA`, and `es_MX` beside `es`. Chinese is told apart by script, which a folder cannot say, so it is named by region as Chrome names its own catalogues, `zh_CN` and `zh_TW`, and keeps `zh-Hans` and `zh-Hant` in its tag. - `src/lib/languages.js`, regenerated from the core's `main`: 58 languages, up from 40. The core has started 57 (one translated string or more, in `status.json`), plus English. The other 27 of its 84 catalogues are still empty, so the extension does not follow them yet; `languages.py` adds each one when the core starts it. - 18 new catalogues, each `{}`: `ar` `az` `be` `bn` `cnr` `en_CA` `es_MX` `fo` `fr_CA` `hi` `id` `kk` `nn` `rm` `sw` `ur` `zh_CN` `zh_TW`. Weblate fills them (postulo/postulo#706). `scripts/build.mjs` already leaves an incomplete catalogue out of the package, so none of them ships, and no unfamiliar folder reaches a browser, before it is complete. - `test/i18n.test.mjs`: - The folder is read from the tag's own subtags. `Intl.Locale` applies CLDR's aliases and turned Montenegrin's `cnr` into `sr-ME`; `cnr` is kept as the core writes it, and named as the one tag whose canonical form Intl disagrees with. - Chinese takes its folder's region from its script. - The "scope keeps its name" test skips a catalogue that has no sentence yet. ## Right to left `ar` and `ur` are the first right-to-left languages here. Nothing more was needed: the build writes each catalogue's `direction` from `languages.js` (`rtl` for both), and `i18n.js` sets `document.documentElement.dir` from it on every page. ## Not done here (from #43's checklist) - The Weblate component has `new_lang: none`. Once this is merged, Weblate should pick the 18 files up on its next pull; check that `extension-chromium` lists them. - Trying a browser set to `fr-CA` and `en-CA`, and packing with folders Chrome does not know (`fr_CA`, `cnr`, `kab` later), belongs to #29, in a real Chromium. Until a catalogue is complete the build leaves it out, so the question only arises once Weblate has filled one. ## Tests - `npm test`: 184 passed. - `npm run build`: both targets build; the new languages are reported as left out until complete. - `npm run lint:firefox`: 0 errors, 0 warnings. - `node scripts/guard.mjs` against `main`: no translation written outside Weblate. - `python scripts/languages.py --check` against the core's `main`: matches. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Follow the core's whole roll-out: 18 more languages, the Canadian variants included (#43)
All checks were successful
CI / check (pull_request) Successful in 36s
887949764e
languages.py stopped on every code with a region or a script and no SPELLED entry, so the
extension had not followed the core since en-CA, fr-CA, es-MX, zh-Hans and zh-Hant arrived.
English and French keep the bare folder a browser falls back to, and a second variety is
named by its region (en_CA, fr_CA, es_MX); Chinese is named by region as Chrome names it
(zh_CN, zh_TW) and keeps its script in the tag. The test reads a folder from the tag's own
subtags, since Intl folds Montenegrin's cnr into sr-ME.

Each new language starts as an empty catalogue for Weblate to fill; the build leaves it out
of the package until it is complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tiagoagueda deleted branch 43-languages 2026-10-23 08:23:59 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-chromium!44
No description provided.