Bug 1479377 - Provide fallbacks for switch language in Prefs message r?gandalf
MozReview-Commit-ID: G3oeSWl1Rtf
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -230,20 +230,25 @@ if (AppConstants.MOZ_UPDATER) {
]);
}
}
// A promise that resolves when the list of application handlers is loaded.
// We store this in a global so tests can await it.
var promiseLoadHandlersList;
-// Load the preferences string bundle for a given locale.
+// Load the preferences string bundle for a given locale with fallbacks.
function getBundleForLocale(locale) {
+ let locales = Array.from(new Set([
+ locale,
+ ...Services.locale.getRequestedLocales(),
+ Services.locale.lastFallbackLocale,
+ ]));
function generateContexts(resourceIds) {
- return L10nRegistry.generateContexts([locale], resourceIds);
+ return L10nRegistry.generateContexts(locales, resourceIds);
}
return new Localization([
"browser/preferences/preferences.ftl",
"branding/brand.ftl",
], generateContexts);
}
var gNodeToObjectMap = new WeakMap();