Bug 689025 - Language button has a label referencing location of intl.properties [r=mfinkle]
authorWes Johnston <wjohnston@mozilla.com>
Mon, 26 Sep 2011 14:27:02 -0700
changeset 78899 65ae0b5132e5f995006ac7d8df1f2d7150642caf
parent 78898 b71570ffc9686a3647805ea8dbddfadf223ae8bd
child 78900 72fcfc57ad204da37b3e12aadc5eedb82603635d
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs689025
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 689025 - Language button has a label referencing location of intl.properties [r=mfinkle]
mobile/chrome/content/preferences.js
--- a/mobile/chrome/content/preferences.js
+++ b/mobile/chrome/content/preferences.js
@@ -115,22 +115,27 @@ var PreferencesView = {
     }
   },
 
   _loadLocales: function _loadLocales() {
     // Query available and selected locales
     let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry);
     chrome.QueryInterface(Ci.nsIToolkitChromeRegistry);
 
-    let selectedLocale = Services.prefs.getCharPref("general.useragent.locale");
+    let selectedLocale = chrome.getSelectedLocale("browser");
+
+    // the chrome locale may not have updated yet if the user is installing a new
+    // locale. if the pref has a user set value, use it instead
+    if (Services.prefs.prefHasUserValue("general.useragent.locale"))
+      selectedLocale = Services.prefs.getCharPref("general.useragent.locale");
+
     let availableLocales = chrome.getLocalesForPackage("browser");
 
     let strings = Services.strings.createBundle("chrome://browser/content/languages.properties");
 
-    // Render locale menulist by iterating through the query result from getLocalesForPackage()
     let selectedItem = null;
     let selectedLabel = selectedLocale;
     while (availableLocales.hasMore()) {
       let locale = availableLocales.getNext();
       try {
         var label = strings.GetStringFromName(locale);
       } catch (e) {
         label = locale;