Skip to content

Commit

Permalink
import galician translations
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 2, 2024
1 parent 90f74ad commit 01ceafe
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 0 deletions.
74 changes: 74 additions & 0 deletions scripts/sync_translations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
"""this script should run in every PR originated from @gitlocalize-app
TODO - before PR merge
"""

import json
from os.path import dirname
import os

locale = f"{dirname(dirname(__file__))}/skill_randomness/locale"
tx = f"{dirname(dirname(__file__))}/translations"


for lang in os.listdir(tx):
intents = f"{tx}/{lang}/intents.json"
dialogs = f"{tx}/{lang}/dialogs.json"
vocs = f"{tx}/{lang}/vocabs.json"
regexes = f"{tx}/{lang}/regexes.json"

if os.path.isfile(intents):
with open(intents) as f:
data = json.load(f)
for fid, samples in data.items():

if samples:
os.makedirs(f"{locale}/{lang.lower()}", exist_ok=True)
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
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):
with open(dialogs) as f:
data = json.load(f)
for fid, samples in data.items():

if samples:
os.makedirs(f"{locale}/{lang.lower()}", exist_ok=True)
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
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):
with open(vocs) as f:
data = json.load(f)
for fid, samples in data.items():

if samples:
os.makedirs(f"{locale}/{lang.lower()}", exist_ok=True)
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
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):
with open(regexes) as f:
data = json.load(f)
for fid, samples in data.items():

if samples:
os.makedirs(f"{locale}/{lang.lower()}", exist_ok=True)
samples = [s.strip() for s in samples
if s and s.strip() != "[UNUSED]"] # s may be None
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)))

2 changes: 2 additions & 0 deletions skill_randomness/locale/gl-es/dialog/choice-result.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sen dúbida {choice}.
Unha escolla difícil. Mais imos escoller {choice}!
2 changes: 2 additions & 0 deletions skill_randomness/locale/gl-es/dialog/coin-result.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Foi {result}
{result}
2 changes: 2 additions & 0 deletions skill_randomness/locale/gl-es/dialog/die-result.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sacaches un {result}
{result}
2 changes: 2 additions & 0 deletions skill_randomness/locale/gl-es/dialog/first-choice.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cal é a túa primeira opción?
Vale. Cal é a primeira escolla?
2 changes: 2 additions & 0 deletions skill_randomness/locale/gl-es/dialog/fortune-query.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Eu sei todas as cousas... se son preguntas de si ou non. Cal é a túa?
Que queres saber? Responderei si ou non.
1 change: 1 addition & 0 deletions skill_randomness/locale/gl-es/dialog/fortune-result.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{answer}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Os teus datos son {result_string} cun total de {result_total}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Non entendín moi ben os teus números. Vou escoller entre 1 e 10 daquela.
Non sei moi ben o que dixeches. Imos escoller entre 1 e 10.
4 changes: 4 additions & 0 deletions skill_randomness/locale/gl-es/dialog/number-result.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Elixín {number}
Eu escollín {number}
Vale. {number}
{number}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixaches un límite de {number} na túa configuración. O que vou facer é lanzar {number} dados.
2 changes: 2 additions & 0 deletions skill_randomness/locale/gl-es/dialog/second-choice.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cal é a túa segunda opción?
Vale. Agora cal é a segunda opción?
1 change: 1 addition & 0 deletions skill_randomness/locale/gl-es/intents/flip-a-coin.intent
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a caras ou cruces
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dime (o |un |o meu | a miña) (futuro|fortuna)
1 change: 1 addition & 0 deletions skill_randomness/locale/gl-es/intents/make-a-choice.intent
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
axúdame (a facer unha escolla|a decidir algo)
1 change: 1 addition & 0 deletions skill_randomness/locale/gl-es/intents/pick-a-number.intent
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(escolle|selecciona|elixe) un número entre {lower} e {upper}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lanza {number} (dados|dado)
lanza {number} (dados|dado) de {faces} caras
lanza {number} de {faces}
4 changes: 4 additions & 0 deletions skill_randomness/locale/gl-es/intents/roll-single-die.intent
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
lanza (un| ) dado
lanza dados de {faces} caras
lanza un dado
lanza un dado de {faces} caras

0 comments on commit 01ceafe

Please sign in to comment.