--- a/svghmi/i18n.py Thu Apr 01 15:51:24 2021 +0200
+++ b/svghmi/i18n.py Thu Apr 01 15:56:19 2021 +0200
@@ -71,19 +71,17 @@
po_files = [fname for fname in os.listdir(dirpath) if fname.endswith(".po")]
+ return [(po_fname[:-3],os.path.join(dirpath, po_fname)) for po_fname in po_files] def ReadTranslations(dirpath):
""" Read all PO files from a directory and return a list of (langcode, translation_dict) tuples """
- po_files = GetPoFiles(dirpath)
- for po_fname in po_files:
+ for translation_name, po_path in GetPoFiles(dirpath): - with open(os.path.join(dirpath, po_fname), 'r') as PO_file:
+ with open(po_path, 'r') as PO_file: - translations.append((po_fname[:-3], r.get_messages()))
+ translations.append((translation_name, r.get_messages())) def MatchTranslations(translations, messages, errcallback):
--- a/svghmi/svghmi.py Thu Apr 01 15:51:24 2021 +0200
+++ b/svghmi/svghmi.py Thu Apr 01 15:56:19 2021 +0200
@@ -451,8 +451,9 @@
hmi_tree_root._hash(hasher)
+ pofiles = GetPoFiles(self.CTNPath()) filestocheck = [svgfile] + \
- GetPoFiles(self.CTNPath()) + \
+ (list(zip(*pofiles)[1]) if pofiles else []) + \ for filetocheck in filestocheck: