abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
authorJules Aguillon2025-03-08 12:08:57 +0100
committerJules Aguillon2025-03-08 12:08:57 +0100
commit06fbc83c9cd31e757b8af7cb6f18ae5227ce21f1 (patch)
treefd137de1696c43d8842b8c707c825e2bdfa1283b
parenta123810247d867a44e4be066d1d88f71b71fdc3f (diff)
downloadunexpected-keyboard-06fbc83c9cd31e757b8af7cb6f18ae5227ce21f1.tar.gz
unexpected-keyboard-06fbc83c9cd31e757b8af7cb6f18ae5227ce21f1.zip
sync_translations.py: Handle '\n' in store descriptions
These are added by Weblate.
-rw-r--r--sync_translations.py6
1 files changed, 5 insertions, 1 deletions
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))