Add a display-language setting, so the extension can speak a language other than the browser's #11
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#11
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 speaks the language the browser is set to, on purpose. The README's “Languages” section says “there is no setting for it”, and the header of
src/lib/i18n.jssays “There is nothing to pick and nothing stored.” Every sentence comes throught()from the browser'si18n.getMessage. This issue asks for a display-language setting that overrides the browser, which reverses that decision.Why it is worth reversing
Besides preference (Postulo read in one language, the browser run in another), some shipped translations cannot be reached otherwise. Chrome on Windows, macOS and Linux has no interface in
bs,cy,eu,gl,hy,is,ka,mkorsq, and none inga,lbormton any platform (Chromium'sbuild/config/locales.gni); its extension i18n documentation also leaves 13 of the 40 folders off its list: “If you use an unsupported locale, Google Chrome ignores it.” Their speakers get the browser's language instead. Unverified in a real browser, as is whether Chromium still serves a folder it ignores toruntime.getURL; see #10.What the extension should do
The setting. One more
storage.localkey, empty by default, shown on the settings page as a list: “Follow the browser” first, then the shipped languages, each named in itself (“Deutsch”, “Gaeilge”, “српски”) with its ownlangattribute for screen readers, as the core's picker does. On the 400 px settings page (src/style.css) it fits between the address-and-token form and “Testing and troubleshooting”, and, like the testing switch, takes effect when changed. A stored language no longer shipped is passed over and left as it is.Loading the chosen language. No browser lets an extension set its own language; the API proposed in w3c/webextensions#258 is shipped nowhere. So with a language chosen, the extension loads
_locales/<code>/messages.jsonthroughruntime.getURLand resolves messages bygetMessage's rules: named$placeholder$tokens from the message'splaceholders, then$1to$9from the substitutions,$$for a dollar sign, names regardless of case.langanddirstill come from the catalogue'slanguageTaganddirection.t()is synchronous and each page callslocalise()first inmain(), so the catalogue must be loaded before a page localises, without the HTML's English showing first.i18n.jsthroughsrc/lib/local.jsbut composes no sentence today; the tooltip below, and any tooltip #4 sets, would be the first.src/captures.jsalready watchesoffline,instanceandtoken), without losing an edit in progress.Dates. The popup's “captured before” date uses
toLocaleDateString()with no locale (src/popup.js); it should uset("languageTag"), as the list page'sIntl.DateTimeFormatdoes.What cannot follow. The browser fills the manifest's
__MSG_strings in its own language: the description, the tooltip (action.default_title) and the shortcut's description. The tooltip can follow throughaction.setTitle, set again at start-up (browsers forget it on restart) and on a change. Only Firefox desktop can re-word the shortcut's description, withcommands.update.Decisions for this repository
src/lib/api.jssets noAccept-Language, so the 403 and 422 sentences Postulo writes, which the extension shows as they come, follow whatever the browser sends for that header, not necessarily the extension's language. Recommended: send the tag of the catalogue in use on every API call; the alternative sends it only when a language is chosen. The core words a capture's notification in the account's language, not this header's (postulo/postulo#223). Postulo should matchenandfrto itsen-gbandfr-fr; unchecked.NATIVE_NAMES(recommended: one source, the names Postulo's picker shows).Every new sentence (the label, “Follow the browser”, any hint) must be in all 40
_localesin the same commit with identical placeholders, ortest/i18n.test.mjsfails: each costs 40 translations.Needs from the server
Not filed on postulo/postulo. A “Same as my Postulo” option needs the account's interface language:
Profile.languageexists, butGET /megives onlyname,owner,scopes,expires_atandlast_used_at, and no other call returns it. Limiting the list to what one instance offers needs an endpoint listing its languages; there is none. What works today: the list offers the shipped catalogues, and the person picks the language they read Postulo in.Done when
src/options.*andsrc/lib/i18n.jsupdated. PRIVACY.md's “It keeps” list gains the setting, and “What it sends” says requests carry the language inAccept-Language, if they do.From the list of extension improvements of 2026-09-30.