Widgets doesn't match UI locale after switching language from settings
Categories
(Firefox :: New Tab Page, defect)
Tracking
()
People
(Reporter: flod, Assigned: mconley)
References
(Blocks 1 open bug)
Details
Attachments
(19 files, 5 obsolete files)
|
124.31 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
692.03 KB,
application/zip
|
Details | |
|
3.24 MB,
application/x-xpinstall
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
|
Bug 2046945 - Part 2: Expose active langpack ids and a webextension-langpack-shutdown observer topic
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
Bug 2046945 - Part 2: Expose active langpack ids and a webextension-langpack-shutdown observer topic
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
Bug 2046945 - Part 2: Expose active langpack ids and a webextension-langpack-shutdown observer topic
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
Use Firefox Release and make sure the World Cup widget is enabled. In my case, the build is in Italian.
Go to Settings and switch language, e.g. to German. The widget remains in Italian, restarting the browser doesn't update it.
| Reporter | ||
Comment 1•11 days ago
•
|
||
Sadly widgets seem to be all over the place.
I have some widgets partially in German and Italian (Checklist). World Clock shows tooltips in Italian. World Cup widget is in Italian. Time seems to be in German.
| Reporter | ||
Comment 2•11 days ago
|
||
[Tracking Requested - why for this release]: this is a very poor experience for users switching language at run-time, which includes MSIX builds and most Linux distro.
| Reporter | ||
Comment 3•11 days ago
|
||
I've tested a local build (using these instructions to change locale) and it seems to behave correctly.
I'm starting to think that the problem might be with the train-hop code? Is there a way to verify that, e.g. use the built-in version?
I think I've also seen New Tab settings being half-translated at some point, but can't replicate.
| Reporter | ||
Comment 4•11 days ago
|
||
In my release build, the New Tab XPI is at version 153.3.20260605.21338 (from browser.newtabpage.trainhopAddon.version).
unzip -p newtab@mozilla.org.xpi locales/locales-report.json \
| python3 -c 'import json,sys; r=json.load(sys.stdin); \
print("snapshot:", r["meta"]["updated"]); \
m=r["locales"]["de"].get("missing",{}); \
print("de missing:", sorted(i for v in m.values() for i in v))'
snapshot: 2026-06-04T19:16:58.548047
de missing: ['newtab-sports-widget-match-vs', 'newtab-sports-widget-no-upcoming-matches', 'newtab-sports-widget-team-tbd']
For example, the checklist add button label is in there.
Updated•11 days ago
|
| Reporter | ||
Comment 5•11 days ago
|
||
This is the result of me spending way too much time digging through this bug with Claude. Leaving it for HNT engineers to evaluate if it makes any sense.
- The
"newtab"Fluent source is registered only on the XPI path and asynchronously:registerFluentSourcesawaitsfetch("/locales/supported-locales.json")before calling_updateFluentSourcesRegistration. - Content processes get Fluent sources synchronously at init (
RegisterFileSourcesFromParentProcess), plus runtime updates viaL10nRegistrySendUpdateL10nFileSources. But a content document'sDOMLocalizationonly re-translates onintl:app-locales-changed— not when a source-update IPC arrives. - So about:newtab / about:home renders before that source is wired into the content document, and nothing re-translates it when the source shows up. newtab strings then resolve only from the langpack/omnijar: strings present there render fine, while train-hop-only / re-keyed strings keep their baked-in default or fall back through.
Evidence: in the parent process, new Localization(["browser/newtab/newtab.ftl"]).formatValue("newtab-widget-lists-button-add-item") returns the correct German — the registry is complete; only the content document is missing the source.
Possible fix: register the "newtab" source before content renders (read supported-locales.json synchronously instead of await fetch), and re-translate open about:newtab / about:home documents after _updateFluentSourcesRegistration (both initial and on locale change).
Comment 6•11 days ago
|
||
The bug is marked as tracked for firefox152 (beta) and tracked for firefox153 (nightly). However, the bug still isn't assigned.
:thecount, could you please find an assignee for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.
For more information, please visit BugBot documentation.
@maxx can we get a fix for this in the next trainhop?
| Assignee | ||
Comment 8•8 days ago
|
||
Hey Stephen,
I've started poking at this one, and at this point, I'm fairly convinced that it requires changes in the base application, and cannot be fixed with a trainhop. This means that, given where we are in the release cycle, a fix for this (assuming I can get one crafted in the next day or so) will be available in the first dot release of 152 (June 23rd, so a week tomorrow).
If there is sufficient urgency and user impact here, we could talk to RelMan about an out-of-band dot release, but I believe the weekly dot releases mean that the bar for out-of-band dot releases is much higher than it used to be.
Updated•8 days ago
|
| Assignee | ||
Comment 9•7 days ago
|
||
Long-lived Localization instances cache the bundles they generate on first
use. Until now, no observer notification fired when sources were registered,
updated, or removed in L10nRegistry, so those caches were never invalidated;
any source registered after startup (e.g. by AboutNewTabResourceMapping when
a train-hopped newtab XPI is active) was invisible to already-translated
documents.
We introduce a new intl:l10n-sources-changed observer topic, fired by
L10nRegistry in both the parent (L10nRegistrySendUpdateL10nFileSources) and
content (RegisterFileSourcesFromParentProcess) processes after the registry
has been mutated. Localization::Observe now listens for it and drops cached
bundles, mirroring its existing handling of intl:app-locales-changed.
A dedicated topic is used rather than reusing intl:app-locales-changed so
the ~30 other observers that care only about negotiated-locale changes
(font list, mozIntl caches, sidebar, tabbrowser, …) aren't woken on every
source mutation.
| Assignee | ||
Comment 10•7 days ago
|
||
Consumers of L10nRegistry that want to register sources alongside a
langpack's (for example, to provide a locale-specific override for an
individual resource) need two things this module didn't previously
provide: an authoritative enumeration of currently-active langpacks at
the time the consumer initializes, and lifecycle notifications symmetric
to the existing webextension-langpack-startup topic.
We add a static Langpack.activeLangpackIds Set, mutated at the same
callsites that mutate the L10nRegistry, exposing the langpack metasource
strings (startupData.langpackId, which is not the addon's id). We then
fire a new webextension-langpack-shutdown observer topic before the langpack
removes its L10nRegistry sources, so consumers can clean up parallel
registrations in the same metasource before it goes away.
The first consumer in AboutNewTabResourceMapping in the next patch in this
series.
| Assignee | ||
Comment 11•7 days ago
|
||
The L10nRegistry solver builds bundles atomically per (locale, metasource):
so every required resource must be satisfiable from sources in that
metasource for that locale, or no bundle is produced.
The "app" metasource's non-newtab sources (toolkit, browser) are packaged en-US
only, so with a non-English langpack the (locale, "app") bundle can never be
built — and the train-hop newtab XPI's locale-specific strings are
unreachable, falling through to en-US. That is why train-hop-only widget
strings (added to the XPI but not yet present in any langpack) were
rendering in the wrong language.
We make AboutNewTabResourceMapping also register a shadow newtab
L10nFileSource into each active langpack's metasource, enumerated via
Langpack.activeLangpackIds and kept in sync with
webextension-langpack-startup/-shutdown observer notifications). Within the
(locale, langpack) bundle, the solver now yields two valid orderings: one
with the langpack's older newtab.ftl, one with the XPI's. Fluent falls
through the former on missing keys and resolves train-hop-only strings
from the latter, while strings the langpack already translates continue
to come from the langpack.
| Assignee | ||
Comment 12•6 days ago
|
||
| Assignee | ||
Comment 13•6 days ago
|
||
Comment 14•6 days ago
|
||
Comment 15•6 days ago
|
||
Comment 16•6 days ago
|
||
Backed out for causing failures at test_ext_permissions.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/a2f41ceb0459
Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=5e620d8e172d19dd07a081055c4dec907000ab3d
Failure logs:
https://treeherder.mozilla.org/logviewer?job_id=573244656&repo=autoland&task=RQnHW5-YTfOKkncp0xaYMw.0&lineNumber=14801
https://treeherder.mozilla.org/logviewer?job_id=573245712&repo=autoland&task=HDNxFAylTfqPIvy7KVwwTg.0&lineNumber=15312
| Assignee | ||
Comment 17•6 days ago
|
||
Comment 18•5 days ago
|
||
Comment 19•5 days ago
|
||
Backed out for causing xpcshells and TV-nofis failures at l10nregistry_observer.js
Backout Link
Push with failures
Failure Log
Failure line TEST-UNEXPECTED-FAIL | intl/l10n/test/test_l10nregistry_observer.js | test_localization_invalidates_on_topic - [test_localization_invalidates_on_topic : 110] After intl:l10n-sources-changed, Localization picks up the updated source - "before" == "after"
Comment 20•5 days ago
|
||
| Assignee | ||
Comment 21•5 days ago
|
||
Long-lived Localization instances cache the bundles they generate on first
use. Until now, no observer notification fired when sources were registered,
updated, or removed in L10nRegistry, so those caches were never invalidated;
any source registered after startup (e.g. by AboutNewTabResourceMapping when
a train-hopped newtab XPI is active) was invisible to already-translated
documents.
We introduce a new intl:l10n-sources-changed observer topic, fired by
L10nRegistry in both the parent (L10nRegistrySendUpdateL10nFileSources) and
content (RegisterFileSourcesFromParentProcess) processes after the registry
has been mutated. Localization::Observe now listens for it and drops cached
bundles, mirroring its existing handling of intl:app-locales-changed.
A dedicated topic is used rather than reusing intl:app-locales-changed so
the ~30 other observers that care only about negotiated-locale changes
(font list, mozIntl caches, sidebar, tabbrowser, …) aren't woken on every
source mutation.
Updated•5 days ago
|
| Assignee | ||
Comment 22•5 days ago
|
||
Updated•5 days ago
|
| Assignee | ||
Comment 23•5 days ago
|
||
Consumers of L10nRegistry that want to register sources alongside a
langpack's (for example, to provide a locale-specific override for an
individual resource) need two things this module didn't previously
provide: an authoritative enumeration of currently-active langpacks at
the time the consumer initializes, and lifecycle notifications symmetric
to the existing webextension-langpack-startup topic.
We add a static Langpack.activeLangpackIds Set, mutated at the same
callsites that mutate the L10nRegistry, exposing the langpack metasource
strings (startupData.langpackId, which is not the addon's id). We then
fire a new webextension-langpack-shutdown observer topic before the langpack
removes its L10nRegistry sources, so consumers can clean up parallel
registrations in the same metasource before it goes away.
The first consumer in AboutNewTabResourceMapping in the next patch in this
series.
Updated•5 days ago
|
Comment 24•5 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Users with non-en-US langpacks installed (So non-en-US users on MSIX on Windows, Linux) may find some of their New Tab UI isn't localized properly, and is falling back to en-US.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: Ensure that New Tab 153.5.20260615.213953 is installed. This may require you to force enroll in https://experimenter.services.mozilla.com/nimbus/new-tab-153520260615213953-to-release-152-wcw-v4/summary/.
Install an alternative langpack for release or beta, and ensure that recent strings are available in the relevant locale.
Then, in New Tab, open up the devtools console, and paste / execute this command:
(await document.l10n.formatMessages(["home-homepage-title"]))[0].attributes[0].value
and ensure that a string is returned ("Homepage" in en-US, but something appropriate for the installed langpack).
- Risk associated with taking this patch: low
- Explanation of risk level: This set of patches includes unit tests, and while it's scary that it has C++ changes, those changes really just add an observer notification that only the New Tab listens to. Same with the extensions change, which just exposes some things for New Tab to listen to. So really, the blast radius is restricted to New Tab - and I'm fairly confident we've got this right.
- String changes made/needed?: None.
- Is Android affected?: no
| Assignee | ||
Comment 25•5 days ago
|
||
The L10nRegistry solver builds bundles atomically per (locale, metasource):
so every required resource must be satisfiable from sources in that
metasource for that locale, or no bundle is produced.
The "app" metasource's non-newtab sources (toolkit, browser) are packaged en-US
only, so with a non-English langpack the (locale, "app") bundle can never be
built — and the train-hop newtab XPI's locale-specific strings are
unreachable, falling through to en-US. That is why train-hop-only widget
strings (added to the XPI but not yet present in any langpack) were
rendering in the wrong language.
We make AboutNewTabResourceMapping also register a shadow newtab
L10nFileSource into each active langpack's metasource, enumerated via
Langpack.activeLangpackIds and kept in sync with
webextension-langpack-startup/-shutdown observer notifications). Within the
(locale, langpack) bundle, the solver now yields two valid orderings: one
with the langpack's older newtab.ftl, one with the XPI's. Fluent falls
through the former on missing keys and resolves train-hop-only strings
from the latter, while strings the langpack already translates continue
to come from the langpack.
| Assignee | ||
Comment 26•5 days ago
|
||
Long-lived Localization instances cache the bundles they generate on first
use. Until now, no observer notification fired when sources were registered,
updated, or removed in L10nRegistry, so those caches were never invalidated;
any source registered after startup (e.g. by AboutNewTabResourceMapping when
a train-hopped newtab XPI is active) was invisible to already-translated
documents.
We introduce a new intl:l10n-sources-changed observer topic, fired by
L10nRegistry in both the parent (L10nRegistrySendUpdateL10nFileSources) and
content (RegisterFileSourcesFromParentProcess) processes after the registry
has been mutated. Localization::Observe now listens for it and drops cached
bundles, mirroring its existing handling of intl:app-locales-changed.
A dedicated topic is used rather than reusing intl:app-locales-changed so
the ~30 other observers that care only about negotiated-locale changes
(font list, mozIntl caches, sidebar, tabbrowser, …) aren't woken on every
source mutation.
Updated•5 days ago
|
| Assignee | ||
Comment 27•5 days ago
|
||
Updated•5 days ago
|
| Assignee | ||
Comment 28•5 days ago
|
||
Consumers of L10nRegistry that want to register sources alongside a
langpack's (for example, to provide a locale-specific override for an
individual resource) need two things this module didn't previously
provide: an authoritative enumeration of currently-active langpacks at
the time the consumer initializes, and lifecycle notifications symmetric
to the existing webextension-langpack-startup topic.
We add a static Langpack.activeLangpackIds Set, mutated at the same
callsites that mutate the L10nRegistry, exposing the langpack metasource
strings (startupData.langpackId, which is not the addon's id). We then
fire a new webextension-langpack-shutdown observer topic before the langpack
removes its L10nRegistry sources, so consumers can clean up parallel
registrations in the same metasource before it goes away.
The first consumer in AboutNewTabResourceMapping in the next patch in this
series.
Updated•5 days ago
|
Comment 29•5 days ago
|
||
firefox-release Uplift Approval Request
- User impact if declined/Reason for urgency: Users with non-en-US langpacks installed (So non-en-US users on MSIX on Windows, Linux) may find some of their New Tab UI isn't localized properly, and is falling back to en-US.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: Ensure that New Tab 153.5.20260615.213953 is installed. This may require you to force enroll in https://experimenter.services.mozilla.com/nimbus/new-tab-153520260615213953-to-release-152-wcw-v4/summary/.
Install an alternative langpack for release or beta, and ensure that recent strings are available in the relevant locale.
Then, in New Tab, open up the devtools console, and paste / execute this command:
(await document.l10n.formatMessages(["home-homepage-title"]))[0].attributes[0].value
and ensure that a string is returned ("Homepage" in en-US, but something appropriate for the installed langpack).
- Risk associated with taking this patch: low
- Explanation of risk level: This set of patches includes unit tests, and while it's scary that it has C++ changes, those changes really just add an observer notification that only the New Tab listens to. Same with the extensions change, which just exposes some things for New Tab to listen to. So really, the blast radius is restricted to New Tab - and I'm fairly confident we've got this right.
- String changes made/needed?: None.
- Is Android affected?: no
| Assignee | ||
Comment 30•5 days ago
|
||
The L10nRegistry solver builds bundles atomically per (locale, metasource):
so every required resource must be satisfiable from sources in that
metasource for that locale, or no bundle is produced.
The "app" metasource's non-newtab sources (toolkit, browser) are packaged en-US
only, so with a non-English langpack the (locale, "app") bundle can never be
built — and the train-hop newtab XPI's locale-specific strings are
unreachable, falling through to en-US. That is why train-hop-only widget
strings (added to the XPI but not yet present in any langpack) were
rendering in the wrong language.
We make AboutNewTabResourceMapping also register a shadow newtab
L10nFileSource into each active langpack's metasource, enumerated via
Langpack.activeLangpackIds and kept in sync with
webextension-langpack-startup/-shutdown observer notifications). Within the
(locale, langpack) bundle, the solver now yields two valid orderings: one
with the langpack's older newtab.ftl, one with the XPI's. Fluent falls
through the former on missing keys and resolves train-hop-only strings
from the latter, while strings the langpack already translates continue
to come from the langpack.
Updated•5 days ago
|
Comment 31•5 days ago
|
||
| uplift | ||
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Comment 32•5 days ago
|
||
| uplift | ||
Comment 33•5 days ago
•
|
||
Rolled back from beta and release for causing xpc failures
Note this passed in autoland.
Claude says:
The difference is the locale packaging of the build under test, not the code:
- autoland / central: Android GeckoView test builds are single-locale en-US. Available locales is trivially {en-US}. Registering an en-US source → recomputed list is still {en-US} → no change → topic doesn't fire → PASS.
- beta / release: Android GeckoView is built multi-locale (it ships all the shipping locales). Available locales is a large list. Registering/removing a source perturbs the recomputed list (membership and/or ordering) enough that SetAvailableLocales sees a difference, re-negotiates, and the negotiated set changes → intl:app-locales-changed fires → assertion !fired is false → FAIL.
Comment 34•5 days ago
|
||
| backout uplift | ||
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Comment 35•5 days ago
|
||
| backout uplift | ||
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Comment 36•5 days ago
|
||
Comment 37•5 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/4cdfcf1ffba7
https://hg.mozilla.org/mozilla-central/rev/6b0730c30744
https://hg.mozilla.org/mozilla-central/rev/203fbb945a56
https://hg.mozilla.org/mozilla-central/rev/3e5c4b170c49
| Assignee | ||
Comment 38•4 days ago
|
||
The test asserted that registering an L10nFileSource with a locale
already in availableLocales would not fire intl:app-locales-changed.
But L10nRegistry::getAvailableLocales builds its result from a Rust
HashSet, whose iteration order is platform-randomized, and
LocaleService::SetAvailableLocales compares as an order-sensitive
nsTArray, so a no-op-for-the-set registration can still cascade
through LocalesChanged on platforms where the order differs
(reproducibly on Android shippable).
This was a belt-and-suspenders test I added for the first iteration of
the patches for bug 2046945, when we were having Localization.cpp flush
its internal notion of bundles when the sources changed. Since we're
no longer doing that, this test is just getting in the way.
Updated•4 days ago
|
Comment 39•4 days ago
|
||
Comment on attachment 9599062 [details]
Bug 2046945 - Remove platform-fragile test_topic_separation_from_app_locales_changed r?eemeli!
Revision D307673 was moved to bug 2048663. Setting attachment 9599062 [details] to obsolete.
Updated•4 days ago
|
| Assignee | ||
Comment 40•4 days ago
|
||
Long-lived Localization instances cache the bundles they generate on first
use. Until now, no observer notification fired when sources were registered,
updated, or removed in L10nRegistry, so those caches were never invalidated;
any source registered after startup (e.g. by AboutNewTabResourceMapping when
a train-hopped newtab XPI is active) was invisible to already-translated
documents.
We introduce a new intl:l10n-sources-changed observer topic, fired by
L10nRegistry in both the parent (L10nRegistrySendUpdateL10nFileSources) and
content (RegisterFileSourcesFromParentProcess) processes after the registry
has been mutated. Localization::Observe now listens for it and drops cached
bundles, mirroring its existing handling of intl:app-locales-changed.
A dedicated topic is used rather than reusing intl:app-locales-changed so
the ~30 other observers that care only about negotiated-locale changes
(font list, mozIntl caches, sidebar, tabbrowser, …) aren't woken on every
source mutation.
Updated•4 days ago
|
| Assignee | ||
Comment 41•4 days ago
|
||
Updated•4 days ago
|
| Assignee | ||
Comment 42•4 days ago
|
||
Consumers of L10nRegistry that want to register sources alongside a
langpack's (for example, to provide a locale-specific override for an
individual resource) need two things this module didn't previously
provide: an authoritative enumeration of currently-active langpacks at
the time the consumer initializes, and lifecycle notifications symmetric
to the existing webextension-langpack-startup topic.
We add a static Langpack.activeLangpackIds Set, mutated at the same
callsites that mutate the L10nRegistry, exposing the langpack metasource
strings (startupData.langpackId, which is not the addon's id). We then
fire a new webextension-langpack-shutdown observer topic before the langpack
removes its L10nRegistry sources, so consumers can clean up parallel
registrations in the same metasource before it goes away.
The first consumer in AboutNewTabResourceMapping in the next patch in this
series.
Updated•4 days ago
|
| Assignee | ||
Comment 43•4 days ago
|
||
The L10nRegistry solver builds bundles atomically per (locale, metasource):
so every required resource must be satisfiable from sources in that
metasource for that locale, or no bundle is produced.
The "app" metasource's non-newtab sources (toolkit, browser) are packaged en-US
only, so with a non-English langpack the (locale, "app") bundle can never be
built — and the train-hop newtab XPI's locale-specific strings are
unreachable, falling through to en-US. That is why train-hop-only widget
strings (added to the XPI but not yet present in any langpack) were
rendering in the wrong language.
We make AboutNewTabResourceMapping also register a shadow newtab
L10nFileSource into each active langpack's metasource, enumerated via
Langpack.activeLangpackIds and kept in sync with
webextension-langpack-startup/-shutdown observer notifications). Within the
(locale, langpack) bundle, the solver now yields two valid orderings: one
with the langpack's older newtab.ftl, one with the XPI's. Fluent falls
through the former on missing keys and resolves train-hop-only strings
from the latter, while strings the langpack already translates continue
to come from the langpack.
Updated•4 days ago
|
| Assignee | ||
Comment 44•4 days ago
|
||
Long-lived Localization instances cache the bundles they generate on first
use. Until now, no observer notification fired when sources were registered,
updated, or removed in L10nRegistry, so those caches were never invalidated;
any source registered after startup (e.g. by AboutNewTabResourceMapping when
a train-hopped newtab XPI is active) was invisible to already-translated
documents.
We introduce a new intl:l10n-sources-changed observer topic, fired by
L10nRegistry in both the parent (L10nRegistrySendUpdateL10nFileSources) and
content (RegisterFileSourcesFromParentProcess) processes after the registry
has been mutated. Localization::Observe now listens for it and drops cached
bundles, mirroring its existing handling of intl:app-locales-changed.
A dedicated topic is used rather than reusing intl:app-locales-changed so
the ~30 other observers that care only about negotiated-locale changes
(font list, mozIntl caches, sidebar, tabbrowser, …) aren't woken on every
source mutation.
Updated•4 days ago
|
| Assignee | ||
Comment 45•4 days ago
|
||
Updated•4 days ago
|
| Assignee | ||
Comment 46•4 days ago
|
||
Consumers of L10nRegistry that want to register sources alongside a
langpack's (for example, to provide a locale-specific override for an
individual resource) need two things this module didn't previously
provide: an authoritative enumeration of currently-active langpacks at
the time the consumer initializes, and lifecycle notifications symmetric
to the existing webextension-langpack-startup topic.
We add a static Langpack.activeLangpackIds Set, mutated at the same
callsites that mutate the L10nRegistry, exposing the langpack metasource
strings (startupData.langpackId, which is not the addon's id). We then
fire a new webextension-langpack-shutdown observer topic before the langpack
removes its L10nRegistry sources, so consumers can clean up parallel
registrations in the same metasource before it goes away.
The first consumer in AboutNewTabResourceMapping in the next patch in this
series.
Updated•4 days ago
|
| Assignee | ||
Comment 47•4 days ago
|
||
The L10nRegistry solver builds bundles atomically per (locale, metasource):
so every required resource must be satisfiable from sources in that
metasource for that locale, or no bundle is produced.
The "app" metasource's non-newtab sources (toolkit, browser) are packaged en-US
only, so with a non-English langpack the (locale, "app") bundle can never be
built — and the train-hop newtab XPI's locale-specific strings are
unreachable, falling through to en-US. That is why train-hop-only widget
strings (added to the XPI but not yet present in any langpack) were
rendering in the wrong language.
We make AboutNewTabResourceMapping also register a shadow newtab
L10nFileSource into each active langpack's metasource, enumerated via
Langpack.activeLangpackIds and kept in sync with
webextension-langpack-startup/-shutdown observer notifications). Within the
(locale, langpack) bundle, the solver now yields two valid orderings: one
with the langpack's older newtab.ftl, one with the XPI's. Fluent falls
through the former on missing keys and resolves train-hop-only strings
from the latter, while strings the langpack already translates continue
to come from the langpack.
Updated•4 days ago
|
Updated•3 days ago
|
Updated•3 days ago
|
Updated•3 days ago
|
Updated•3 days ago
|
Updated•3 days ago
|
Comment 48•3 days ago
|
||
| uplift | ||
Updated•2 days ago
|
Updated•2 days ago
|
Updated•2 days ago
|
Updated•2 days ago
|
Updated•2 days ago
|
Updated•2 days ago
|
Updated•2 days ago
|
Comment 49•2 days ago
|
||
| uplift | ||
Comment 50•1 day ago
|
||
Added to the 152.0.2 relnotes.
Updated•1 day ago
|
Updated•1 day ago
|
Updated•1 day ago
|
Updated•1 day ago
|
Verified that this is fixed on Firefox 152.0.2, Firefox 153.0b3 and Firefox 154.0a1 (2026-06-21) by following the info provided in Comment 29. Tests were performed on macOS 26.5.1, Windows 11 and Ubuntu 26.04.
Updated•1 day ago
|
Updated•1 day ago
|
Updated•1 day ago
|
Updated•1 day ago
|
Description
•