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,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");