From 06fbc83c9cd31e757b8af7cb6f18ae5227ce21f1 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 8 Mar 2025 12:08:57 +0100 Subject: [PATCH] sync_translations.py: Handle '\n' in store descriptions These are added by Weblate. --- sync_translations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sync_translations.py b/sync_translations.py index cc717aa..6703f66 100644 --- a/sync_translations.py +++ b/sync_translations.py @@ -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))