зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1106119 - fix locale detection for menu panel, r=mconley
--HG-- extra : rebase_source : c8a195a8bcccfb514dde04f5537ba29d9c36b493
This commit is contained in:
Родитель
e57e4a952e
Коммит
2e2dc75200
|
@ -515,19 +515,11 @@ const PanelUI = {
|
|||
* @return the selected locale or "en-US" if none is selected
|
||||
*/
|
||||
function getLocale() {
|
||||
const PREF_SELECTED_LOCALE = "general.useragent.locale";
|
||||
try {
|
||||
let locale = Services.prefs.getComplexValue(PREF_SELECTED_LOCALE,
|
||||
Ci.nsIPrefLocalizedString);
|
||||
if (locale)
|
||||
return locale;
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
try {
|
||||
return Services.prefs.getCharPref(PREF_SELECTED_LOCALE);
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
let chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
||||
.getService(Ci.nsIXULChromeRegistry);
|
||||
return chromeRegistry.getSelectedLocale("browser");
|
||||
} catch (ex) {
|
||||
return "en-US";
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче