X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gen_locale.sh;h=0869511e078b10aad7b3ff09ba34a910790de429;hb=0ddb713e47f07aee4fd064c7b96bfe79dcebad1f;hp=77c733109748595704caa2006970dfc708065fdf;hpb=e299f0ca47a924516f2afbe4e922f2418b75315c;p=gosa.git diff --git a/gen_locale.sh b/gen_locale.sh index 77c733109..0869511e0 100755 --- a/gen_locale.sh +++ b/gen_locale.sh @@ -22,7 +22,7 @@ for template in $(find -name '*.tpl'); do done for class in $(find -name 'class_*.inc'); do - echo -en "\rConverting .tpl files: $(basename $template) \r" + echo -en "\rConverting class_*.inc files: $(basename $template) \r" sed -e 's/\($pl[DH][^=]*\)= *"\([^"]*\)";$/\1= _("\2");/g' $class > $class.new mv $class.new $class done @@ -40,8 +40,13 @@ echo "Merging po files with existing ones:" error=0 for f in locale/??/LC_MESSAGES; do echo -n "* merging $f/messages.po: " - msgmerge $f/messages.po locale/messages.po --output-file=$f/messages.po.new &> /dev/null - + [ -f $f/messages.po ] && msgmerge $f/messages.po locale/messages.po --output-file=$f/messages.po.new &> /dev/null + + # Do an extra check for dummy dir 'locale/en/LC_MESSAGES' + if [ $? -ne 0 ]; then + [ "$f" == "locale/en/LC_MESSAGES" ] && /bin/true + fi + if [ $? -eq 0 ]; then echo "done"; else @@ -79,7 +84,7 @@ if [ $error -eq 0 ]; then read -p "Do you want to erase the message.po.orig files? (y/n)" -n1 ans if [ "$ans" == "y" -o "$ans" == "Y" ]; then - find $ORIG -type f -name 'messages.po.orig' -exec rm -f {} \; + find $ORIG/ -type f -name 'messages.po.orig' -exec rm -f {} \; fi else @@ -91,9 +96,9 @@ cat << EOF --------------------------------------------------------------------- -Now edit all files that have been replaced above (i.e. using kbabel) -and mail the changes to gosa@oss.gonicus.de to be included in the -next release. +Now edit all files that have been replaced above (i.e. using kbabel +or gtranslator) and mail the changes to gosa@oss.gonicus.de to be +included in the next release. To see the changes you've made in GOsa, run "msgfmt messages.po" on your freshly edited files and restart your apache after that. Set