Add header to XML fragments file

A header containing a charset is required by xgettext.
This commit is contained in:
Nick Hall 2023-07-26 17:32:11 +01:00
parent 91473e65fb
commit 2319e04d95

View File

@ -352,6 +352,9 @@ def xml_fragments():
print("Checking for XML fragments in Python files")
modop = int(len(files) / 20)
wfp = open("fragments.pot", 'w', encoding='utf-8')
wfp.write('msgid ""\n')
wfp.write('msgstr ""\n')
wfp.write('"Content-Type: text/plain; charset=UTF-8\\n"\n\n')
for indx, filename in enumerate(files):
if not indx % modop:
print(int(indx / len(files) * 100), end='\r')