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
project_identifier: rancher-ui
base_path: /source
base_path: /translations
preserve_hierarchy: false
files:
- source: "/translations/en-us.yaml"
dest: "/ui.yaml"
translation: "/translations/%locale%.yaml"
ignore:
- "*.md"
type: yaml
update_option: update_as_unapproved
languages_mapping:
locale:
de-DE: de-de
en-US: en-us
fa-IR: fa-ir
fr-FR: fr-fr
ja-JP: ja-jp
pt-BR: pt-br
ru-RU: u-ru
uk-UA: uk-ua
zh-CN: zh-hans
- source: en-us.yaml
dest: /ui.yaml
translation: '%locale%.yaml'
type: yaml
update_option: update_as_unapproved
languages_mapping:
locale:
de-DE: de-de
en-US: en-us
es-ES: es-es
fa-IR: fa-ir
fr-FR: fr-fr
it-IT: it-it
ja-JP: ja-jp
hu-HU: hu-hu
ko-KR: ko-kr
nb-NO: nb-no
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 \