Bug 1130246 - Treat general.useragent.locale as a localized pref in DirectoryProvider. r=rnewman

This commit is contained in:
Mike Connor 2015-02-05 20:46:01 -08:00
Родитель 8a79879b02
Коммит 3620b8b17d
1 изменённых файлов: 17 добавлений и 6 удалений

Просмотреть файл

@ -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.