--- a/svghmi/i18n.py Wed Mar 20 11:09:24 2024 +0100
+++ b/svghmi/i18n.py Wed Mar 20 12:15:23 2024 +0100
@@ -17,9 +17,6 @@
from email.parser import HeaderParser
-# to have it for python 2, had to install
-# https://pypi.org/project/pycountry/18.12.8/
-# python2 -m pip install pycountry==18.12.8 --user
from dialogs import MessageBoxOnce
from POULibrary import UserAddressedException
@@ -185,6 +182,7 @@
"Content-Transfer-Encoding: 8bit\\n"
"Generated-By: SVGHMI 1.0\\n"
@@ -202,9 +200,7 @@
- l = [escapes[c] if c < 128 else bytes([c]) for c in s]
- #return bytes([escapes[c] if c < 128 else c for c in s])
+ return b''.join([escapes[c] if c < 128 else bytes([c]) for c in s]) # This converts the various Python string types into a format that is
@@ -257,12 +253,12 @@
if len(locline) + len(s) <= 78:
+ fp.write(locline + b'\n') if len(locline) > len(locpfx):
- fp.write(b'msgid '+normalize(k))
- fp.write(b'msgstr ""\n')
+ fp.write(locline + b'\n') + fp.write(b'msgid ' + normalize(k) + b'\n') + fp.write(b'msgstr ""\n\n')