Add the script for updating i18n files

https://github.com/rancher/rancher/issues/10078
This commit is contained in:
loganhz 2017-10-13 20:38:04 +08:00
parent 739c4ae59c
commit a8af73be87
2 changed files with 45 additions and 19 deletions

View File

@ -1,24 +1,29 @@
api_key_env: CROWDIN_API_KEY api_key_env: CROWDIN_API_KEY
project_identifier: rancher-ui project_identifier: rancher-ui
base_path: /source base_path: /translations
preserve_hierarchy: false preserve_hierarchy: false
files: files:
- source: "/translations/en-us.yaml" - source: en-us.yaml
dest: "/ui.yaml" dest: /ui.yaml
translation: "/translations/%locale%.yaml" translation: '%locale%.yaml'
ignore: type: yaml
- "*.md" update_option: update_as_unapproved
type: yaml languages_mapping:
update_option: update_as_unapproved locale:
languages_mapping: de-DE: de-de
locale: en-US: en-us
de-DE: de-de es-ES: es-es
en-US: en-us fa-IR: fa-ir
fa-IR: fa-ir fr-FR: fr-fr
fr-FR: fr-fr it-IT: it-it
ja-JP: ja-jp ja-JP: ja-jp
pt-BR: pt-br hu-HU: hu-hu
ru-RU: u-ru ko-KR: ko-kr
uk-UA: uk-ua nb-NO: nb-no
zh-CN: zh-hans nl-NL: nl-nl
pt-BR: pt-br
ru-RU: ru-ru
sv-SE: sv-se
zh-CN: zh-hans
zh-TW: zh-hant

21
scripts/update-translations Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -e
# cd to app root
CWD=$(dirname $0)
if [[ `basename $(pwd)` = 'scripts' ]]; then
cd ../
else
cd `dirname $CWD`
fi
if [[ ! "${CROWDIN_API_KEY}" ]]; then
echo Please setup CROWDIN_API_KEY
exit 1
fi
docker run -e CROWDIN_API_KEY \
-e PROJECT_IDENTIFIER=rancher-ui \
-v $(pwd)/translations:/translations \
-v $(pwd)/crowdin.yml:/opt/translations/crowdin.yml \
loganhz/crowdin-tool:v0.0.1 \