svghmi/i18n.py
branchsvghmi
changeset 3216 d6d002766a93
parent 3214 bb314cdfc656
child 3218 76f1cd1291f4
--- a/svghmi/i18n.py	Wed Mar 31 15:28:09 2021 +0200
+++ b/svghmi/i18n.py	Wed Mar 31 15:30:07 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: