diff --git a/doc/translation.txt b/doc/translation.txt index 67bc4137..8abb3eaa 100644 --- a/doc/translation.txt +++ b/doc/translation.txt @@ -51,14 +51,14 @@ files. Then run the script to scan the source files, and regenerate .pot & .po files. - $ ./scripts/translation-make.sh + $ ./scripts/translation-update.sh This will create new .po files with any new untranslated strings you added to the source code. These .po files can be distributed to translators for translation. After the translated .po file is obtained, overwrite the old .po and run the same script to update the .mo files. - $ ./scripts/translation-make.sh + $ ./scripts/translation-update.sh To add a new language: ====================== diff --git a/openscad.pro b/openscad.pro index f1b6d144..5fdcab29 100644 --- a/openscad.pro +++ b/openscad.pro @@ -486,6 +486,9 @@ isEmpty(PREFIX):PREFIX = /usr/local target.path = $$PREFIX/bin/ INSTALLS += target +# Run translation update scripts as last step after linking the target +QMAKE_POST_LINK += $$PWD/scripts/translation-make.sh + # Create install targets for the languages defined in LINGUAS LINGUAS = $$cat(locale/LINGUAS) LOCALE_PREFIX = $$PREFIX/share/openscad/locale diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 381504c0..f9faf8a6 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -280,6 +280,10 @@ if [[ $? != 0 ]]; then exit 1 fi +echo "Updating language files..." + +cd $OPENSCADDIR +./scripts/translation-update.sh echo "Building test suite..." diff --git a/scripts/translation-make.sh b/scripts/translation-make.sh index 95dcfb4e..89ebd91e 100755 --- a/scripts/translation-make.sh +++ b/scripts/translation-make.sh @@ -3,19 +3,13 @@ # Script for use from qmake to generate the translation # related files. # -# Step 1) call generate-potfiles.sh to collect input files -# Step 2) call translation-update.sh to generate *.mo files -# SCRIPTDIR="`dirname \"$0\"`" TOPDIR="`dirname \"$SCRIPTDIR\"`" -cd "$TOPDIR" +cd "$TOPDIR" || exit 1 -echo "Generating POTFILES..." -./scripts/generate-potfiles.sh > locale/POTFILES - -echo "Updating translation files..." -./scripts/translation-update.sh +echo "Compiling language files..." +./scripts/translation-update.sh updatemo echo "Done." diff --git a/scripts/translation-update.sh b/scripts/translation-update.sh index 1cb5ec38..11a30bc4 100755 --- a/scripts/translation-update.sh +++ b/scripts/translation-update.sh @@ -71,9 +71,16 @@ GETTEXT_PATH="" # GETTEXT_PATH="$OPENSCAD_LIBRARIES/bin/" #fi +SCRIPTDIR="`dirname \"$0\"`" +TOPDIR="`dirname \"$SCRIPTDIR\"`" + +cd "$TOPDIR" || exit 1 + if [ "x$1" = xupdatemo ]; then updatemo else + echo "Generating POTFILES..." + ./scripts/generate-potfiles.sh > locale/POTFILES updatepot && updatepo && updatemo fi