зеркало из 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,12 +120,23 @@ DirectoryProvider.prototype = {
|
|||
if (!localePlugins.exists())
|
||||
return;
|
||||
|
||||
let curLocale = Services.prefs.getCharPref("general.useragent.locale");
|
||||
let curLocalePlugins = localePlugins.clone();
|
||||
curLocalePlugins.append(curLocale);
|
||||
if (curLocalePlugins.exists()) {
|
||||
array.push(curLocalePlugins);
|
||||
return;
|
||||
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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче