Languages: follow the core's whole roll-out, the Canadian variants included #43

Closed
opened 2026-10-23 08:13:17 +00:00 by tiagoagueda · 0 comments
Owner

The extension ships 40 of the core's 84 languages. The core's roll-out has moved on and scripts/languages.py can no longer follow it: it stops on any code with a region or a script that has no entry in SPELLED, and the core now has five of them. The Thunderbird extension already follows the whole roll-out (postulo/postulo-thunderbird#18); this one should too.

Found on 2026-10-23 while reviewing the Canadian variants in Weblate: every other component has en_CA and fr_CA translated, but extension-chromium has no catalogue for them, so there is nothing for Weblate to translate.

What is missing

Compared with src/postulo/locale/ in the core at main (84 catalogues) against src/_locales/ here (40):

  • Codes languages.py cannot spell yet (region or script, no SPELLED entry): en-CA, fr-CA, es-MX, zh-Hans, zh-Hant.
  • Plain codes the core started since the last run: af ak am ar az be bm bn cnr ee ff fo ha hi id ig kab kk ln mg nn nr ny om rm rw sn so ss st sw ti tn ts ur ve wo xh yo zu.

fr, en and sr are here under the extension's own spelling of fr-FR, en-GB and sr-Cyrl and are not missing.

Change

  • Add the five to SPELLED. The rule in its comment already decides most of them: the region stays where the core has two varieties of a language, so fr-FR and fr-CA become two folders, fr and fr_CA; likewise en and en_CA, es and es_MX. Chinese has two scripts and no plain code, so zh_Hans and zh_Hant need a decision. Chrome names them zh_CN and zh_TW, which say a region the core does not.
  • Run python scripts/languages.py against the current core, add an empty catalogue for each new folder in Weblate's layout, and let Weblate fill them (translations come from Weblate only, postulo/postulo#706).
  • ar and ur are the first right-to-left languages here; check that direction from languages.js reaches the popup and the review screen.

To verify before shipping

i18n.js has two paths. A language the person picks in the settings is read from its catalogue by the extension itself, so any folder name works there. The browser's own language goes through chrome.i18n, which only matches the locale names Chrome supports (en_GB, es_419, pt_PT, zh_CN and so on; not en_CA, fr_CA or es_MX). Check in a real Chromium, and in a Firefox build of it, that:

  • unknown folders such as fr_CA or kab do not stop the extension loading or packing, and are not refused by the Chrome Web Store;
  • a browser set to fr-CA falls back to fr and not to English, and one set to en-CA to en.

If Chrome refuses an unknown folder, the build could leave those languages out of what chrome.i18n sees and offer them only through the settings' picker.

Related: #29 (try the extension in a real Chromium and Firefox).

Done when

  • python scripts/languages.py --check passes against the core's current main.
  • src/_locales/ has a folder for every language the core has started, and extension-chromium in Weblate lists them all.
  • The two checks above are done, and the decisions on Chinese and on unsupported Chrome folders are written in languages.py.
The extension ships 40 of the core's 84 languages. The core's roll-out has moved on and `scripts/languages.py` can no longer follow it: it stops on any code with a region or a script that has no entry in `SPELLED`, and the core now has five of them. The Thunderbird extension already follows the whole roll-out (postulo/postulo-thunderbird#18); this one should too. Found on 2026-10-23 while reviewing the Canadian variants in Weblate: every other component has `en_CA` and `fr_CA` translated, but `extension-chromium` has no catalogue for them, so there is nothing for Weblate to translate. ## What is missing Compared with `src/postulo/locale/` in the core at `main` (84 catalogues) against `src/_locales/` here (40): - **Codes `languages.py` cannot spell yet** (region or script, no `SPELLED` entry): `en-CA`, `fr-CA`, `es-MX`, `zh-Hans`, `zh-Hant`. - **Plain codes the core started since the last run**: `af` `ak` `am` `ar` `az` `be` `bm` `bn` `cnr` `ee` `ff` `fo` `ha` `hi` `id` `ig` `kab` `kk` `ln` `mg` `nn` `nr` `ny` `om` `rm` `rw` `sn` `so` `ss` `st` `sw` `ti` `tn` `ts` `ur` `ve` `wo` `xh` `yo` `zu`. `fr`, `en` and `sr` are here under the extension's own spelling of `fr-FR`, `en-GB` and `sr-Cyrl` and are not missing. ## Change - Add the five to `SPELLED`. The rule in its comment already decides most of them: the region stays where the core has two varieties of a language, so `fr-FR` and `fr-CA` become two folders, `fr` and `fr_CA`; likewise `en` and `en_CA`, `es` and `es_MX`. Chinese has two scripts and no plain code, so `zh_Hans` and `zh_Hant` need a decision. Chrome names them `zh_CN` and `zh_TW`, which say a region the core does not. - Run `python scripts/languages.py` against the current core, add an empty catalogue for each new folder in Weblate's layout, and let Weblate fill them (translations come from Weblate only, postulo/postulo#706). - `ar` and `ur` are the first right-to-left languages here; check that `direction` from `languages.js` reaches the popup and the review screen. ## To verify before shipping `i18n.js` has two paths. A language the person picks in the settings is read from its catalogue by the extension itself, so any folder name works there. The browser's own language goes through `chrome.i18n`, which only matches the locale names Chrome supports (`en_GB`, `es_419`, `pt_PT`, `zh_CN` and so on; not `en_CA`, `fr_CA` or `es_MX`). Check in a real Chromium, and in a Firefox build of it, that: - unknown folders such as `fr_CA` or `kab` do not stop the extension loading or packing, and are not refused by the Chrome Web Store; - a browser set to `fr-CA` falls back to `fr` and not to English, and one set to `en-CA` to `en`. If Chrome refuses an unknown folder, the build could leave those languages out of what `chrome.i18n` sees and offer them only through the settings' picker. Related: #29 (try the extension in a real Chromium and Firefox). ## Done when - `python scripts/languages.py --check` passes against the core's current `main`. - `src/_locales/` has a folder for every language the core has started, and `extension-chromium` in Weblate lists them all. - The two checks above are done, and the decisions on Chinese and on unsupported Chrome folders are written in `languages.py`.
Sign in to join this conversation.
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#43
No description provided.