From 8f98cdef0ec9cf843af4bd4d5d885334d0dc3b31 Mon Sep 17 00:00:00 2001
From: Ken Wakasa <kwakasa@google.com>
Date: Sat, 23 Jul 2011 17:42:23 +0900
Subject: [PATCH] Tidy up the subtype names

Change-Id: I5dbdc6c006fab01fa389f0796b6c87aa2a90132e
---
 java/res/values/donottranslate.xml |   3 +
 java/res/values/strings.xml        |  83 +---------------
 java/res/xml/method.xml            | 153 +++++------------------------
 3 files changed, 30 insertions(+), 209 deletions(-)

diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml
index f88d2df1c4..4cf930399f 100644
--- a/java/res/values/donottranslate.xml
+++ b/java/res/values/donottranslate.xml
@@ -169,4 +169,7 @@
         <item>English (UK)</item>
         <item>Deutsch (QWERTY)</item>
     </string-array>
+
+    <!-- Generic subtype label -->
+    <string name="subtype_generic">%s</string>
 </resources>
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index b1cb6a7cc4..6c597cf868 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -326,89 +326,12 @@
     <!-- Title of the item to change the keyboard theme [CHAR LIMIT=20]-->
     <string name="keyboard_layout">Keyboard theme</string>
 
-    <!-- Description for Czech keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_cs_keyboard">Czech Keyboard</string>
-    <!-- Description for Arabic keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_ar_keyboard">Arabic Keyboard</string>
-    <!-- Description for Danish keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_da_keyboard">Danish Keyboard</string>
-    <!-- Description for German keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_de_keyboard">German Keyboard</string>
     <!-- Description for German QWERTY keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_de_qwerty_keyboard">German QWERTY Keyboard</string>
+    <string name="subtype_de_qwerty">German QWERTY</string>
     <!-- Description for English (United Kingdom) keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_en_GB_keyboard">English (UK) Keyboard</string>
+    <string name="subtype_en_GB">English (UK)</string>
     <!-- Description for English (United States) keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_en_US_keyboard">English (US) Keyboard</string>
-    <!-- Description for Spanish keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_es_keyboard">Spanish Keyboard</string>
-    <!-- Description for Finnish keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_fi_keyboard">Finnish Keyboard</string>
-    <!-- Description for French keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_fr_keyboard">French Keyboard</string>
-    <!-- Description for French (Canada) keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_fr_CA_keyboard">French (Canada) Keyboard</string>
-    <!-- Description for French (Switzerland) keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_fr_CH_keyboard">French (Switzerland) Keyboard</string>
-    <!-- Description for Croatian keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_hr_keyboard">Croatian Keyboard</string>
-    <!-- Description for Hungarian keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_hu_keyboard">Hungarian Keyboard</string>
-    <!-- Description for Hebrew keyboard subtype [CHAR LIMIT=35] -->
-    <!-- Java uses the deprecated "iw" code instead of the standard "he" code -->
-    <string name="subtype_mode_iw_keyboard">Hebrew Keyboard</string>
-    <!-- Description for Italian keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_it_keyboard">Italian Keyboard</string>
-    <!-- Description for Norwegian keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_nb_keyboard">Norwegian Keyboard</string>
-    <!-- Description for Dutch keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_nl_keyboard">Dutch Keyboard</string>
-    <!-- Description for Polish keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_pl_keyboard">Polish Keyboard</string>
-    <!-- Description for Portuguese keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_pt_keyboard">Portuguese Keyboard</string>
-    <!-- Description for Russian keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_ru_keyboard">Russian Keyboard</string>
-    <!-- Description for Serbian keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_sr_keyboard">Serbian Keyboard</string>
-    <!-- Description for Swedish keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_sv_keyboard">Swedish Keyboard</string>
-    <!-- Description for Turkish keyboard subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_tr_keyboard">Turkish Keyboard</string>
-    <!-- Description for Afrikaans voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_af_voice">Afrikaans Voice</string>
-    <!-- Description for Czech voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_cs_voice">Czech Voice</string>
-    <!-- Description for German voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_de_voice">German Voice</string>
-    <!-- Description for English voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_en_voice">English Voice</string>
-    <!-- Description for Spanish voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_es_voice">Spanish Voice</string>
-    <!-- Description for French voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_fr_voice">French Voice</string>
-    <!-- Description for Italian voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_it_voice">Italian Voice</string>
-    <!-- Description for Japanese voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_ja_voice">Japanese Voice</string>
-    <!-- Description for Korean voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_ko_voice">Korean Voice</string>
-    <!-- Description for Dutch voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_nl_voice">Dutch Voice</string>
-    <!-- Description for Polish voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_pl_voice">Polish Voice</string>
-    <!-- Description for Portuguese voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_pt_voice">Portuguese Voice</string>
-    <!-- Description for Russian voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_ru_voice">Russian Voice</string>
-    <!-- Description for Turkish voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_tr_voice">Turkish Voice</string>
-    <!-- Description for Chinese, Yue voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_yue_voice">Chinese, Yue Voice</string>
-    <!-- Description for Chinese, Mandarin voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_zh_voice">Chinese, Mandarin Voice</string>
-    <!-- Description for isiZulu voice input subtype [CHAR LIMIT=35] -->
-    <string name="subtype_mode_zu_voice">isiZulu Voice</string>
+    <string name="subtype_en_US">English (US)</string>
 
     <!-- Title of an option for usability study mode -->
     <string name="prefs_usability_study_mode">Usability study mode</string>
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 7aaf57b478..7a4e7ea359 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -24,237 +24,132 @@
 <!-- Voice: af, cs, da, de, en, es, fr, it, ja, ko, nl, pl, pt, ru, tr, yue, zh, zu -->
 <!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
 <!-- TODO: use <lang>_mic icon instead of a common mic icon. -->
-<!-- TODO: remove all comment outed voice subtypes -->
 <!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default
      subtype.-->
 <input-method xmlns:android="http://schemas.android.com/apk/res/android"
         android:settingsActivity="com.android.inputmethod.latin.Settings"
         android:isDefault="@bool/im_is_default">
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_en_US_keyboard"
+            android:label="@string/subtype_en_US"
             android:imeSubtypeLocale="en_US"
             android:imeSubtypeMode="keyboard"
             android:imeSubtypeExtraValue="TrySuppressingImeSwitcher"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_en_voice" -->
-<!--             android:imeSubtypeLocale="en" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_en_GB_keyboard"
+            android:label="@string/subtype_en_GB"
             android:imeSubtypeLocale="en_GB"
             android:imeSubtypeMode="keyboard"
             android:imeSubtypeExtraValue="TrySuppressingImeSwitcher"
     />
-    <!-- The file for Arabic layout is an alpha version. It needs to be run through UX. -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_ar_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="ar"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_cs_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="cs"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_cs_voice" -->
-<!--             android:imeSubtypeLocale="cs" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_da_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="da"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_de_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="de"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_de_qwerty_keyboard"
+            android:label="@string/subtype_de_qwerty"
             android:imeSubtypeLocale="de_ZZ"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_de_voice" -->
-<!--             android:imeSubtypeLocale="de" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_es_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="es"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_es_voice" -->
-<!--             android:imeSubtypeLocale="es" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_fi_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="fi"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_fr_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="fr"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_fr_voice" -->
-<!--             android:imeSubtypeLocale="fr" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_fr_CA_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="fr_CA"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_fr_CH_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="fr_CH"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_hr_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="hr"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_hu_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="hu"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_it_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="it"
             android:imeSubtypeMode="keyboard"
     />
     <!-- Java uses the deprecated "iw" code instead of the standard "he" code for Hebrew. -->
-    <!-- The file for Hebrew layout is an alpha version. It needs to be run through UX. -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_iw_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="iw"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_it_voice" -->
-<!--             android:imeSubtypeLocale="it" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_nb_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="nb"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_nl_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="nl"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_nl_voice" -->
-<!--             android:imeSubtypeLocale="nl" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_pl_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="pl"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_pt_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="pt"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_ru_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="ru"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_sr_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="sr"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_sv_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="sv"
             android:imeSubtypeMode="keyboard"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
-            android:label="@string/subtype_mode_tr_keyboard"
+            android:label="@string/subtype_generic"
             android:imeSubtypeLocale="tr"
             android:imeSubtypeMode="keyboard"
     />
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_af_voice" -->
-<!--             android:imeSubtypeLocale="af" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_ja_voice" -->
-<!--             android:imeSubtypeLocale="ja" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_ko_voice" -->
-<!--             android:imeSubtypeLocale="ko" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_pl_voice" -->
-<!--             android:imeSubtypeLocale="pl" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_pt_voice" -->
-<!--             android:imeSubtypeLocale="pt" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_ru_voice" -->
-<!--             android:imeSubtypeLocale="ru" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_tr_voice" -->
-<!--             android:imeSubtypeLocale="tr" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_yue_voice" -->
-<!--             android:imeSubtypeLocale="yue" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_zh_voice" -->
-<!--             android:imeSubtypeLocale="zh" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
-<!--     <subtype android:icon="@drawable/ic_subtype_mic" -->
-<!--             android:label="@string/subtype_mode_zu_voice" -->
-<!--             android:imeSubtypeLocale="zu" -->
-<!--             android:imeSubtypeMode="voice" -->
-<!--             android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
-<!--     /> -->
 </input-method>
-- 
GitLab