Update translation file generator scripts.

master
Torsten Paul 2014-12-04 23:20:25 +01:00
parent 2316a42759
commit 80f1a31143
5 changed files with 19 additions and 11 deletions

View File

@ -51,14 +51,14 @@ files.
Then run the script to scan the source files, and regenerate .pot & .po 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 This will create new .po files with any new untranslated strings you
added to the source code. These .po files can be distributed to added to the source code. These .po files can be distributed to
translators for translation. After the translated .po file is obtained, translators for translation. After the translated .po file is obtained,
overwrite the old .po and run the same script to update the .mo files. 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: To add a new language:
====================== ======================

View File

@ -486,6 +486,9 @@ isEmpty(PREFIX):PREFIX = /usr/local
target.path = $$PREFIX/bin/ target.path = $$PREFIX/bin/
INSTALLS += target 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 # Create install targets for the languages defined in LINGUAS
LINGUAS = $$cat(locale/LINGUAS) LINGUAS = $$cat(locale/LINGUAS)
LOCALE_PREFIX = $$PREFIX/share/openscad/locale LOCALE_PREFIX = $$PREFIX/share/openscad/locale

View File

@ -280,6 +280,10 @@ if [[ $? != 0 ]]; then
exit 1 exit 1
fi fi
echo "Updating language files..."
cd $OPENSCADDIR
./scripts/translation-update.sh
echo "Building test suite..." echo "Building test suite..."

View File

@ -3,19 +3,13 @@
# Script for use from qmake to generate the translation # Script for use from qmake to generate the translation
# related files. # 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\"`" SCRIPTDIR="`dirname \"$0\"`"
TOPDIR="`dirname \"$SCRIPTDIR\"`" TOPDIR="`dirname \"$SCRIPTDIR\"`"
cd "$TOPDIR" cd "$TOPDIR" || exit 1
echo "Generating POTFILES..." echo "Compiling language files..."
./scripts/generate-potfiles.sh > locale/POTFILES ./scripts/translation-update.sh updatemo
echo "Updating translation files..."
./scripts/translation-update.sh
echo "Done." echo "Done."

View File

@ -71,9 +71,16 @@ GETTEXT_PATH=""
# GETTEXT_PATH="$OPENSCAD_LIBRARIES/bin/" # GETTEXT_PATH="$OPENSCAD_LIBRARIES/bin/"
#fi #fi
SCRIPTDIR="`dirname \"$0\"`"
TOPDIR="`dirname \"$SCRIPTDIR\"`"
cd "$TOPDIR" || exit 1
if [ "x$1" = xupdatemo ]; then if [ "x$1" = xupdatemo ]; then
updatemo updatemo
else else
echo "Generating POTFILES..."
./scripts/generate-potfiles.sh > locale/POTFILES
updatepot && updatepo && updatemo updatepot && updatepo && updatemo
fi fi