android-calculatorpp/crowdin.sh

80 lines
2.0 KiB
Bash
Raw Permalink 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}"
2015-02-28 15:05:10 -05:00
if [ ! -d "android-app/misc/res/description" ]; then
# if directory doesn't exist create it
mkdir "android-app/misc/res/description"
fi
from="translations/$1/description.txt"
to="android-app/misc/res/description/description-${1}.txt"
if [ -z "${2}" ]; then
to="android-app/misc/res/description/description.txt"
fi
copyTranslation "${from}" "${to}"
2014-09-08 12:40:57 -04:00
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"
2016-02-16 09:22:34 -05:00
copyTranslations "pt-BR" "pt-rBR"
copyTranslations "pt-PT" "pt-rPT"
2014-09-08 12:40:57 -04:00
copyTranslations "ru" "ru"
2015-06-20 15:11:50 -04:00
copyTranslations "tr" "tr"
2014-09-08 12:40:57 -04:00
copyTranslations "vi" "vi"
copyTranslations "uk" "uk"
copyTranslations "ja" "ja"
2016-02-16 09:22:34 -05:00
copyTranslations "zh-CN" "zh-rCN"
copyTranslations "zh-TW" "zh-rTW"
2013-09-20 14:01:40 -04:00
rm -r translations