summaryrefslogtreecommitdiffstats
path: root/locale
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-08-08 03:18:22 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-08-08 03:18:22 +0000
commit66b7d6f37a2d1dd02968bd06a53e9dfe8cc87871 (patch)
treedd7da3f614ab32fef2cf07e3b5086c171479a110 /locale
parenteb2b8261794cadde0becbcfc50a0049f52dc05f2 (diff)
downloadampache-66b7d6f37a2d1dd02968bd06a53e9dfe8cc87871.tar.gz
ampache-66b7d6f37a2d1dd02968bd06a53e9dfe8cc87871.tar.bz2
ampache-66b7d6f37a2d1dd02968bd06a53e9dfe8cc87871.zip
improved gather shell script (Thx momo-i)
Diffstat (limited to 'locale')
-rwxr-xr-xlocale/base/gather-messages.sh42
1 files changed, 39 insertions, 3 deletions
diff --git a/locale/base/gather-messages.sh b/locale/base/gather-messages.sh
index c2a1a050..060021b2 100755
--- a/locale/base/gather-messages.sh
+++ b/locale/base/gather-messages.sh
@@ -17,8 +17,44 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+SCRIPTS=$0
+MAILADDR="translation@ampache.org"
+OLANG=`echo $LANG | sed 's/\..*//;'`
+POTNAME="messages.pot"
+PODIR="../$OLANG/LC_MESSAGES"
+PONAME="messages.po"
+MONAME="messages.mo"
-find ../../ -name *.php > /tmp/filelist
-find ../../ -name *.inc >> /tmp/filelist
+if [ ! -d $PODIR ]
+then
+ mkdir -p $PODIR
+ echo "$PODIR has created."
+fi
-xgettext -f /tmp/filelist -L PHP -o ./messages.po
+if [ $# = 0 ]; then
+ echo "usage: $SCRIPTS [--help|--get|--init|--merge]"
+ exit
+fi
+
+case $1 in
+ "--get"|"-g"|"get")
+ xgettext --from-code=UTF-8 --msgid-bugs-address=$MAILADDR -L php -o $POTNAME `find ../../ -name \*.php -type f` `find ../../ -name \*.inc -type f`;
+ if [ $? = 0 ]; then
+ echo "pot file creation was done.";
+ else
+ echo "pot file creation wasn't done.";
+ fi
+ ;;
+ "--init"|"-i"|"init")
+ msginit -l $LANG -i $POTNAME -o $PODIR/$PONAME;
+ ;;
+ "--format"|"-f"|"format")
+ msgfmt -v --check $PODIR/$PONAME -o $PODIR/$MONAME;
+ ;;
+ "--merge"|"-m"|"merge")
+ msgmerge --update $PODIR/$PONAME $POTNAME;
+ ;;
+ "--help"|"-h"|"help"|"*")
+ echo "usage: $SCRIPTS [--help|--get|--init|--merge]";
+ ;;
+esac