diff options
author | 2012-03-29 21:01:19 +0900 | |
---|---|---|
committer | 2012-03-30 18:20:52 +0900 | |
commit | fb5b4c4fc39499d03951671c1a9b67b3573dd11d (patch) | |
tree | 597996a6086820383f5b0d5eada32a06d63b1878 | |
parent | 338ba2a236aea0d7ad6890a9e7bc26c2fe5bc364 (diff) | |
download | latinime-fb5b4c4fc39499d03951671c1a9b67b3573dd11d.tar.gz latinime-fb5b4c4fc39499d03951671c1a9b67b3573dd11d.tar.xz latinime-fb5b4c4fc39499d03951671c1a9b67b3573dd11d.zip |
Add language agnostic QWERTY subtype
Bug: 6010147
Change-Id: I705e38ac889172ae8b7c2a68e5c688f2ffc28320
-rw-r--r-- | java/res/values-zz/donottranslate-more-keys.xml | 139 | ||||
-rw-r--r-- | java/res/values/attrs.xml | 5 | ||||
-rw-r--r-- | java/res/values/donottranslate-more-keys.xml | 3 | ||||
-rw-r--r-- | java/res/values/donottranslate.xml | 8 | ||||
-rw-r--r-- | java/res/xml-de-rQY/keyboard_set.xml (renamed from java/res/xml-de-rZZ/keyboard_set.xml) | 0 | ||||
-rw-r--r-- | java/res/xml-zz-rQY/keyboard_set.xml | 43 | ||||
-rw-r--r-- | java/res/xml/method.xml | 13 | ||||
-rw-r--r-- | java/res/xml/rowkeys_azerty2.xml | 6 | ||||
-rw-r--r-- | java/res/xml/rowkeys_azerty3.xml | 3 | ||||
-rw-r--r-- | java/res/xml/rowkeys_qwerty1.xml | 3 | ||||
-rw-r--r-- | java/res/xml/rowkeys_qwerty2.xml | 6 | ||||
-rw-r--r-- | java/res/xml/rowkeys_qwertz1.xml | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardSet.java | 12 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/SubtypeLocale.java | 12 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java | 4 |
15 files changed, 242 insertions, 18 deletions
diff --git a/java/res/values-zz/donottranslate-more-keys.xml b/java/res/values-zz/donottranslate-more-keys.xml new file mode 100644 index 000000000..eb984a469 --- /dev/null +++ b/java/res/values-zz/donottranslate-more-keys.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2012, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE + U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE + U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX + U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE + U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS + U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE + U+00E6: "æ" LATIN SMALL LETTER AE + U+0101: "ā" LATIN SMALL LETTER A WITH MACRON + U+0103: "ă" LATIN SMALL LETTER A WITH BREVE + U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK + U+00AA: "ª" FEMININE ORDINAL INDICATOR --> + <string name="more_keys_for_a">à,á,â,ã,ä,å,æ,ã,å,ā,ă,ą,ª</string> + <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE + U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE + U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX + U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS + U+0113: "ē" LATIN SMALL LETTER E WITH MACRON + U+0115: "ĕ" LATIN SMALL LETTER E WITH BREVE + U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE + U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK + U+011B: "ě" LATIN SMALL LETTER E WITH CARON --> + <string name="more_keys_for_e">è,é,ê,ë,ē,ĕ,ė,ę,ě</string> + <!-- U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE + U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE + U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX + U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS + U+0129: "ĩ" LATIN SMALL LETTER I WITH TILDE + U+012B: "ī" LATIN SMALL LETTER I WITH MACRON + U+012D: "ĭ" LATIN SMALL LETTER I WITH BREVE + U+012F: "į" LATIN SMALL LETTER I WITH OGONEK + U+0131: "ı" LATIN SMALL LETTER DOTLESS I + U+0133: "ij" LATIN SMALL LIGATURE IJ --> + <string name="more_keys_for_i">ì,í,î,ï,ĩ,ī,ĭ,į,ı,ij</string> + <!-- U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE + U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE + U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX + U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE + U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS + U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE + U+014D: "ō" LATIN SMALL LETTER O WITH MACRON + U+014F: "ŏ" LATIN SMALL LETTER O WITH BREVE + U+0151: "ő" LATIN SMALL LETTER O WITH DOUBLE ACUTE + U+0153: "œ" LATIN SMALL LIGATURE OE + U+00BA: "º" MASCULINE ORDINAL INDICATOR --> + <string name="more_keys_for_o">ò,ó,ô,õ,ö,ø,ō,ŏ,ő,œ,º</string> + <!-- U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE + U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE + U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX + U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS + U+0169: "ũ" LATIN SMALL LETTER U WITH TILDE + U+016B: "ū" LATIN SMALL LETTER U WITH MACRON + U+016D: "ŭ" LATIN SMALL LETTER U WITH BREVE + U+016F: "ů" LATIN SMALL LETTER U WITH RING ABOVE + U+0171: "ű" LATIN SMALL LETTER U WITH DOUBLE ACUTE + U+0173: "ų" LATIN SMALL LETTER U WITH OGONEK --> + <string name="more_keys_for_u">ù,ú,û,ü,ũ,ū,ŭ,ů,ű,ų</string> + <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S + U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE + U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX + U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA + U+0161: "š" LATIN SMALL LETTER S WITH CARON + U+017F: "ſ" LATIN SMALL LETTER LONG S --> + <string name="more_keys_for_s">ß,ś,ŝ,ş,š,ſ</string> + <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE + U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE + U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA + U+0148: "ň" LATIN SMALL LETTER N WITH CARON + U+0149: "ʼn" LATIN SMALL LETTER N PRECEDED BY APOSTROPHE + U+014B: "ŋ" LATIN SMALL LETTER ENG --> + <string name="more_keys_for_n">ñ,ń,ņ,ň,ʼn,ŋ</string> + <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA + U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE + U+0109: "ĉ" LATIN SMALL LETTER C WITH CIRCUMFLEX + U+010B: "ċ" LATIN SMALL LETTER C WITH DOT ABOVE + U+010D: "č" LATIN SMALL LETTER C WITH CARON --> + <string name="more_keys_for_c">ç,ć,ĉ,ċ,č</string> + <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE + U+0177: "ŷ" LATIN SMALL LETTER Y WITH CIRCUMFLEX + U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS + U+0133: "ij" LATIN SMALL LIGATURE IJ --> + <string name="more_keys_for_y">ý,ŷ,ÿ,ij</string> + <!-- U+010F: "ď" LATIN SMALL LETTER D WITH CARON + U+0111: "đ" LATIN SMALL LETTER D WITH STROKE + U+00F0: "ð" LATIN SMALL LETTER ETH --> + <string name="more_keys_for_d">ď,đ,ð</string> + <!-- U+0155: "ŕ" LATIN SMALL LETTER R WITH ACUTE + U+0157: "ŗ" LATIN SMALL LETTER R WITH CEDILLA + U+0159: "ř" LATIN SMALL LETTER R WITH CARON --> + <string name="more_keys_for_r">ŕ,ŗ,ř</string> + <!-- U+00FE: "þ" LATIN SMALL LETTER THORN + U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA + U+0165: "ť" LATIN SMALL LETTER T WITH CARON + U+0167: "ŧ" LATIN SMALL LETTER T WITH STROKE --> + <string name="more_keys_for_t">þ,ţ,ť,ŧ</string> + <!-- U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE + U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE + U+017E: "ž" LATIN SMALL LETTER Z WITH CARON --> + <string name="more_keys_for_z">ź,ż,ž</string> + <!-- U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA + U+0138: "ĸ" LATIN SMALL LETTER KRA --> + <string name="more_keys_for_k">ķ,ĸ</string> + <!-- U+013A: "ĺ" LATIN SMALL LETTER L WITH ACUTE + U+013C: "ļ" LATIN SMALL LETTER L WITH CEDILLA + U+013E: "ľ" LATIN SMALL LETTER L WITH CARON + U+0140: "ŀ" LATIN SMALL LETTER L WITH MIDDLE DOT + U+0142: "ł" LATIN SMALL LETTER L WITH STROKE --> + <string name="more_keys_for_l">ĺ,ļ,ľ,ŀ,ł</string> + <!-- U+011D: "ĝ" LATIN SMALL LETTER G WITH CIRCUMFLEX + U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE + U+0121: "ġ" LATIN SMALL LETTER G WITH DOT ABOVE + U+0123: "ģ" LATIN SMALL LETTER G WITH CEDILLA --> + <string name="more_keys_for_g">ĝ,ğ,ġ,ģ</string> + <!-- U+0125: "ĥ" LATIN SMALL LETTER H WITH CIRCUMFLEX --> + <string name="more_keys_for_h">ĥ</string> + <!-- U+0135: "ĵ" LATIN SMALL LETTER J WITH CIRCUMFLEX --> + <string name="more_keys_for_j">ĵ</string> + <!-- U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX --> + <string name="more_keys_for_w">ŵ</string> +</resources> diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 86f2abe72..b3f30c638 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -403,6 +403,11 @@ <attr name="parentStyle" format="string" /> </declare-styleable> + <declare-styleable name="KeyboardSet"> + <!-- Disable shortcut key. Shortcut key is enabled by default. --> + <attr name="disableShortcutKey" format="boolean" /> + </declare-styleable> + <declare-styleable name="KeyboardSet_Element"> <!-- This should be aligned with KeyboardId.ELEMENT_* --> <attr name="elementName" format="enum"> diff --git a/java/res/values/donottranslate-more-keys.xml b/java/res/values/donottranslate-more-keys.xml index 8fbb2eff4..9b2780571 100644 --- a/java/res/values/donottranslate-more-keys.xml +++ b/java/res/values/donottranslate-more-keys.xml @@ -35,6 +35,9 @@ <string name="more_keys_for_l"></string> <string name="more_keys_for_g"></string> <string name="more_keys_for_v"></string> + <string name="more_keys_for_h"></string> + <string name="more_keys_for_j"></string> + <string name="more_keys_for_w"></string> <string name="keylabel_for_nordic_row1_11"></string> <string name="keylabel_for_nordic_row2_10"></string> <string name="keylabel_for_nordic_row2_11"></string> diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml index 74c68464c..68a8cabce 100644 --- a/java/res/values/donottranslate.xml +++ b/java/res/values/donottranslate.xml @@ -156,18 +156,22 @@ <string-array name="subtype_locale_exception_keys"> <item>en_US</item> <item>en_GB</item> - <item>de_ZZ</item> + <item>de_QY</item> + <item>zz_QY</item> </string-array> <string-array name="subtype_locale_exception_values"> <item>English (US)</item> <item>English (UK)</item> - <item>Deutsch (QWERTY)</item> + <item>@string/subtype_generic_qwerty</item> + <item>@string/subtype_qwerty</item> </string-array> <!-- Generic subtype label --> <string name="subtype_generic">%s</string> <!-- Description for generic QWERTY keyboard subtype --> <string name="subtype_generic_qwerty">%s (QWERTY)</string> + <!-- Description for language agnostic QWERTY keyboard subtype --> + <string name="subtype_qwerty">QWERTY</string> <!-- dictionary pack package name /settings activity (for shared prefs and settings) --> <string name="dictionary_pack_package_name">com.google.android.inputmethod.latin.dictionarypack</string> diff --git a/java/res/xml-de-rZZ/keyboard_set.xml b/java/res/xml-de-rQY/keyboard_set.xml index 8966ddbb0..8966ddbb0 100644 --- a/java/res/xml-de-rZZ/keyboard_set.xml +++ b/java/res/xml-de-rQY/keyboard_set.xml diff --git a/java/res/xml-zz-rQY/keyboard_set.xml b/java/res/xml-zz-rQY/keyboard_set.xml new file mode 100644 index 000000000..6fa97017c --- /dev/null +++ b/java/res/xml-zz-rQY/keyboard_set.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2012, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<KeyboardSet + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + latin:disableShortcutKey="true" > + <Element + latin:elementName="alphabet" + latin:elementKeyboard="@xml/kbd_qwerty" + latin:enableProximityCharsCorrection="true" /> + <Element + latin:elementName="symbols" + latin:elementKeyboard="@xml/kbd_symbols" /> + <Element + latin:elementName="symbolsShifted" + latin:elementKeyboard="@xml/kbd_symbols_shift" /> + <Element + latin:elementName="phone" + latin:elementKeyboard="@xml/kbd_phone" /> + <Element + latin:elementName="phoneSymbols" + latin:elementKeyboard="@xml/kbd_phone_symbols" /> + <Element + latin:elementName="number" + latin:elementKeyboard="@xml/kbd_number" /> +</KeyboardSet> diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index d6ded6689..7a21a856b 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -27,7 +27,7 @@ cs: Czech/qwertz da: Danish/nordic de: German/qwertz - de_ZZ: German (QWERTY)/qwerty + de_QY: German (QWERTY)/qwerty el: Greek/greek en_US: English United States/qwerty en_GB: English Great Britain/qwerty @@ -63,6 +63,7 @@ tr: Turkish/qwerty uk: Ukrainian/east_slavic vi: Vietnamese/qwerty + zz_QY: QWERTY/qwerty --> <!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. --> <!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default @@ -74,7 +75,7 @@ android:label="@string/subtype_en_US" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" - android:imeSubtypeExtraValue="TrySuppressingImeSwitcher,AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable" + android:imeSubtypeExtraValue="TrySuppressingImeSwitcher,AsciiCapable" /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_en_GB" @@ -119,7 +120,7 @@ android:label="@string/subtype_generic_qwerty" android:imeSubtypeLocale="de" android:imeSubtypeMode="keyboard" - android:imeSubtypeExtraValue="AsciiCapable,KeyboardLocale=de_ZZ" + android:imeSubtypeExtraValue="AsciiCapable,KeyboardLocale=de_QY" /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" @@ -310,4 +311,10 @@ android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="AsciiCapable" /> + <subtype android:icon="@drawable/ic_subtype_keyboard" + android:label="@string/subtype_qwerty" + android:imeSubtypeLocale="zz_QY" + android:imeSubtypeMode="keyboard" + android:imeSubtypeExtraValue="AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable" + /> </input-method> diff --git a/java/res/xml/rowkeys_azerty2.xml b/java/res/xml/rowkeys_azerty2.xml index 11bcd67c7..ff0b06240 100644 --- a/java/res/xml/rowkeys_azerty2.xml +++ b/java/res/xml/rowkeys_azerty2.xml @@ -35,9 +35,11 @@ latin:keyLabel="g" latin:moreKeys="@string/more_keys_for_g" /> <Key - latin:keyLabel="h" /> + latin:keyLabel="h" + latin:moreKeys="@string/more_keys_for_h" /> <Key - latin:keyLabel="j" /> + latin:keyLabel="j" + latin:moreKeys="@string/more_keys_for_j" /> <Key latin:keyLabel="k" latin:moreKeys="@string/more_keys_for_k" /> diff --git a/java/res/xml/rowkeys_azerty3.xml b/java/res/xml/rowkeys_azerty3.xml index 1a0eaccdc..b81c3c5a1 100644 --- a/java/res/xml/rowkeys_azerty3.xml +++ b/java/res/xml/rowkeys_azerty3.xml @@ -22,7 +22,8 @@ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > <Key - latin:keyLabel="w" /> + latin:keyLabel="w" + latin:moreKeys="@string/more_keys_for_w" /> <Key latin:keyLabel="x" /> <Key diff --git a/java/res/xml/rowkeys_qwerty1.xml b/java/res/xml/rowkeys_qwerty1.xml index bd5e9a271..19067a70c 100644 --- a/java/res/xml/rowkeys_qwerty1.xml +++ b/java/res/xml/rowkeys_qwerty1.xml @@ -28,7 +28,8 @@ <Key latin:keyLabel="w" latin:keyHintLabel="2" - latin:additionalMoreKeys="2" /> + latin:additionalMoreKeys="2" + latin:moreKeys="@string/more_keys_for_w" /> <Key latin:keyLabel="e" latin:keyHintLabel="3" diff --git a/java/res/xml/rowkeys_qwerty2.xml b/java/res/xml/rowkeys_qwerty2.xml index 4c983dfce..2fa8214a8 100644 --- a/java/res/xml/rowkeys_qwerty2.xml +++ b/java/res/xml/rowkeys_qwerty2.xml @@ -36,9 +36,11 @@ latin:keyLabel="g" latin:moreKeys="@string/more_keys_for_g" /> <Key - latin:keyLabel="h" /> + latin:keyLabel="h" + latin:moreKeys="@string/more_keys_for_h" /> <Key - latin:keyLabel="j" /> + latin:keyLabel="j" + latin:moreKeys="@string/more_keys_for_j" /> <Key latin:keyLabel="k" latin:moreKeys="@string/more_keys_for_k" /> diff --git a/java/res/xml/rowkeys_qwertz1.xml b/java/res/xml/rowkeys_qwertz1.xml index 27b8a7653..3e11a7ab4 100644 --- a/java/res/xml/rowkeys_qwertz1.xml +++ b/java/res/xml/rowkeys_qwertz1.xml @@ -28,7 +28,8 @@ <Key latin:keyLabel="w" latin:keyHintLabel="2" - latin:additionalMoreKeys="2" /> + latin:additionalMoreKeys="2" + latin:moreKeys="@string/more_keys_for_w" /> <Key latin:keyLabel="e" latin:keyHintLabel="3" diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java index c17fe8628..f0c773ff4 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java @@ -98,6 +98,7 @@ public class KeyboardSet { int mMode; EditorInfo mEditorInfo; boolean mTouchPositionCorrectionEnabled; + boolean mDisableShortcutKey; boolean mVoiceKeyEnabled; boolean mVoiceKeyOnMain; boolean mNoSettingsKey; @@ -200,11 +201,11 @@ public class KeyboardSet { final Params params = mParams; final boolean isSymbols = (keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS || keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED); - final boolean hasShortcutKey = params.mVoiceKeyEnabled - && (isSymbols != params.mVoiceKeyOnMain); + final boolean voiceKeyEnabled = params.mVoiceKeyEnabled && !params.mDisableShortcutKey; + final boolean hasShortcutKey = voiceKeyEnabled && (isSymbols != params.mVoiceKeyOnMain); return new KeyboardId(keyboardSetElementId, params.mLocale, params.mOrientation, params.mWidth, params.mMode, params.mEditorInfo, params.mNoSettingsKey, - params.mVoiceKeyEnabled, hasShortcutKey, params.mLanguageSwitchKeyEnabled); + voiceKeyEnabled, hasShortcutKey, params.mLanguageSwitchKeyEnabled); } public static class Builder { @@ -293,6 +294,11 @@ public class KeyboardSet { if (event == XmlPullParser.START_TAG) { final String tag = parser.getName(); if (TAG_KEYBOARD_SET.equals(tag)) { + final TypedArray a = mResources.obtainAttributes( + Xml.asAttributeSet(parser), R.styleable.KeyboardSet); + mParams.mDisableShortcutKey = a.getBoolean( + R.styleable.KeyboardSet_disableShortcutKey, false); + a.recycle(); parseKeyboardSetContent(parser); } else { throw new XmlParseUtils.IllegalStartTag(parser, TAG_KEYBOARD_SET); diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java index 917521c40..66c13bd2e 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java +++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java @@ -36,10 +36,16 @@ public class SubtypeLocale { } public static String getFullDisplayName(Locale locale) { - String localeCode = locale.toString(); + final String localeCode = locale.toString(); for (int index = 0; index < sExceptionKeys.length; index++) { - if (sExceptionKeys[index].equals(localeCode)) - return sExceptionValues[index]; + if (sExceptionKeys[index].equals(localeCode)) { + final String value = sExceptionValues[index]; + if (value.indexOf("%s") >= 0) { + final String languageName = locale.getDisplayLanguage(locale); + return String.format(value, languageName); + } + return value; + } } return locale.getDisplayName(locale); } diff --git a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java index 7925d1a49..089fdc52c 100644 --- a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java +++ b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java @@ -62,6 +62,10 @@ public class SubtypeLocaleTests extends AndroidTestCase { int failedCount = 0; for (final InputMethodSubtype subtype : mKeyboardSubtypes) { final Locale locale = LocaleUtils.constructLocaleFromString(subtype.getLocale()); + if (locale.getLanguage().equals("zz")) { + // This is special language name for language agnostic usage. + continue; + } final String subtypeLocaleString = subtype.containsExtraValueKey(LatinIME.SUBTYPE_EXTRA_VALUE_KEYBOARD_LOCALE) ? subtype.getExtraValueOf(LatinIME.SUBTYPE_EXTRA_VALUE_KEYBOARD_LOCALE) |