diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js index b2c00aa45fbb..fefe0418d3fc 100644 --- a/browser/components/customizableui/content/panelUI.js +++ b/browser/components/customizableui/content/panelUI.js @@ -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; + let chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"] + .getService(Ci.nsIXULChromeRegistry); + return chromeRegistry.getSelectedLocale("browser"); + } catch (ex) { + return "en-US"; } - catch (e) { } - - try { - return Services.prefs.getCharPref(PREF_SELECTED_LOCALE); - } - catch (e) { } - - return "en-US"; }