Updated pot generation script to fetch strings from XML too (most of them are not translated in game yet however)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3957 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2009-08-29 21:16:51 +00:00
parent 79c34d17a5
commit b6d0226fe2
2 changed files with 360 additions and 426 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,19 +4,39 @@
CPP_FILE_LIST=`find ./src -name '*.cpp' -print`
PERL_FILE_LIST="`find ./data -name '*.track' -print` `find ./data -name '*.challenge' -print` `find ./data -name '*.grandprix' -print`"
XML_FILE_LIST=`find ./data -name '*.xml' -print`
STKGUI_FILE_LIST=`find ./data -name '*.stkgui' -print`
echo "--------------------"
echo " Source Files :"
echo "--------------------"
echo $CPP_FILE_LIST
echo "--------------------"
echo " Data Files :"
echo "--------------------"
echo $PERL_FILE_LIST
echo "--------------------"
echo " XMl Files :"
echo "--------------------"
echo $XML_FILE_LIST $STKGUI_FILE_LIST
echo "---------------------------"
echo " Generating .pot file..."
# C++ Files
xgettext -d supertuxkart -s --keyword=_ --add-comments="I18N:" -p ./data/po -o supertuxkart.pot $CPP_FILE_LIST
# Lisp files
xgettext -j -L perl -d supertuxkart -s --keyword=_ --add-comments="I18N:" -p ./data/po -o supertuxkart.pot $PERL_FILE_LIST
# XML Files
# (Since xgettext cannot read XML directly, strings are extracted using 'grep' and 'sed' first
grep -ho 'text=\"[^\"]*' $XML_FILE_LIST $STKGUI_FILE_LIST | sed 's/text=\"\(.*\)/_(\"\1\")/' > ./data/po/gui_strings.txt
xgettext -j -L perl -d supertuxkart -s --keyword=_ --add-comments="I18N:" -p ./data/po -o supertuxkart.pot ./data/po/gui_strings.txt
echo " Done"
echo "---------------------------"