spirit committed 46f0bc6


Comments (0)

Files changed (1)


     import locale
-    enchant_primary_languages = None
+    enchant_base_languages = None
     def check_with_enchant(words, languages, threshold=0.7, min_words=1,
         best_score = 0
         best_tag = None
-        for tag in list_enchant_primary_languages():
+        for tag in list_enchant_base_languages():
             if tag not in languages:
         return best_tag
-    def list_enchant_primary_languages():
-        """Get ordered list of enchant primary languages.
+    def list_enchant_base_languages():
+        """Get ordered list of enchant base languages.
         locale_language, then "en", then the rest.
-        global enchant_primary_languages
-        if enchant_primary_languages is None:
+        global enchant_base_languages
+        if enchant_base_languages is None:
             def get_language_subtag(tag):
                 return tag.split("_")[0]
-            enchant_primary_languages = sorted(
+            enchant_base_languages = sorted(
                 {get_language_subtag(tag) for tag in enchant.list_languages()})
             for tag in ["en", get_language_subtag(get_locale_language())]:
-                    index = enchant_primary_languages.index(tag)
+                    index = enchant_base_languages.index(tag)
                 except ValueError:
-                    enchant_primary_languages = (
-                        [enchant_primary_languages[index]] +
-                        enchant_primary_languages[:index] +
-                        enchant_primary_languages[index+1:]
+                    enchant_base_languages = (
+                        [enchant_base_languages[index]] +
+                        enchant_base_languages[:index] +
+                        enchant_base_languages[index+1:]
-        return enchant_primary_languages
+        return enchant_base_languages
     def get_locale_language():
         """Get the language code for the current locale setting.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.