Integrate translations into build process

This commit is contained in:
Aditya Kulkarni
2018-11-27 14:00:37 -08:00
parent bf9ba551ea
commit 3bdd1efc19
12 changed files with 3347 additions and 47 deletions

15
src/scripts/dotranslations.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [ -z $QT_STATIC ]; then
echo "QT_STATIC is not set. Please set it to the base directory of a statically compiled Qt";
exit 1;
fi
rm -f res/*.qm
$QT_STATIC/bin/lrelease zec-qt-wallet.pro
# Then update the qt base translations. First, get all languages
ls res/*.qm | awk -F '[_.]' '{print $4}' | while read -r language ; do
$QT_STATIC/bin/lconvert -o res/zec_$language.qm $QT_STATIC/translations/qtbase_$language.qm res/zec_qt_wallet_$language.qm
mv res/zec_$language.qm res/zec_qt_wallet_$language.qm
done

View File

@@ -34,9 +34,14 @@ rm -f artifacts/macOS-zec-qt-wallet-v$APP_VERSION.dmg
echo "[OK]"
echo -n "Building..............."
echo -n "Configuring............"
# Build
$QT_PATH/bin/qmake zec-qt-wallet.pro CONFIG+=release >/dev/null
QT_STATIC=$QT_STATIC src/scripts/dotranslations.sh >/dev/null
echo "[OK]"
echo -n "Building..............."
make -j4 >/dev/null
echo "[OK]"

View File

@@ -61,6 +61,7 @@ echo "[Building on" `lsb_release -r`"]"
echo -n "Configuring............"
$QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null
#Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file
QT_STATIC=$QT_STATIC src/scripts/dotranslations.sh >/dev/null
echo "[OK]"