diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
index 76a230f..00d80f5 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
@@ -19,6 +19,7 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.AssetFileDescriptor;
+import android.content.res.Resources;
 import android.net.Uri;
 import android.text.TextUtils;
 
@@ -129,8 +130,11 @@
      */
     public static String getDictionaryFileFromResource(int resource, Locale locale,
             Context context) throws FileNotFoundException, IOException {
-        return copyFileTo(context.getResources().openRawResource(resource),
-                getCacheFileNameForLocale(locale, context));
+        final Resources res = context.getResources();
+        final Locale savedLocale = Utils.setSystemLocale(res, locale);
+        final InputStream stream = res.openRawResource(resource);
+        Utils.setSystemLocale(res, savedLocale);
+        return copyFileTo(stream, getCacheFileNameForLocale(locale, context));
     }
 
     /**
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
index bce787d..989a0e9 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
@@ -18,6 +18,7 @@
 
 import android.content.Context;
 import android.content.res.AssetFileDescriptor;
+import android.content.res.Resources;
 import android.util.Log;
 
 import java.io.FileNotFoundException;
@@ -42,8 +43,13 @@
     /**
      * Returns a file address from a resource, or null if it cannot be opened.
      */
-    private static AssetFileAddress loadFallbackResource(Context context, int fallbackResId) {
-        final AssetFileDescriptor afd = context.getResources().openRawResourceFd(fallbackResId);
+    private static AssetFileAddress loadFallbackResource(final Context context,
+            final int fallbackResId, final Locale locale) {
+        final Resources res = context.getResources();
+        final Locale savedLocale = Utils.setSystemLocale(res, locale);
+        final AssetFileDescriptor afd = res.openRawResourceFd(fallbackResId);
+        Utils.setSystemLocale(res, savedLocale);
+
         if (afd == null) {
             Log.e(TAG, "Found the resource but cannot read it. Is it compressed? resId="
                     + fallbackResId);
@@ -91,7 +97,8 @@
                 Log.e(TAG, "Unable to read source data for locale "
                         + locale.toString() + ": falling back to internal dictionary");
             }
-            final AssetFileAddress fallbackAsset = loadFallbackResource(context, fallbackResId);
+            final AssetFileAddress fallbackAsset = loadFallbackResource(context, fallbackResId,
+                    locale);
             if (null == fallbackAsset) return null;
             return Arrays.asList(fallbackAsset);
         }
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFactory.java b/java/src/com/android/inputmethod/latin/DictionaryFactory.java
index f0637b8..39b4f63 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFactory.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFactory.java
@@ -48,7 +48,7 @@
             int fallbackResId) {
         if (null == locale) {
             Log.e(TAG, "No locale defined for dictionary");
-            return new DictionaryCollection(createBinaryDictionary(context, fallbackResId));
+            return new DictionaryCollection(createBinaryDictionary(context, fallbackResId, locale));
         }
 
         final List<Dictionary> dictList = new LinkedList<Dictionary>();
@@ -76,7 +76,8 @@
                 // we found could not be opened by the native code for any reason (format mismatch,
                 // file too big to fit in memory, etc) then we could have an empty list. In this
                 // case we want to fall back on the resource.
-                return new DictionaryCollection(createBinaryDictionary(context, fallbackResId));
+                return new DictionaryCollection(createBinaryDictionary(context, fallbackResId,
+                        locale));
             } else {
                 return new DictionaryCollection(dictList);
             }
@@ -87,12 +88,21 @@
      * Initializes a dictionary from a raw resource file
      * @param context application context for reading resources
      * @param resId the resource containing the raw binary dictionary
+     * @param locale the locale to use for the resource
      * @return an initialized instance of BinaryDictionary
      */
-    protected static BinaryDictionary createBinaryDictionary(Context context, int resId) {
+    protected static BinaryDictionary createBinaryDictionary(final Context context,
+            final int resId, final Locale locale) {
         AssetFileDescriptor afd = null;
         try {
-            afd = context.getResources().openRawResourceFd(resId);
+            final Resources res = context.getResources();
+            if (null != locale) {
+                final Locale savedLocale = Utils.setSystemLocale(res, locale);
+                afd = res.openRawResourceFd(resId);
+                Utils.setSystemLocale(res, savedLocale);
+            } else {
+                afd = res.openRawResourceFd(resId);
+            }
             if (afd == null) {
                 Log.e(TAG, "Found the resource but it is compressed. resId=" + resId);
                 return null;
