From dc103ad41db4f633993b2da64472313faf8c3aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Hyd=C3=A9n?= Date: Tue, 9 May 2000 21:51:05 +0000 Subject: [PATCH] Added update.sh script --- po/update.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 po/update.sh diff --git a/po/update.sh b/po/update.sh new file mode 100755 index 00000000..3ad571c6 --- /dev/null +++ b/po/update.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +PACKAGE="libgtop" + +if [ "x$1" = "x--help" ]; then + +echo Usage: ./update.sh langcode +echo --help display this help and exit +echo +echo Examples of use: +echo ./update.sh ----- just creates a new pot file from the source +echo ./update.sh da -- created new pot file and updated the da.po file + +elif [ "x$1" = "x" ]; then + +echo "Building the $PACKAGE.pot ..." + +xgettext --default-domain=$PACKAGE --directory=.. \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=./POTFILES.in \ +&& test ! -f $PACKAGE.po \ + || ( rm -f ./$PACKAGE.pot \ +&& mv $PACKAGE.po ./$PACKAGE.pot ); + +else + +xgettext --default-domain=$PACKAGE --directory=.. \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=./POTFILES.in \ +&& test ! -f $PACKAGE.po \ + || ( rm -f ./PACKAGE.pot \ +&& mv $PACKAGE.po ./$PACKAGE.pot ); + +echo "Building the $PACKAGE.pot ..." +echo "Now merging $1.po with $PACKAGE.pot, and creating an updated $1.po ..." + +mv $1.po $1.po.old && msgmerge $1.po.old $PACKAGE.pot -o $1.po \ +&& rm $1.po.old; + +msgfmt --statistics $1.po + +fi;