diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/DictionaryHeaderUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/DictionaryHeaderUtils.java
new file mode 100644
index 0000000..5eb613c
--- /dev/null
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/DictionaryHeaderUtils.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.inputmethod.latin.utils;
+
+import com.android.inputmethod.latin.AssetFileAddress;
+import com.android.inputmethod.latin.makedict.DictionaryHeader;
+
+import java.io.File;
+
+public class DictionaryHeaderUtils {
+
+    public static int getContentVersion(AssetFileAddress fileAddress) {
+        final DictionaryHeader header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull(
+                new File(fileAddress.mFilename), fileAddress.mOffset, fileAddress.mLength);
+        return Integer.parseInt(header.mVersionString);
+    }
+}
diff --git a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
index 3ed6a02..fd567f4 100644
--- a/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java
@@ -340,7 +340,7 @@
         return getDictionaryFileHeaderOrNull(file, 0, file.length());
     }
 
-    private static DictionaryHeader getDictionaryFileHeaderOrNull(final File file,
+    public static DictionaryHeader getDictionaryFileHeaderOrNull(final File file,
             final long offset, final long length) {
         try {
             final DictionaryHeader header =
@@ -357,23 +357,17 @@
      * Returns information of the dictionary.
      *
      * @param fileAddress the asset dictionary file address.
+     * @param locale Locale for this file.
      * @return information of the specified dictionary.
      */
     @Nullable
     private static DictionaryInfo createDictionaryInfoFromFileAddress(
-            final AssetFileAddress fileAddress) {
-        // TODO: Read the header and update the version number for the new dictionaries.
-        // This will make sure that the dictionary version is updated in the database.
-        final DictionaryHeader header = getDictionaryFileHeaderOrNull(
-                new File(fileAddress.mFilename), fileAddress.mOffset, fileAddress.mLength);
-        if (header == null) {
-            return null;
-        }
-        final String id = header.mIdString;
-        final Locale locale = LocaleUtils.constructLocaleFromString(header.mLocaleString);
-        final String description = header.getDescription();
-        final String version = header.mVersionString;
-        return new DictionaryInfo(id, locale, description, fileAddress, Integer.parseInt(version));
+            final AssetFileAddress fileAddress, Locale locale) {
+        final String id = getMainDictId(locale);
+        final int version = DictionaryHeaderUtils.getContentVersion(fileAddress);
+        final String description = SubtypeLocaleUtils
+                .getSubtypeLocaleDisplayName(locale.toString());
+        return new DictionaryInfo(id, locale, description, fileAddress, version);
     }
 
     private static void addOrUpdateDictInfo(final ArrayList<DictionaryInfo> dictList,
@@ -410,7 +404,7 @@
                     final Locale locale = LocaleUtils.constructLocaleFromString(localeString);
                     final AssetFileAddress fileAddress = AssetFileAddress.makeFromFile(dict);
                     final DictionaryInfo dictionaryInfo =
-                            createDictionaryInfoFromFileAddress(fileAddress);
+                            createDictionaryInfoFromFileAddress(fileAddress, locale);
                     // Protect against cases of a less-specific dictionary being found, like an
                     // en dictionary being used for an en_US locale. In this case, the en dictionary
                     // should be used for en_US but discounted for listing purposes.
@@ -435,7 +429,8 @@
             }
             final AssetFileAddress fileAddress =
                     BinaryDictionaryGetter.loadFallbackResource(context, resourceId);
-            final DictionaryInfo dictionaryInfo = createDictionaryInfoFromFileAddress(fileAddress);
+            final DictionaryInfo dictionaryInfo = createDictionaryInfoFromFileAddress(fileAddress,
+                    locale);
             // Protect against cases of a less-specific dictionary being found, like an
             // en dictionary being used for an en_US locale. In this case, the en dictionary
             // should be used for en_US but discounted for listing purposes.
