From: <nc...@us...> - 2011-10-12 09:46:03
|
Revision: 888 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=888&view=rev Author: ncjones Date: 2011-10-12 09:45:57 +0000 (Wed, 12 Oct 2011) Log Message: ----------- Translator script: add option to generate .pot only. Modified Paths: -------------- pytrainer/trunk/utils/translator.sh Modified: pytrainer/trunk/utils/translator.sh =================================================================== --- pytrainer/trunk/utils/translator.sh 2011-10-12 08:34:25 UTC (rev 887) +++ pytrainer/trunk/utils/translator.sh 2011-10-12 09:45:57 UTC (rev 888) @@ -1,9 +1,8 @@ #!/bin/sh -SOFTWARE=$(zenity --list --text="Select your translation software" --radiolist --column "Pick" --column "Software" TRUE "gtranslator" FALSE "kbabel" FALSE "poedit") -if [ $? != 0 ]; then exit ; fi +NO_LANGUAGE='None (generate .pot)' -LANGUAGE=$(zenity --list --text="Select your language" --radiolist --column "Pick" --column "Language" TRUE "es" FALSE "eu" FALSE "ca" FALSE "fr" FALSE "da" FALSE "de" FALSE "pl" FALSE "no" FALSE "cs" FALSE "ru" FALSE "pl" FALSE "sv" FALSE "gl") +LANGUAGE=$(zenity --list --text="Select your language" --radiolist --column "Pick" --column "Language" TRUE "$NO_LANGUAGE" FALSE "es" FALSE "eu" FALSE "ca" FALSE "fr" FALSE "da" FALSE "de" FALSE "pl" FALSE "no" FALSE "cs" FALSE "ru" FALSE "pl" FALSE "sv" FALSE "gl") if [ $? != 0 ]; then exit ; fi cd ../ @@ -14,13 +13,17 @@ find ./ -iname "*.py" -exec xgettext -k_ -j -o ./messages.pot {} \; # Initializing translations for desired language + +if test "$LANGUAGE" = "$NO_LANGUAGE"; then exit; fi msginit -i ./messages.pot -l $LANGUAGE -o ./locale/$LANGUAGE/LC_MESSAGES/pytrainer_$LANGUAGE.po_new -rm ./messages.pot cd ./locale/$LANGUAGE/LC_MESSAGES/ # Merging old po file with the one generated as a result of current script make merge +SOFTWARE=$(zenity --list --text="Select your translation software" --radiolist --column "Pick" --column "Software" TRUE "gtranslator" FALSE "kbabel" FALSE "poedit") +if [ $? != 0 ]; then exit ; fi + # Editing our new gettext catalog (.po file) $SOFTWARE pytrainer_$LANGUAGE.po if [ $? != 0 ]; then echo "WARNING: $SOFTWARE not found"; exit ; fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |