android-calculatorpp/crowdin.sh

65 lines
1.6 KiB
Bash
Raw Normal View History

2013-09-20 14:01:40 -04:00
#!/bin/bash
rm -r translations
unzip calculatorpp.zip -d translations
2014-09-08 12:40:57 -04:00
function copyTranslation() {
2013-09-20 14:01:40 -04:00
from=$1
to=$2
2014-09-08 12:40:57 -04:00
cp ${from} ${to}
}
function copyTranslations() {
from="translations/$1/app-android/*"
2015-01-29 10:56:59 -05:00
to="android-app/src/main/res/values-$2"
2014-09-08 12:40:57 -04:00
if [ -z "${2}" ]; then
2015-01-29 10:56:59 -05:00
to="android-app/src/main/res/values"
2014-09-08 12:40:57 -04:00
fi
if [ ! -d ${to} ]; then
2013-09-20 14:01:40 -04:00
# if directory doesn't exist create it
2014-09-08 12:40:57 -04:00
mkdir ${to}
2013-09-20 14:01:40 -04:00
fi
2014-09-08 12:40:57 -04:00
copyTranslation "${from}" "${to}"
from="translations/$1/app/messages.properties"
to="core/src/main/resources/org/solovyev/android/calculator/messages_${1//[-]/_}.properties"
if [ -z "${2}" ]; then
to="core/src/main/resources/org/solovyev/android/calculator/messages.properties"
fi
copyTranslation "${from}" "${to}"
from="translations/$1/jscl/messages.properties"
to="../../jscl/src/main/resources/jscl/text/msg/messages_${1//[-]/_}.properties"
if [ -z "${2}" ]; then
to="../../jscl/src/main/resources/jscl/text/msg/messages.properties"
fi
copyTranslation "${from}" "${to}"
2013-09-20 14:01:40 -04:00
}
2014-09-08 12:40:57 -04:00
copyTranslations "ar" "ar"
copyTranslations "cs" "cs"
copyTranslations "en" ""
copyTranslations "es-ES" "es"
copyTranslations "de" "de"
copyTranslations "fi" "fi"
copyTranslations "fr" "fr"
copyTranslations "it" "it"
copyTranslations "nl" "nl"
copyTranslations "pl" "pl"
copyTranslations "pt-BR" "pt-rbr"
copyTranslations "pt-PT" "pt-rpt"
2014-09-08 12:40:57 -04:00
copyTranslations "ru" "ru"
copyTranslations "vi" "vi"
copyTranslations "uk" "uk"
copyTranslations "ja" "ja"
copyTranslations "zh-CN" "zh-rcn"
copyTranslations "zh-TW" "zh-rtw"
2013-09-20 14:01:40 -04:00
rm -r translations