Add language agnostic QWERTY subtype
Bug: 6010147 Change-Id: I705e38ac889172ae8b7c2a68e5c688f2ffc28320main
parent
338ba2a236
commit
fb5b4c4fc3
|
@ -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>
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue