diff options
author | 2014-02-06 01:45:22 -0800 | |
---|---|---|
committer | 2014-02-06 01:45:22 -0800 | |
commit | 147ddb4686d88f45f0e91c7b110d61d7aeed3b7d (patch) | |
tree | 9aa769356734f3d03153c9c12f1cc542939c4936 /tools | |
parent | 32ca47a547df5a45bf1f481f998cb61c8219ea59 (diff) | |
parent | 3bbd50c36b1e9b9e3b26ab510853021515886498 (diff) | |
download | latinime-147ddb4686d88f45f0e91c7b110d61d7aeed3b7d.tar.gz latinime-147ddb4686d88f45f0e91c7b110d61d7aeed3b7d.tar.xz latinime-147ddb4686d88f45f0e91c7b110d61d7aeed3b7d.zip |
am 3bbd50c3: Use SubtypeLocaleUtils.isRtlLanguage
* commit '3bbd50c36b1e9b9e3b26ab510853021515886498':
Use SubtypeLocaleUtils.isRtlLanguage
Diffstat (limited to 'tools')
-rw-r--r-- | tools/make-keyboard-text/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/make-keyboard-text/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl b/tools/make-keyboard-text/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl index db1dde39f..7a6284f69 100644 --- a/tools/make-keyboard-text/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl +++ b/tools/make-keyboard-text/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl @@ -25,6 +25,7 @@ import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; +import java.util.Locale; /** * !!!!! DO NOT EDIT THIS FILE !!!!! @@ -52,15 +53,17 @@ public final class KeyboardTextsSet { private static final int MAX_STRING_REFERENCE_INDIRECTION = 10; // Language to texts map. - private static final HashMap<String, String[]> sLocaleToTextsMap = CollectionUtils.newHashMap(); + private static final HashMap<String, String[]> sLanguageToTextsMap = + CollectionUtils.newHashMap(); private static final HashMap<String, Integer> sNameToIdsMap = CollectionUtils.newHashMap(); private String[] mTexts; // Resource name to text map. private HashMap<String, String> mResourceNameToTextsMap = CollectionUtils.newHashMap(); - public void setLanguage(final String language) { - mTexts = sLocaleToTextsMap.get(language); + public void setLocale(final Locale locale) { + final String language = locale.getLanguage(); + mTexts = sLanguageToTextsMap.get(language); if (mTexts == null) { mTexts = LANGUAGE_DEFAULT; } @@ -195,7 +198,7 @@ public final class KeyboardTextsSet { for (int i = 0; i < LANGUAGES_AND_TEXTS.length; i += 2) { final String language = (String)LANGUAGES_AND_TEXTS[i]; final String[] texts = (String[])LANGUAGES_AND_TEXTS[i + 1]; - sLocaleToTextsMap.put(language, texts); + sLanguageToTextsMap.put(language, texts); } } } |