Merge "Remove non-words from the French dictionary." into jb-dev
diff --git a/java/res/xml/spellchecker.xml b/java/res/xml/spellchecker.xml
index 2e4448c..66cd662 100644
--- a/java/res/xml/spellchecker.xml
+++ b/java/res/xml/spellchecker.xml
@@ -29,6 +29,14 @@
     />
     <subtype
             android:label="@string/subtype_generic"
+            android:subtypeLocale="en_US"
+    />
+    <subtype
+            android:label="@string/subtype_generic"
+            android:subtypeLocale="en_GB"
+    />
+    <subtype
+            android:label="@string/subtype_generic"
             android:subtypeLocale="fr"
     />
     <subtype
@@ -55,4 +63,12 @@
             android:label="@string/subtype_generic"
             android:subtypeLocale="nl"
     />
+    <subtype
+            android:label="@string/subtype_generic"
+            android:subtypeLocale="hr"
+    />
+    <subtype
+            android:label="@string/subtype_generic"
+            android:subtypeLocale="pt_BR"
+    />
 </spell-checker>
diff --git a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java
index ffdbfbb..f8f1395 100644
--- a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java
+++ b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java
@@ -28,6 +28,7 @@
 import java.util.ArrayList;
 
 public class AdditionalSubtype {
+    private static final InputMethodSubtype[] EMPTY_SUBTYPE_ARRAY = new InputMethodSubtype[0];
 
     private AdditionalSubtype() {
         // This utility class is not publicly instantiable.
@@ -86,7 +87,7 @@
 
     public static InputMethodSubtype[] createAdditionalSubtypesArray(String prefSubtypes) {
         if (TextUtils.isEmpty(prefSubtypes)) {
-            return null;
+            return EMPTY_SUBTYPE_ARRAY;
         }
         final String[] prefSubtypeArray = prefSubtypes.split(PREF_SUBTYPE_SEPARATOR);
         final ArrayList<InputMethodSubtype> subtypesList =
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index afd59c3..aa32501 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -102,13 +102,19 @@
         // will never have any suggestions, so it makes no sense checking them.
         mLanguageToScript = new TreeMap<String, Integer>();
         mLanguageToScript.put("en", SCRIPT_LATIN);
+        mLanguageToScript.put("en_US", SCRIPT_LATIN);
+        mLanguageToScript.put("en_GB", SCRIPT_LATIN);
         mLanguageToScript.put("fr", SCRIPT_LATIN);
         mLanguageToScript.put("de", SCRIPT_LATIN);
         mLanguageToScript.put("nl", SCRIPT_LATIN);
         mLanguageToScript.put("cs", SCRIPT_LATIN);
         mLanguageToScript.put("es", SCRIPT_LATIN);
         mLanguageToScript.put("it", SCRIPT_LATIN);
+        mLanguageToScript.put("hr", SCRIPT_LATIN);
+        mLanguageToScript.put("pt_BR", SCRIPT_LATIN);
         mLanguageToScript.put("ru", SCRIPT_CYRILLIC);
+        // TODO: Make a persian proximity, and activate the Farsi subtype.
+        // mLanguageToScript.put("fa", SCRIPT_PERSIAN);
     }
 
     @Override public void onCreate() {