diff --git a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
index b5a1101..5e835e5 100644
--- a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
+++ b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
@@ -89,11 +89,6 @@
         for (int i = 0; i < list.length; i++) {
             if (lang.equalsIgnoreCase(list[i])) return true;
         }
-        // If it matches the current locale
-        Locale displayLocale = getResources().getConfiguration().locale;
-        if (lang.equalsIgnoreCase(get5Code(displayLocale))) {
-            return true;
-        }
         return false;
     }
 
diff --git a/java/src/com/android/inputmethod/latin/LanguageSwitcher.java b/java/src/com/android/inputmethod/latin/LanguageSwitcher.java
index 1204512..578c805 100644
--- a/java/src/com/android/inputmethod/latin/LanguageSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/LanguageSwitcher.java
@@ -36,6 +36,7 @@
     private int      mCurrentIndex = 0;
     private String   mDefaultInputLanguage;
     private Locale   mDefaultInputLocale;
+    private Locale   mSystemLocale;
 
     public LanguageSwitcher(LatinIME ime) {
         mIme = ime;
@@ -97,7 +98,9 @@
     private void constructLocales() {
         mLocales = new Locale[mSelectedLanguageArray.length];
         for (int i = 0; i < mLocales.length; i++) {
-            mLocales[i] = new Locale(mSelectedLanguageArray[i]);
+            final String lang = mSelectedLanguageArray[i];
+            mLocales[i] = new Locale(lang.substring(0, 2),
+                    lang.length() > 4 ? lang.substring(3, 5) : "");
         }
     }
 
@@ -141,6 +144,22 @@
     }
 
     /**
+     * Sets the system locale (display UI) used for comparing with the input language.
+     * @param locale the locale of the system
+     */
+    public void setSystemLocale(Locale locale) {
+        mSystemLocale = locale;
+    }
+
+    /**
+     * Returns the system locale.
+     * @return the system locale
+     */
+    public Locale getSystemLocale() {
+        return mSystemLocale;
+    }
+
+    /**
      * Returns the previous input locale in the list. Wraps around to the end of the
      * list if we're at the beginning of the list.
      * @return
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 206091b..299b6a6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -283,6 +283,7 @@
         mKeyboardSwitcher = new KeyboardSwitcher(this, this);
         mKeyboardSwitcher.setLanguageSwitcher(mLanguageSwitcher);
         mSystemLocale = conf.locale.toString();
+        mLanguageSwitcher.setSystemLocale(conf.locale);
         String inputLanguage = mLanguageSwitcher.getInputLanguage();
         if (inputLanguage == null) {
             inputLanguage = conf.locale.toString();
@@ -368,6 +369,7 @@
             if (mLanguageSwitcher != null) {
                 mLanguageSwitcher.loadLocales(
                         PreferenceManager.getDefaultSharedPreferences(this));
+                mLanguageSwitcher.setSystemLocale(conf.locale);
                 toggleLanguage(true, true);
             } else {
                 reloadKeyboards();
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index 58e1dc7..d3b23a4 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -430,6 +430,13 @@
         Locale locale = mLanguageSwitcher.getLocaleCount() > 0
                 ? mLanguageSwitcher.getInputLocale()
                 : null;
+        // If the language count is 1 and is the same as the system language, don't show it.
+        if (locale != null
+                && mLanguageSwitcher.getLocaleCount() == 1
+                && mLanguageSwitcher.getSystemLocale().getLanguage()
+                   .equalsIgnoreCase(locale.getLanguage())) {
+            locale = null;
+        }
         if (mLocale != null && mLocale.equals(locale)) return;
         mLocale = locale;
         updateSpaceBarForLocale();
