diff options
Diffstat (limited to 'java/src')
3 files changed, 32 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java index 9f89f9ee1..7694b56fc 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java +++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java @@ -22,6 +22,8 @@ import android.content.Context; import android.content.res.Resources; import android.view.inputmethod.InputMethodSubtype; +import com.android.inputmethod.latin.LocaleUtils.RunInLocale; + import java.util.HashMap; import java.util.Locale; @@ -121,18 +123,27 @@ public class SubtypeLocale { // fr azerty F Français // fr_CA qwerty F Français (Canada) // de qwertz F Deutsch - // zz qwerty F No language (QWERTY) + // zz qwerty F No language (QWERTY) in system locale // fr qwertz T Français (QWERTZ) // de qwerty T Deutsch (QWERTY) // en_US azerty T English (US) (AZERTY) - // zz azerty T No language (AZERTY) + // zz azerty T No language (AZERTY) in system locale public static String getSubtypeDisplayName(InputMethodSubtype subtype, Resources res) { // TODO: Remove this check when InputMethodManager.getLastInputMethodSubtype is // fixed. if (!ImfUtils.checkIfSubtypeBelongsToThisIme(sContext, subtype)) return ""; final String language = getSubtypeLocaleDisplayName(subtype.getLocale()); - return res.getString(subtype.getNameResId(), language); + final int nameResId = subtype.getNameResId(); + final RunInLocale<String> getSubtypeName = new RunInLocale<String>() { + @Override + protected String job(Resources res) { + return res.getString(nameResId, language); + } + }; + final Locale locale = isNoLanguage(subtype) + ? res.getConfiguration().locale : getSubtypeLocale(subtype); + return getSubtypeName.runInLocale(res, locale); } public static boolean isNoLanguage(InputMethodSubtype subtype) { diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java index 62525c205..9191aa953 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java @@ -162,7 +162,7 @@ public class UserHistoryDictionary extends ExpandableDictionary { * Return whether the passed charsequence is in the dictionary. */ @Override - public boolean isValidWord(final CharSequence word) { + public synchronized boolean isValidWord(final CharSequence word) { // TODO: figure out what is the correct thing to do here. return false; } diff --git a/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java b/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java index cff8d6fd0..1281c7e3a 100644 --- a/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java +++ b/java/src/com/android/inputmethod/latin/makedict/MakedictLog.java @@ -16,25 +16,32 @@ package com.android.inputmethod.latin.makedict; +import android.util.Log; + /** * Wrapper to redirect log events to the right output medium. */ public class MakedictLog { - - private static void print(String message) { - System.out.println(message); - } + private static final boolean DBG = false; + private static final String TAG = MakedictLog.class.getSimpleName(); public static void d(String message) { - print(message); - } - public static void e(String message) { - print(message); + if (DBG) { + Log.d(TAG, message); + } } + public static void i(String message) { - print(message); + if (DBG) { + Log.i(TAG, message); + } } + public static void w(String message) { - print(message); + Log.w(TAG, message); + } + + public static void e(String message) { + Log.e(TAG, message); } } |