Added weslang script to simplify translations updates

This commit is contained in:
Mark Michelsen 2004-05-22 11:35:39 +00:00
parent 05bce9abe6
commit 6bf4fdcc76

51
utils/weslang Executable file
View file

@ -0,0 +1,51 @@
#!/bin/sh
if [ "$2" == "" ]; then
cat << EOF
WesLang v0.1 - Automatic language cfg updater/creator script
---------------------------------Mark-Michelsen-/-Skovbaer--
Usage: weslang [make/update] [language name e.g. danish] ([v])
make - Creates a new basic cfg ready for translation
update - Updates an existing cfg, adding untranslated strings
v - Verbose compiling of tools
Note: Please be patient as the script builds the translations tools ;)
Note2: Remember to run this script from topdir (e.g. /usr/games/wesnoth) !
EOF
exit 0;
fi
if [ "$1" != "make" -a "$1" != "update" ]; then
cat << EOF
You have to choose either 'make' or 'update'!
Run WesLang with no parameters to see an explanation.
EOF
exit 0;
fi
echo Compiling tools...
if [ "$3" == "v" ]; then
./autogen.sh
./configure --prefix=/usr --enable-tools
cd src/tools
make
else
./autogen.sh > /dev/null
./configure --prefix=/usr --enable-tools > /dev/null
cd src/tools > /dev/null
make > /dev/null
fi
cd ../..
if [ "$1" == "make" ]; then
echo Creating data/translations/$2.cfg
src/tools/make_translation > data/translations/$2.cfg
else
echo Adding new strings to data/translations/$2.cfg
src/tools/make_translation > weslang.tmp
src/tools/merge_translations data/translations/$2.cfg weslang.tmp > $2.cfg
rm -f weslang.tmp
mv -f $2.cfg data/translations
fi
echo Cleaning up...
make distclean > /dev/null
echo Done.