From 5245eff6e12a781bb2e072e75d7e610252c4135d Mon Sep 17 00:00:00 2001 From: Cloudburst <18114966+C10udburst@users.noreply.github.com> Date: Sat, 18 Mar 2023 09:22:07 +0100 Subject: [PATCH] [skip ci] fix xml header being slightly wrong --- .github/locales.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/locales.py b/.github/locales.py index 04d9cd13..9ab272b9 100644 --- a/.github/locales.py +++ b/.github/locales.py @@ -56,6 +56,8 @@ for file in glob.glob(f"{XML_NAME}*/strings.xml"): if child.text.startswith("\\@string/"): print(f"[{file}] fixing {child.attrib['name']}") child.text = child.text.replace("\\@string/", "@string/") - tree.write(file, encoding="utf-8", method="xml", pretty_print=True, xml_declaration=True) + with open(file, 'w') as fp: + fp.write('\n') + tree.write(fp, encoding="utf-8", method="xml", pretty_print=True, xml_declaration=False) except ET.ParseError as ex: - print(f"[{file}] {ex}") \ No newline at end of file + print(f"[{file}] {ex}")