-
Notifications
You must be signed in to change notification settings - Fork 1
/
update_translations.sh
executable file
·31 lines (25 loc) · 1.39 KB
/
update_translations.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# This script assumes that you have an account which can access Unix Launcher translations on https://translate.pokemmo.com/api/
# After acquiring said account, do `export TL_APIKEY=YOURAPIKEY` in your environment prior to running this script
if [[ -z $TL_APIKEY ]]; then
echo "TL_APIKEY env variable is unset. Can not access translate.pokemmo.com"
exit 1
fi
cd src/main/resources/
TL_LANGCODE=""
OUTPUT_FILENAME=""
for lang in zh fr de it ja ko ptbr es fil; do
case $lang in
zh) OUTPUT_FILENAME=MessagesBundle_zh.properties ; TL_LANGCODE=zh_Hans ;;
fr) OUTPUT_FILENAME=MessagesBundle_fr.properties ; TL_LANGCODE=fr ;;
de) OUTPUT_FILENAME=MessagesBundle_de.properties ; TL_LANGCODE=de ;;
it) OUTPUT_FILENAME=MessagesBundle_it.properties ; TL_LANGCODE=it ;;
ja) OUTPUT_FILENAME=MessagesBundle_ja.properties ; TL_LANGCODE=ja ;;
ko) OUTPUT_FILENAME=MessagesBundle_ko.properties ; TL_LANGCODE=ko ;;
ptbr) OUTPUT_FILENAME=MessagesBundle_pt_BR.properties ; TL_LANGCODE=pt_BR ;;
es) OUTPUT_FILENAME=MessagesBundle_es.properties ; TL_LANGCODE=es ;;
fil) OUTPUT_FILENAME=MessagesBundle_fil.properties ; TL_LANGCODE=fil ;;
esac
curl -H "Authorization: Token $TL_APIKEY" https://translate.pokemmo.com/api/translations/client/unix-installer/$TL_LANGCODE/file/ -o $OUTPUT_FILENAME
done
opencc -i MessagesBundle_zh.properties -o MessagesBundle_zh_TW.properties -c /usr/share/opencc/s2twp.json