-
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.
backup locale from old homescreen skill
- Loading branch information
0 parents
commit 903c886
Showing
20 changed files
with
186 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,37 @@ | ||
name: Run script on merge to dev by gitlocalize-app | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
run-script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: dev | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Run script if manual dispatch | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
python scripts/sync_translations.py | ||
- name: Run script if merged by gitlocalize-app[bot] | ||
if: github.event_name == 'push' && github.event.head_commit.author.username == 'gitlocalize-app[bot]' | ||
run: | | ||
python scripts/sync_translations.py | ||
- name: Commit to dev | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Update translations | ||
branch: dev |
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 @@ | ||
fes una captura | ||
fes una captura de pantalla |
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 @@ | ||
tag et skærmbillede |
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 @@ | ||
einen Screenshot machen | ||
schauspielerisch |
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 @@ | ||
take a screenshot | ||
take screenshot |
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 @@ | ||
tomar captura de pantalla | ||
tomar una captura de pantalla |
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 @@ | ||
capture d'écran | ||
prendre une capture d'écran |
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 @@ | ||
(scatta|fai) uno screenshot | ||
scatta una foto(grafia|) |
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 @@ | ||
maak (een) schermafbeelding | ||
schermenhot |
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 @@ | ||
tirar a captura de tela | ||
tirar uma captura de tela |
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,78 @@ | ||
"""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__))}/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: | ||
samples = list(set([s.strip() for s in samples | ||
if s and s.strip() != "[UNUSED]"])) # s may be None | ||
if fid.startswith("/"): | ||
p = f"{locale}/{lang.lower()}{fid}" | ||
else: | ||
p = f"{locale}/{lang.lower()}/{fid}" | ||
os.makedirs(os.path.dirname(p), exist_ok=True) | ||
with open(f"{locale}/{lang.lower()}/{fid}", "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: | ||
samples = list(set([s.strip() for s in samples | ||
if s and s.strip() != "[UNUSED]"])) # s may be None | ||
if fid.startswith("/"): | ||
p = f"{locale}/{lang.lower()}{fid}" | ||
else: | ||
p = f"{locale}/{lang.lower()}/{fid}" | ||
os.makedirs(os.path.dirname(p), exist_ok=True) | ||
with open(f"{locale}/{lang.lower()}/{fid}", "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: | ||
samples = list(set([s.strip() for s in samples | ||
if s and s.strip() != "[UNUSED]"])) # s may be None | ||
if fid.startswith("/"): | ||
p = f"{locale}/{lang.lower()}{fid}" | ||
else: | ||
p = f"{locale}/{lang.lower()}/{fid}" | ||
os.makedirs(os.path.dirname(p), exist_ok=True) | ||
with open(f"{locale}/{lang.lower()}/{fid}", "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: | ||
samples = list(set([s.strip() for s in samples | ||
if s and s.strip() != "[UNUSED]"])) # s may be None | ||
if fid.startswith("/"): | ||
p = f"{locale}/{lang.lower()}{fid}" | ||
else: | ||
p = f"{locale}/{lang.lower()}/{fid}" | ||
os.makedirs(os.path.dirname(p), exist_ok=True) | ||
with open(f"{locale}/{lang.lower()}/{fid}", "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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"fes una captura de pantalla", | ||
"fes una captura" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"tag et skærmbillede", | ||
"tag et skærmbillede" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"einen Screenshot machen", | ||
"schauspielerisch" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"take screenshot", | ||
"take a screenshot" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"tomar una captura de pantalla", | ||
"tomar captura de pantalla" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"prendre une capture d'\u00e9cran", | ||
"capture d'\u00e9cran" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"(scatta|fai) uno screenshot", | ||
"scatta una foto(grafia|)" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"maak (een) schermafbeelding", | ||
"schermenhot" | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"take.screenshot.intent": [ | ||
"tirar uma captura de tela", | ||
"tirar a captura de tela" | ||
] | ||
} |