Bug 1216257 - Move "Language" settting to "General" section r=rnewman
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 21 Oct 2015 16:33:06 -0400
changeset 271101 337a67f70d857d36a64387f585454010934690dc
parent 271100 311d614a4f3945b4ac30e418ba5060058f0f6855
child 271102 fdc1692ee653210fb32c3853479e9f9e26d2bd8e
push id67553
push usercbook@mozilla.com
push dateWed, 04 Nov 2015 11:31:24 +0000
treeherdermozilla-inbound@8868503916ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1216257
milestone45.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 1216257 - Move "Language" settting to "General" section r=rnewman
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/preferences/GeckoPreferenceFragment.java
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/base/resources/xml-v11/preference_headers.xml
mobile/android/base/resources/xml-v11/preferences.xml
mobile/android/base/resources/xml-v11/preferences_general.xml
mobile/android/base/resources/xml-v11/preferences_general_tablet.xml
mobile/android/base/resources/xml/preference_headers.xml
mobile/android/base/resources/xml/preferences.xml
mobile/android/base/resources/xml/preferences_general.xml
mobile/android/base/strings.xml.in
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -203,17 +203,16 @@
 
 <!-- Localization note: These are shown in the left sidebar on tablets -->
 <!ENTITY pref_header_general "General">
 <!ENTITY pref_header_search "Search">
 <!ENTITY pref_header_privacy_short "Privacy">
 <!ENTITY pref_header_accessibility "Accessibility">
 <!ENTITY pref_header_advanced "Advanced">
 <!ENTITY pref_header_help "Help">
-<!ENTITY pref_header_language "Language">
 <!ENTITY pref_header_vendor "&vendorShortName;">
 
 <!ENTITY pref_cookies_menu "Cookies">
 <!ENTITY pref_cookies_accept_all "Enabled">
 <!ENTITY pref_cookies_not_accept_foreign "Enabled, excluding 3rd party">
 <!ENTITY pref_cookies_disabled "Disabled">
 
 <!ENTITY pref_tap_to_load_images_title "Tap-to-load images">
--- a/mobile/android/base/preferences/GeckoPreferenceFragment.java
+++ b/mobile/android/base/preferences/GeckoPreferenceFragment.java
@@ -80,27 +80,23 @@ public class GeckoPreferenceFragment ext
         setPreferenceScreen(screen);
         mPrefsRequestId = ((GeckoPreferences)getActivity()).setupPreferences(screen);
     }
 
     /**
      * Return the title to use for this preference fragment. This allows
      * for us to redisplay this fragment in a different locale.
      *
-     * We only return titles for the preference screens that are in the
-     * flow for selecting a locale, and thus might need to be redisplayed.
+     * We only return titles for the preference screens that are
+     * launched directly, and thus might need to be redisplayed.
      *
      * This method sets the title that you see on non-multi-pane devices.
      */
     private String getTitle() {
         final int res = getResource();
-        if (res == R.xml.preferences_locale) {
-            return getString(R.string.pref_category_language);
-        }
-
         if (res == R.xml.preferences) {
             return getString(R.string.settings_title);
         }
 
         // We need this because we can launch straight into this category
         // from the Data Reporting notification.
         if (res == R.xml.preferences_vendor) {
             return getString(R.string.pref_category_vendor);
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -282,18 +282,18 @@ OnSharedPreferenceChangeListener
 
             // Because Android just rebuilt the activity itself with the
             // old language, we need to update the top title and other
             // wording again.
             if (onIsMultiPane()) {
                 updateActionBarTitle(R.string.settings_title);
             }
 
-            updateTitle(R.string.pref_header_language);
-            updateBreadcrumbTitle(R.string.pref_header_language);
+            // Update the title to for the preference pane that we're currently showing.
+            updateTitle(R.string.pref_header_general);
 
             // Don't finish the activity -- we just reloaded all of the
             // individual parts! -- but when it returns, make sure that the
             // caller knows the locale changed.
             setResult(RESULT_CODE_LOCALE_DID_CHANGE);
             return;
         }
 
@@ -489,22 +489,17 @@ OnSharedPreferenceChangeListener
         if (onIsMultiPane()) {
             loadHeadersFromResource(R.xml.preference_headers, target);
 
             Iterator<Header> iterator = target.iterator();
 
             while (iterator.hasNext()) {
                 Header header = iterator.next();
 
-                if (header.id == R.id.pref_header_language && !localeSwitchingIsEnabled) {
-                    // If locale switching is disabled, remove the section
-                    // entirely. This logic will need to be extended when
-                    // content language selection (Bug 881510) is implemented.
-                    iterator.remove();
-                } else if (header.id == R.id.pref_header_advanced && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
+                if (header.id == R.id.pref_header_advanced && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DEVELOPER_TOOLS)) {
                     iterator.remove();
                 } else if (header.id == R.id.pref_header_accessibility && !RestrictedProfiles.isAllowed(this, Restriction.DISALLOW_DISPLAY_SETTINGS)) {
                     iterator.remove();
                 }
             }
         }
     }
 
--- a/mobile/android/base/resources/xml-v11/preference_headers.xml
+++ b/mobile/android/base/resources/xml-v11/preference_headers.xml
@@ -38,21 +38,14 @@
     <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
             android:title="@string/pref_header_advanced"
             android:id="@+id/pref_header_advanced">
         <extra android:name="resource"
                android:value="preferences_advanced"/>
     </header>
 
     <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
-            android:title="@string/pref_header_language"
-            android:id="@+id/pref_header_language">
-        <extra android:name="resource"
-               android:value="preferences_locale" />
-    </header>
-
-    <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
             android:title="@string/pref_header_vendor">
         <extra android:name="resource"
                android:value="preferences_vendor"/>
     </header>
 
 </preference-headers>
--- a/mobile/android/base/resources/xml-v11/preferences.xml
+++ b/mobile/android/base/resources/xml-v11/preferences.xml
@@ -50,23 +50,16 @@
     <PreferenceScreen android:title="@string/pref_category_advanced"
                       android:summary="@string/pref_category_advanced_summary"
                       android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
                       android:key="android.not_a_preference.advanced.enabled" >
         <extra android:name="resource"
                android:value="preferences_advanced"/>
     </PreferenceScreen>
 
-    <PreferenceScreen android:title="@string/pref_category_language"
-                      android:summary="@string/pref_category_language_summary"
-                      android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
-        <extra android:name="resource"
-               android:value="preferences_locale" />
-    </PreferenceScreen>
-
     <PreferenceScreen android:title="@string/pref_category_vendor"
                       android:summary="@string/pref_category_vendor_summary"
                       android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
         <extra android:name="resource"
                android:value="preferences_vendor"/>
     </PreferenceScreen>
 
 </PreferenceScreen>
--- a/mobile/android/base/resources/xml-v11/preferences_general.xml
+++ b/mobile/android/base/resources/xml-v11/preferences_general.xml
@@ -12,16 +12,23 @@
     <PreferenceScreen android:key="android.not_a_preference.general_home"
                       android:title="@string/pref_category_home"
                       android:summary="@string/pref_category_home_summary"
                       android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
             <extra android:name="resource"
                    android:value="preferences_home" />
     </PreferenceScreen>
 
+    <PreferenceScreen android:title="@string/pref_category_language"
+                      android:summary="@string/pref_category_language_summary"
+                      android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
+        <extra android:name="resource"
+               android:value="preferences_locale" />
+    </PreferenceScreen>
+
     <ListPreference android:key="android.not_a_preference.restoreSession3"
                     android:title="@string/pref_restore"
                     android:defaultValue="quit"
                     android:entries="@array/pref_restore_entries"
                     android:entryValues="@array/pref_restore_values"
                     android:persistent="true" />
 
     <CheckBoxPreference android:key="browser.image_blocking.enabled"
--- a/mobile/android/base/resources/xml-v11/preferences_general_tablet.xml
+++ b/mobile/android/base/resources/xml-v11/preferences_general_tablet.xml
@@ -19,16 +19,23 @@
     <PreferenceScreen android:key="android.not_a_preference.general_home"
                       android:title="@string/pref_category_home"
                       android:summary="@string/pref_category_home_summary"
                       android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
             <extra android:name="resource"
                    android:value="preferences_home" />
     </PreferenceScreen>
 
+    <PreferenceScreen android:title="@string/pref_category_language"
+                      android:summary="@string/pref_category_language_summary"
+                      android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment" >
+        <extra android:name="resource"
+               android:value="preferences_locale" />
+    </PreferenceScreen>
+
     <ListPreference android:key="android.not_a_preference.restoreSession3"
                     android:title="@string/pref_restore"
                     android:defaultValue="quit"
                     android:entries="@array/pref_restore_entries"
                     android:entryValues="@array/pref_restore_values"
                     android:persistent="true" />
 
     <CheckBoxPreference android:key="browser.image_blocking.enabled"
--- a/mobile/android/base/resources/xml/preference_headers.xml
+++ b/mobile/android/base/resources/xml/preference_headers.xml
@@ -6,17 +6,14 @@
 <!-- This file is a stub to allow IDs to be used in code
      even for a version-limited build. -->
 
 <preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
     <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
             android:id="@+id/pref_header_search">
     </header>
     <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
-            android:id="@+id/pref_header_language">
-    </header>
-    <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
             android:id="@+id/pref_header_advanced">
     </header>
     <header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
             android:id="@+id/pref_header_accessibility">
     </header>
 </preference-headers>
--- a/mobile/android/base/resources/xml/preferences.xml
+++ b/mobile/android/base/resources/xml/preferences.xml
@@ -69,27 +69,16 @@
                 android:targetPackage="@string/android_package_name"
                 android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
             <extra
                     android:name="resource"
                     android:value="preferences_advanced" />
         </intent>
     </PreferenceScreen>
 
-    <PreferenceScreen android:title="@string/pref_category_language"
-                      android:summary="@string/pref_category_language_summary" >
-        <intent android:action="android.intent.action.VIEW"
-                android:targetPackage="@string/android_package_name"
-                android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
-            <extra
-                android:name="resource"
-                android:value="preferences_locale" />
-        </intent>
-    </PreferenceScreen>
-
     <PreferenceScreen android:title="@string/pref_category_vendor"
                       android:summary="@string/pref_category_vendor_summary" >
         <intent android:action="android.intent.action.VIEW"
                 android:targetPackage="@string/android_package_name"
                 android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
             <extra
                 android:name="resource"
                 android:value="preferences_vendor" />
--- a/mobile/android/base/resources/xml/preferences_general.xml
+++ b/mobile/android/base/resources/xml/preferences_general.xml
@@ -15,16 +15,27 @@
                 android:targetPackage="@string/android_package_name"
                 android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
             <extra
                 android:name="resource"
                 android:value="preferences_home" />
         </intent>
     </PreferenceScreen>
 
+    <PreferenceScreen android:title="@string/pref_category_language"
+                      android:summary="@string/pref_category_language_summary" >
+        <intent android:action="android.intent.action.VIEW"
+                android:targetPackage="@string/android_package_name"
+                android:targetClass="org.mozilla.gecko.preferences.GeckoPreferences" >
+            <extra
+                    android:name="resource"
+                    android:value="preferences_locale" />
+        </intent>
+    </PreferenceScreen>
+
     <ListPreference android:key="android.not_a_preference.restoreSession3"
                     android:title="@string/pref_restore"
                     android:defaultValue="quit"
                     android:entries="@array/pref_restore_entries"
                     android:entryValues="@array/pref_restore_values"
                     android:persistent="true" />
 
     <CheckBoxPreference android:key="browser.image_blocking.enabled"
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -188,17 +188,16 @@
   <string name="home_homepage_title">&home_homepage_title;</string>
   <string name="home_homepage_use_current_tab">&home_homepage_use_current_tab;</string>
 
   <string name="pref_header_general">&pref_header_general;</string>
   <string name="pref_header_search">&pref_header_search;</string>
   <string name="pref_header_accessibility">&pref_header_accessibility;</string>
   <string name="pref_header_privacy_short">&pref_header_privacy_short;</string>
   <string name="pref_header_advanced">&pref_header_advanced;</string>
-  <string name="pref_header_language">&pref_header_language;</string>
   <string name="pref_header_vendor">&pref_header_vendor;</string>
 
   <string name="pref_learn_more">&pref_learn_more;</string>
 
   <string name="pref_category_logins">&pref_category_logins;</string>
   <string name="pref_remember_signons">&pref_remember_signons2;</string>
 
   <string name="pref_open_external_urls_privately_title">&pref_open_external_urls_privately_title;</string>