From 1ed99835a0bca551f0a2669db6679a1294edb893 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 15 Feb 2019 14:46:11 +0100 Subject: [PATCH] remove-unused-and-blank-translations.py: force Android/Weblate XML format https://github.com/WeblateOrg/weblate/issues/1886 https://github.com/WeblateOrg/weblate/issues/2333 --- tools/remove-unused-and-blank-translations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/remove-unused-and-blank-translations.py b/tools/remove-unused-and-blank-translations.py index e25e6ca4c..4479ec336 100755 --- a/tools/remove-unused-and-blank-translations.py +++ b/tools/remove-unused-and-blank-translations.py @@ -67,10 +67,11 @@ for d in sorted(glob.glob(os.path.join(resdir, 'values-*'))): count += 1 result = re.sub(r' />', r'/>', ElementTree.tostring(root, encoding='utf-8').decode('utf-8')) + result = re.sub(r'resources>\n ', r'', result) with open(str_path, 'w+') as f: - f.write(header) + f.write(re.sub(r"'", r'"', header)) f.write(result) - f.write('\n') sys.exit(count)