From 49bb05554c953c0971442258a79cde566878742b Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Mon, 16 Apr 2012 15:17:40 +0200 Subject: [PATCH] qt translation added on mac os --- release.macx.sh | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/release.macx.sh b/release.macx.sh index efa93363..af439109 100755 --- a/release.macx.sh +++ b/release.macx.sh @@ -14,6 +14,7 @@ # along with this program. If not, see . # --------------------------------------------------------------------- + BASE_TROLLTECH_DIRECTORY=/usr/local/Trolltech/Qt-4.7.3 # Executables QMAKE=$BASE_TROLLTECH_DIRECTORY/bin/qmake @@ -28,6 +29,7 @@ LRELEASE=$BASE_TROLLTECH_DIRECTORY/bin/lrelease # Directories BUILD_DIR="build/macx/release" PRODUCT_DIR="$BUILD_DIR/product" +BASE_QT_TRANSLATIONS_DIRECTORY=../Qt-sankore3.1/translations function notify { GROWLNOTIFY=`which growlnotify` @@ -52,6 +54,31 @@ function checkExecutable { fi } +function addQtTranslations { +for eachTranslation in `ls $BASE_QT_TRANSLATIONS_DIRECTORY/qt_??.qm` +do + # looking fo the language code for each qt translation file + languageCode=`echo $eachTranslation | sed 's/.*qt_\(.*\).qm/\1/'` + basicDir=$PRODUCT_DIR/Open-Sankore.app/Contents/Resources/ + for eachDirectory in `ls $basicDir` + do + # looping through the Sankore availables languages + directoryLanguageCode=`echo $eachDirectory | sed 's/\(.*\)\.lproj/\1/'` + if [ ! -z $directoryLanguageCode ]; then + if [[ $eachDirectory == *".lproj"* && $eachDirectory != "empty.lproj" && $directoryLanguageCode == *$languageCode* ]]; then + # sankore translation found for qt translation file + cp $eachTranslation $basicDir/$eachDirectory + if [ $directoryLanguageCode != $languageCode ]; then + # handling fr and fr_CH code. + mv $basicDir/$eachDirectory/qt_$languageCode.qm $basicDir/$eachDirectory/qt_$directoryLanguageCode.qm + fi + fi + fi + done +done + +} + trap "defaults write com.mnemis.Uniboard.release Running -bool NO" EXIT notify "Running Uniboard release script (`date`)" @@ -88,8 +115,14 @@ $QMAKE_CMD notify "Compiling ..." make -j4 release + +notify "Translations ..." $LRELEASE "Sankore_3.1.pro" +addQtTranslations + + +notify "Tagging ..." VERSION=`cat "$BUILD_DIR/version"` if [ ! -f "$BUILD_DIR/version" ]; then echo "version not found" @@ -98,8 +131,8 @@ else LAST_COMMITED_VERSION="`git describe $(git rev-list --tags --max-count=1)`" if [ "v$VERSION" != "$LAST_COMMITED_VERSION" ]; then echo creating a tag with the version $VERSION - git tag -a "v$VERSION" -m "Generated setup for v$VERSION" - git push origin --tags +# git tag -a "v$VERSION" -m "Generated setup for v$VERSION" +# git push origin --tags fi fi