Skip to content

Commit 7cda776

Browse files
committed
chore: basic crowdin commands
- push english sources to crowdin - pull translations from crowdin [no changelog]
1 parent 67414fb commit 7cda776

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

core/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@ translations_check: ## check that translations are up to date
276276
# spits out error if the stored merkle root is not up to date
277277
python ./translations/cli.py merkle-root > /dev/null
278278

279+
translations_crowdin_push: translations ## split translations and push to crowdin
280+
## prepare source files from joint `en.json` into split `en_<layout_type>.json`
281+
cd translations; python crowdin.py split
282+
cd translations; crowdin push sources
283+
284+
translations_crowdin_pull: ## pull translations from crowdin
285+
cd translations; crowdin pull --skip-untranslated-strings
286+
# prepare joint `<lang>.json` from split `<lang>_<layout_type>.json`
287+
cd translations; python crowdin.py merge
288+
279289
## build commands:
280290

281291
build: build_boardloader build_bootloader build_firmware build_prodtest build_unix ## build all

core/translations/crowdin.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,42 @@
1+
#
2+
# Basic Crowdin CLI configuration
3+
# See https://crowdin.github.io/crowdin-cli/configuration for more information
4+
# See https://support.crowdin.com/developer/configuration-file/ for all available options
5+
#
6+
7+
#
8+
# Your Crowdin credentials
9+
#
110
"project_id": "625982"
2-
"base_path": "."
3-
# api_token is being supplied on via `--token $CROWDIN_TOKEN` CLI option
11+
"api_token_env": "CROWDIN_TOKEN"
12+
"base_path": "./crowdin/"
413
"base_url": "https://api.crowdin.com"
14+
15+
#
16+
# Defines whether to preserve the original directory structure in the Crowdin project
17+
# Recommended to set to true
18+
#
519
"preserve_hierarchy": true
620

21+
#
22+
# Files configuration.
23+
# See https://support.crowdin.com/developer/configuration-file/ for all available options
24+
#
725
files: [
826
{
9-
"source": "en.json",
10-
"translation": "%two_letters_code%/%original_file_name%",
27+
"source": "en_Bolt.json",
28+
"translation": "%two_letters_code%_Bolt.%file_extension%"
29+
},
30+
{
31+
"source": "en_Caesar.json",
32+
"translation": "%two_letters_code%_Caesar.%file_extension%"
33+
},
34+
{
35+
"source": "en_Delizia.json",
36+
"translation": "%two_letters_code%_Delizia.%file_extension%"
37+
},
38+
{
39+
"source": "en_Eckhart.json",
40+
"translation": "%two_letters_code%_Eckhart.%file_extension%"
1141
}
1242
]

0 commit comments

Comments
 (0)