Follow the core's language roll-out in the extension by a script and a test, instead of by hand #10
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The extension ships 40 catalogues under
src/_locales/, and a Postulo left with its defaults offers the same 40:en-gbplus the 39 catalogues started in the core'ssrc/postulo/locale/status.json, four codes spelled differently (en-gb→en,fr-fr→fr,pt-pt→pt_PT,pt-br→pt_BR). The match is kept by hand.test/i18n.test.mjshard-codes the list asOFFERED; the README says both “the 39 European catalogues the core has complete” and “A language joins here when the core starts offering it”; nothing reads the core's list at build, test or run time, and CI checks out only this repository. Commit08774a2pairs the version number and nothing else (postulo/postulo#186). This issue asks for the extension's languages to follow the core's roll-out by a rule that is checked, not remembered.The two lists already follow different rules
The core offers a language once its catalogue is started (
translatedabove 0 instatus.json;language_choices()insrc/postulo/accounts/forms.py), minus any an administrator takes off the list (SiteSettings.offered_languages). The extension's test calls its list “the core's catalogues at 100%” and demands all 115 keys, non-empty, in every locale, so a partly translated extension language cannot exist.They split the day the core starts a catalogue. It already holds 29 with nothing translated, the African set added for postulo/postulo#70, among them Arabic, written right to left; which languages come next is postulo/postulo#269, by number of speakers.
What the extension should do
scripts/icons.py, reads the core beside this one (../postulo):src/postulo/core/languages.py(NATIVE_NAMESandRTL, importable without Django) andsrc/postulo/locale/status.json, whereen-gb, the source, has no row and is always in. It writes a committed list of the languages to ship, each with its folder name, direction and own name, so neither build nor tests need Python or the core.test/i18n.test.mjsasserts, in place ofOFFERED, that the_localesfolders equal the committed list and that each catalogue'sdirectionmatches it.ar) brings a right-to-left check:src/lib/i18n.jssetsdirfromdirectionandsrc/style.cssnames no physical side, but no test renders a page that way.Decisions for this repository
v0.3.0) and its catalogues are part of the reviewed package, so its languages change only with a release; an administrator's narrowing plays no part. The alternative is the instance it is connected to, at run time: that needs the server (below), and could only narrow the shipped catalogues, in practice the list #11 offers.percent100), which keeps the test's comment true but has the extension lag the core.package.json's version (the core tags its releases; this repository does not), runs the script and fails on a difference. The core's main can be a catalogue ahead of its last tag, so this suits a release check better than every push._localesare not a Weblate component, and its WebExtension JSON format cannot mark a string as a draft. For later, not this issue.Shipped is not always reachable, in Chromium
Chrome's extension i18n documentation says “If you use an unsupported locale, Google Chrome ignores it”, and 13 of the 40 folders are not on its list:
bs,cy,eu,ga,gl,hy,is,ka,lb,mk,mt,nb(it listsno) andsq; of the 29 waiting in the core, onlyam,arandsware. Chromium's code (extensions/common/extension_l10n_util.cc) skips only folders that are not ICU locales, so which are dropped is unclear. AndgetMessagefollows the browser's language, while Chrome on Windows, macOS and Linux has no interface inbs,cy,eu,gl,hy,is,ka,mkorsq, and none inga,lbormton any platform (build/config/locales.gni). None of this is verified in a real browser. If it holds, a faithful mirror still misses those speakers in Chrome; #11 reaches them.Needs from the server
Following one instance at run time needs the core to say which languages it offers. No call does:
/healthzreturnsstatus,databaseandversion, andGET /mereturns no language. Not filed on postulo/postulo; the per-release list works with the server as it is.Done when
npm testfails when_localesdiffers from it.From the list of extension improvements of 2026-09-30.
Final decision on translations (maintainer, 2026-10-01)
What this changes here
_locales/folder only for a language the core offers, as this issue already proposes, not for every scaffolded one. The browser has no notion of an empty catalogue.fr_CAanden_CA(0.5.0), then the European languages still missing, then Chinese and Arabic. Arabic is the first right-to-left language the popup has to lay out.Follow-up to the final decision on translations (maintainer, 2026-10-01)
zh-Hans,zh-Hant).The work is postulo/postulo#347.