aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/LanguageSwitcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/inputmethod/latin/LanguageSwitcher.java')
-rw-r--r--src/com/android/inputmethod/latin/LanguageSwitcher.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/inputmethod/latin/LanguageSwitcher.java b/src/com/android/inputmethod/latin/LanguageSwitcher.java
index 68d0d15cc..12045125f 100644
--- a/src/com/android/inputmethod/latin/LanguageSwitcher.java
+++ b/src/com/android/inputmethod/latin/LanguageSwitcher.java
@@ -21,6 +21,7 @@ import java.util.Locale;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;
+import android.text.TextUtils;
/**
* Keeps track of list of selected input languages and the current
@@ -88,8 +89,9 @@ public class LanguageSwitcher {
private void loadDefaults() {
mDefaultInputLocale = mIme.getResources().getConfiguration().locale;
- mDefaultInputLanguage = mDefaultInputLocale.getLanguage() + "_"
- + mDefaultInputLocale.getCountry();
+ String country = mDefaultInputLocale.getCountry();
+ mDefaultInputLanguage = mDefaultInputLocale.getLanguage() +
+ (TextUtils.isEmpty(country) ? "" : "_" + country);
}
private void constructLocales() {