diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java index 37c390d13..32c4950da 100644 --- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java +++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java @@ -107,13 +107,19 @@ public class UserDictionaryList extends PreferenceFragment { protected void createUserDictSettings(PreferenceGroup userDictGroup) { final Activity activity = getActivity(); userDictGroup.removeAll(); - final TreeSet localeList = + final TreeSet localeSet = UserDictionaryList.getUserDictionaryLocalesSet(activity); - if (localeList.isEmpty()) { + if (localeSet.size() > 1) { + // Have an "All languages" entry in the languages list if there are two or more active + // languages + localeSet.add(""); + } + + if (localeSet.isEmpty()) { userDictGroup.addPreference(createUserDictionaryPreference(null, activity)); } else { - for (String locale : localeList) { + for (String locale : localeSet) { userDictGroup.addPreference(createUserDictionaryPreference(locale, activity)); } }