Bug 1479377 - Provide fallbacks for switch language in Prefs message r=gandalf

MozReview-Commit-ID: G3oeSWl1Rtf

--HG--
extra : rebase_source : 7f2f208793a601b3ada1971cda827f50f3a8fda3
This commit is contained in:
Mark Striemer 2018-07-30 15:03:51 -05:00
parent 1c14c56cce
commit dd3400571a

View File

@ -235,10 +235,15 @@ if (AppConstants.MOZ_UPDATER) {
// 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",