sync_translations.py: Handle '\n' in store descriptions

These are added by Weblate.
This commit is contained in:
Jules Aguillon 2025-03-08 12:08:57 +01:00
parent a123810247
commit 06fbc83c9c

View File

@ -74,7 +74,11 @@ def sync_metadata(value_dir, strings):
os.makedirs(meta_dir)
txt_file = os.path.join(meta_dir, fname)
with open(txt_file, "w", encoding="utf-8") as out:
out.write(string.text.removeprefix('"').removesuffix('"'))
out.write(string.text
.replace("\\n", "\n")
.replace("\\'", "'")
.removeprefix('"')
.removesuffix('"'))
out.write("\n")
sync_meta_file("title.txt", ("app_name_release", None))
sync_meta_file("short_description.txt", ("short_description", None))