Debian Codegraph @

utils/update_localizations.sh

raw
1 #!/bin/sh
2 LOCALE_BASE_PATH="locale"
3 cd ../
4 echo -n "Extracting translatable strings... "
5 xgettext glade/*.ui -o ./messages.pot
6 find ./ -iname "*.py" -exec xgettext -k_ -j -o ./messages.pot {} \;
7 echo "OK"
8
9 for LANGUAGE in `ls -l $LOCALE_BASE_PATH | awk {'print $9'}`; do
10 echo -n "Creating new $LANGUAGE po file... "
11 msginit --no-translator -i ./messages.pot -l $LANGUAGE -o ./locale/$LANGUAGE/LC_MESSAGES/pytrainer_$LANGUAGE.po_new
12 echo -n "Merging with old po file... "
13 cd ./$LOCALE_BASE_PATH/$LANGUAGE/LC_MESSAGES/
14 msgmerge -q pytrainer_$LANGUAGE.po pytrainer_$LANGUAGE.po_new > pytrainer_$LANGUAGE.po.tmp
15 echo "OK"
16 mv pytrainer_$LANGUAGE.po.tmp pytrainer_$LANGUAGE.po
17 rm pytrainer_$LANGUAGE.po_new
18 echo -n "Statistics for $LANGUAGE: "
19 msgfmt --statistics pytrainer_$LANGUAGE.po -o ./pytrainer.mo
20 cd ../../../
21 done