-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Foi {result} | ||
{result} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Sacaches un {result} | ||
{result} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{answer} |
1 change: 1 addition & 0 deletions
1
skill_randomness/locale/gl-es/dialog/multiple-die-result.dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Os teus datos son {result_string} cun total de {result_total} |
2 changes: 2 additions & 0 deletions
2
skill_randomness/locale/gl-es/dialog/number-range-not-specified.dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Elixín {number} | ||
Eu escollín {number} | ||
Vale. {number} | ||
{number} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a caras ou cruces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dime (o |un |o meu | a miña) (futuro|fortuna) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
axúdame (a facer unha escolla|a decidir algo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(escolle|selecciona|elixe) un número entre {lower} e {upper} |
3 changes: 3 additions & 0 deletions
3
skill_randomness/locale/gl-es/intents/roll-multiple-dice.intent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |