Bug 713464: Application Locale should not be reset from CPP. [r=mfinkle] [a=akeybl]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 30 Jan 2012 19:59:47 -0800
changeset 85220 a08160d613a5
parent 85219 1a62ea0a1fcc
child 85221 f6f80f5190fa
push id534
push userblassey@mozilla.com
push dateThu, 02 Feb 2012 20:40:49 +0000
treeherdermozilla-beta@33e29c66740d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, akeybl
bugs713464
milestone11.0
Bug 713464: Application Locale should not be reset from CPP. [r=mfinkle] [a=akeybl]
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -1126,38 +1126,44 @@ public class GeckoAppShell
         ConnectivityManager cm = (ConnectivityManager)
             GeckoApp.mAppContext.getSystemService(Context.CONNECTIVITY_SERVICE);
         if (cm.getActiveNetworkInfo() == null)
             return false;
         return true;
     }
 
     public static void setSelectedLocale(String localeCode) {
-        /* We're not using this, not need to save it (see bug 635342)
-          SharedPreferences settings =
+        /* Bug 713464: This method is still called from Gecko side.
+           Earlier we had an option to run Firefox in a language other than system's language.
+           However, this is not supported as of now.
+           Gecko resets the locale to en-US by calling this function with an empty string.
+           This affects GeckoPreferences activity in multi-locale builds.
+
+        //We're not using this, not need to save it (see bug 635342)
+        SharedPreferences settings =
             GeckoApp.mAppContext.getPreferences(Activity.MODE_PRIVATE);
         settings.edit().putString(GeckoApp.mAppContext.getPackageName() + ".locale",
                                   localeCode).commit();
-        */
         Locale locale;
         int index;
         if ((index = localeCode.indexOf('-')) != -1 ||
             (index = localeCode.indexOf('_')) != -1) {
             String langCode = localeCode.substring(0, index);
             String countryCode = localeCode.substring(index + 1);
             locale = new Locale(langCode, countryCode);
         } else {
             locale = new Locale(localeCode);
         }
         Locale.setDefault(locale);
 
         Resources res = GeckoApp.mAppContext.getBaseContext().getResources();
         Configuration config = res.getConfiguration();
         config.locale = locale;
         res.updateConfiguration(config, res.getDisplayMetrics());
+        */
     }
 
     public static int[] getSystemColors() {
         // attrsAppearance[] must correspond to AndroidSystemColors structure in android/AndroidBridge.h
         final int[] attrsAppearance = {
             android.R.attr.textColor,
             android.R.attr.textColorPrimary,
             android.R.attr.textColorPrimaryInverse,