Skip to content

Commit

Permalink
import galician translations (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Dec 2, 2024
1 parent a94f647 commit 6e26970
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion locale/en-us/radio.voc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
radio
internet radio
radio
web radio
3 changes: 3 additions & 0 deletions locale/gl-es/radio.voc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
radio
radio de internet
radio web
2 changes: 2 additions & 0 deletions locale/gl-es/somafm.voc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
soma fm
somafm
16 changes: 12 additions & 4 deletions scripts/sync_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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)))

11 changes: 11 additions & 0 deletions translations/gl-es/vocabs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"somafm.voc": [
"soma fm",
"somafm"
],
"radio.voc": [
"radio de internet",
"radio",
"radio web"
]
}

0 comments on commit 6e26970

Please sign in to comment.