Blacklist asian languages from input selection list, since this is LatinIME.

Bug: 2488167
Don't show ko, ja and zh languages in the list.

Remove a debug println.
Add alternates_for_g to the keyboard for it to work on turkish. This
  must have not gotten merged from donut.
This commit is contained in:
Amith Yamasani 2010-03-04 04:43:15 -08:00
parent ec99869272
commit 0a2df340e5
6 changed files with 23 additions and 3 deletions

View File

@ -15,7 +15,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := android-common
#LOCAL_AAPT_FLAGS := -0 .dict
#LOCAL_SDK_VERSION := current
LOCAL_SDK_VERSION := current
LOCAL_PROGUARD_FLAGS := -include $(LOCAL_PATH)/proguard.flags

View File

@ -34,4 +34,6 @@
<string name="alternates_for_z"></string>
<!-- Accented characters related to "l" -->
<string name="alternates_for_l"></string>
<!-- Accented characters related to "g" -->
<string name="alternates_for_g"></string>
</resources>

View File

@ -319,4 +319,7 @@
<!-- Add to dictionary hint -->
<string name="hint_add_to_dictionary">\u2190 Tap again to save</string>
<!-- Inform the user that a particular language has an available dictionary -->
<string name="has_dictionary">Dictionary available</string>
</resources>

View File

@ -70,7 +70,10 @@
android:popupKeyboard="@xml/kbd_popup_template"
android:popupCharacters="@string/alternates_for_d"/>
<Key android:codes="102" android:keyLabel="f"/>
<Key android:codes="103" android:keyLabel="g"/>
<Key android:codes="103" android:keyLabel="g"
android:popupKeyboard="@xml/kbd_popup_template"
android:popupCharacters="@string/alternates_for_g"
/>
<Key android:codes="104" android:keyLabel="h"/>
<Key android:codes="106" android:keyLabel="j"/>
<Key android:codes="107" android:keyLabel="k"/>

View File

@ -138,7 +138,6 @@ public class BinaryDictionary extends Dictionary {
@Override
public synchronized void close() {
if (mNativeDict != 0) {
System.err.println("Closing BinaryDictionary");
closeNative(mNativeDict);
mNativeDict = 0;
}

View File

@ -34,6 +34,9 @@ public class InputLanguageSelection extends PreferenceActivity {
private String mSelectedLanguages;
private ArrayList<Loc> mAvailableLanguages = new ArrayList<Loc>();
private static final String[] BLACKLIST_LANGUAGES = {
"ko", "ja", "zh"
};
private static class Loc implements Comparable {
static Collator sCollator = Collator.getInstance();
@ -137,6 +140,9 @@ public class InputLanguageSelection extends PreferenceActivity {
String country = s.substring(3, 5);
Locale l = new Locale(language, country);
// Exclude languages that are not relevant to LatinIME
if (arrayContains(BLACKLIST_LANGUAGES, language)) continue;
if (finalSize == 0) {
preprocess[finalSize++] =
new Loc(LanguageSwitcher.toTitleCase(l.getDisplayName(l)), l);
@ -167,4 +173,11 @@ public class InputLanguageSelection extends PreferenceActivity {
}
return uniqueLocales;
}
private boolean arrayContains(String[] array, String value) {
for (int i = 0; i < array.length; i++) {
if (array[i].equalsIgnoreCase(value)) return true;
}
return false;
}
}