svghmi/i18n.py
branchsvghmi
changeset 3214 bb314cdfc656
parent 3198 d9c8f8789fc8
child 3218 76f1cd1291f4
--- a/svghmi/i18n.py	Wed Mar 31 08:25:18 2021 +0200
+++ b/svghmi/i18n.py	Wed Mar 31 09:08:15 2021 +0200
@@ -68,11 +68,15 @@
     with open(fname, 'w') as POT_file:
         w.write(POT_file)
 
+def GetPoFiles(dirpath):
+    po_files = [fname for fname in os.listdir(dirpath) if fname.endswith(".po")]
+    po_files.sort()
+    return po_files
+
 def ReadTranslations(dirpath):
     """ Read all PO files from a directory and return a list of (langcode, translation_dict) tuples """
 
-    po_files = [fname for fname in os.listdir(dirpath) if fname.endswith(".po")]
-    po_files.sort()
+    po_files = GetPoFiles(dirpath)
 
     translations = []
     for po_fname in po_files: