зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1130246 - Treat general.useragent.locale as a localized pref in DirectoryProvider. r=rnewman
This commit is contained in:
Родитель
8a79879b02
Коммит
3620b8b17d
|
@ -120,13 +120,24 @@ DirectoryProvider.prototype = {
|
|||
if (!localePlugins.exists())
|
||||
return;
|
||||
|
||||
let curLocale = Services.prefs.getCharPref("general.useragent.locale");
|
||||
let curLocale = "";
|
||||
try {
|
||||
curLocale = Services.prefs.getComplexValue("general.useragent.locale", Ci.nsIPrefLocalizedString).data;
|
||||
} catch (e) {
|
||||
try {
|
||||
curLocale = Services.prefs.getCharPref("general.useragent.locale");
|
||||
} catch (ee) {
|
||||
}
|
||||
}
|
||||
|
||||
if (curLocale) {
|
||||
let curLocalePlugins = localePlugins.clone();
|
||||
curLocalePlugins.append(curLocale);
|
||||
if (curLocalePlugins.exists()) {
|
||||
array.push(curLocalePlugins);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// We didn't append the locale dir - try the default one.
|
||||
let defLocale = Services.prefs.getCharPref("distribution.searchplugins.defaultLocale");
|
||||
|
|
Загрузка…
Ссылка в новой задаче