diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-03-03 11:30:21 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-03-03 11:30:21 +0100 |
commit | cfe6a40c84f7d718f64c26dd3b856a220e9e5892 (patch) | |
tree | 4fc1693081166a681dfe54c5add9f20169259cab /main/misc/fetchtranslations.sh | |
parent | 469134cdc7459cf6dbfaf599a4bc81886935425e (diff) |
Fix fetch translation script
--HG--
rename : misc/fetchtranslations.sh => main/misc/fetchtranslations.sh
extra : rebase_source : df6d71479fe6541654d06fcff14fe63a09670352
Diffstat (limited to 'main/misc/fetchtranslations.sh')
-rwxr-xr-x | main/misc/fetchtranslations.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/main/misc/fetchtranslations.sh b/main/misc/fetchtranslations.sh new file mode 100755 index 00000000..86e3d5dc --- /dev/null +++ b/main/misc/fetchtranslations.sh @@ -0,0 +1,38 @@ +#! /bin/sh + + +if [ "$ICSCROWDAPIKEY" != "" ] +then + echo "Generating new translation archives" + fetch -q -1 -o - http://api.crowdin.net/api/project/ics-openvpn/export?key=$ICSCROWDAPIKEY +fi + +echo "Fetch translation archive" +fetch -q http://crowdin.net/download/project/ics-openvpn.zip + +langtoinclude="ca cs de es et fr id it ja ko no nl pl ro ru sv tr uk" + +for lang in $langtoinclude +do + tar xfv ics-openvpn.zip src/main/res/values-$lang/ +done + +# Chinese language require zh-CN and zh-TW + +for lang in zh-CN zh-TW id +do + if [ $lang = "zh-CN" ] ; then + rlang="zh-rCN" + elif [ $lang = "zh-TW" ] ; then + rlang="zh-rTW" + elif [ $lang = "id" ] ; then + rlang="id" + fi + + echo "Fetch archive for $lang" + fetch http://crowdin.net/download/project/ics-openvpn/$lang.zip + tar -xv -C src/main/res/values-$rlang/ --strip-components 3 -f $lang.zip + rm $lang.zip +done + +rm -v ics-openvpn.zip |