Closed
Bug 1764802
Opened 3 years ago
Closed 3 years ago
nsStringBundles should be invalidated when the app locale changes
Categories
(Core :: Internationalization, enhancement, P2)
Core
Internationalization
Tracking
()
RESOLVED
INVALID
People
(Reporter: gregtatum, Assigned: gregtatum)
References
(Blocks 1 open bug)
Details
Attachments
(3 obsolete files)
From the JS-side, there are calls like this to create string bundles, and they will never be invalidated when the app locale changes. We should be able to invalidate them through the nsStringBundleService, since it can listen to app locale changes.
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", () => {
return Services.strings.createBundle(
"chrome://browser/locale/browser.properties"
);
});
Then this will work:
Services.locale.requestedLocales = ["en-US"]
console.log(gBrowserBundle.GetStringFromName("addonInstallFullScreenBlocked"))
// "Add-on installation is not allowed while in or before entering fullscreen mode."
Services.locale.requestedLocales = ["es-AR"]
console.log(gBrowserBundle.GetStringFromName("addonInstallFullScreenBlocked"))
"La instalación de complementos no está permitida mientras o antes de entrar a modo de pantalla completa."
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Attachment #9272352 -
Attachment description: WIP: Bug 1764802 - Invalidate nsStringBundles when the app locale changes → Bug 1764802 - Invalidate nsStringBundles when the app locale changes; r?#platform-i18n-reviewers!
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D143745
Assignee | ||
Comment 4•3 years ago
|
||
I have some safety concerns with this and need to investigate more.
Comment 5•3 years ago
|
||
Comment on attachment 9272879 [details]
Bug 1764802 - Add a test for switching locales and string bundles; r?#platform-i18n-reviewers!
Revision D144032 was moved to bug 1761835. Setting attachment 9272879 [details] to obsolete.
Attachment #9272879 -
Attachment is obsolete: true
Assignee | ||
Comment 6•3 years ago
|
||
I'm going to tentatively mark this as invalid since I'm not sure it's a good approach anymore. We instead migrate strings to Fluent.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
Updated•3 years ago
|
Attachment #9272352 -
Attachment is obsolete: true
Updated•3 years ago
|
Attachment #9272880 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•