Fix encoding

This commit is contained in:
croneter 2021-03-20 14:02:42 +01:00
parent 4c03ee943f
commit 790add3911

View file

@ -65,11 +65,11 @@ for lang in languages:
'resources', 'resources',
'language', 'language',
'resource.language.%s' % lang, 'resource.language.%s' % lang,
'strings.po'), 'rb') as f: 'strings.po'), 'r', encoding='utf-8') as f:
for line in f: for line in f:
if line.strip() in addon: if line.strip() in addon:
msg = '' msg = ''
key = str(line.strip()) key = line.strip()
# Advance to the line msgstr "" # Advance to the line msgstr ""
part = '' part = ''
while not part.startswith('msgstr'): while not part.startswith('msgstr'):
@ -83,7 +83,7 @@ for lang in languages:
print(msg) print(msg)
etree.SubElement(root, etree.SubElement(root,
addon[key], addon[key],
attrib={'lang': lang}).text = msg.decode('utf-8') attrib={'lang': lang}).text = msg
except IOError: except IOError:
print('Missing file %s' % os.path.join(PKC_dir, print('Missing file %s' % os.path.join(PKC_dir,
'resources', 'resources',