From 6e269705092128f3749c1b06b981f28ae75e3d74 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Mon, 2 Dec 2024 01:29:01 +0000 Subject: [PATCH] import galician translations (#18) --- locale/en-us/radio.voc | 2 +- locale/gl-es/radio.voc | 3 +++ locale/gl-es/somafm.voc | 2 ++ scripts/sync_translations.py | 16 ++++++++++++---- translations/gl-es/vocabs.json | 11 +++++++++++ 5 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 locale/gl-es/radio.voc create mode 100644 locale/gl-es/somafm.voc create mode 100644 translations/gl-es/vocabs.json diff --git a/locale/en-us/radio.voc b/locale/en-us/radio.voc index 328b8c1..014d0dc 100644 --- a/locale/en-us/radio.voc +++ b/locale/en-us/radio.voc @@ -1,3 +1,3 @@ -radio internet radio +radio web radio \ No newline at end of file diff --git a/locale/gl-es/radio.voc b/locale/gl-es/radio.voc new file mode 100644 index 0000000..fc1ee54 --- /dev/null +++ b/locale/gl-es/radio.voc @@ -0,0 +1,3 @@ +radio +radio de internet +radio web \ No newline at end of file diff --git a/locale/gl-es/somafm.voc b/locale/gl-es/somafm.voc new file mode 100644 index 0000000..2d297d6 --- /dev/null +++ b/locale/gl-es/somafm.voc @@ -0,0 +1,2 @@ +soma fm +somafm \ No newline at end of file diff --git a/scripts/sync_translations.py b/scripts/sync_translations.py index 5c69e64..bb2bfbc 100644 --- a/scripts/sync_translations.py +++ b/scripts/sync_translations.py @@ -23,7 +23,9 @@ if samples: samples = [s.strip() for s in samples if s and s.strip() != "[UNUSED]"] # s may be None - with open(f"{locale}/{lang}/{fid}", "w") as f: + p = f"{locale}/{lang.lower()}/{fid.lstrip('/')}" + os.makedirs(dirname(p), exist_ok=True) + with open(p, "w") as f: f.write("\n".join(sorted(samples))) if os.path.isfile(dialogs): @@ -33,7 +35,9 @@ if samples: samples = [s.strip() for s in samples if s and s.strip() != "[UNUSED]"] # s may be None - with open(f"{locale}/{lang}/{fid}", "w") as f: + p = f"{locale}/{lang.lower()}/{fid.lstrip('/')}" + os.makedirs(dirname(p), exist_ok=True) + with open(p, "w") as f: f.write("\n".join(sorted(samples))) if os.path.isfile(vocs): @@ -43,7 +47,9 @@ if samples: samples = [s.strip() for s in samples if s and s.strip() != "[UNUSED]"] # s may be None - with open(f"{locale}/{lang}/{fid}", "w") as f: + p = f"{locale}/{lang.lower()}/{fid.lstrip('/')}" + os.makedirs(dirname(p), exist_ok=True) + with open(p, "w") as f: f.write("\n".join(sorted(samples))) if os.path.isfile(regexes): @@ -53,6 +59,8 @@ if samples: samples = [s.strip() for s in samples if s and s.strip() != "[UNUSED]"] # s may be None - with open(f"{locale}/{lang}/{fid}", "w") as f: + p = f"{locale}/{lang.lower()}/{fid.lstrip('/')}" + os.makedirs(dirname(p), exist_ok=True) + with open(p, "w") as f: f.write("\n".join(sorted(samples))) diff --git a/translations/gl-es/vocabs.json b/translations/gl-es/vocabs.json new file mode 100644 index 0000000..0ae1101 --- /dev/null +++ b/translations/gl-es/vocabs.json @@ -0,0 +1,11 @@ +{ + "somafm.voc": [ + "soma fm", + "somafm" + ], + "radio.voc": [ + "radio de internet", + "radio", + "radio web" + ] +} \ No newline at end of file