#!/bin/sh
TEMPLATE=pigs.pot
xgettext -kngettext:1,2 -L PHP -o $TEMPLATE pigs.php
if [ x$1 == 'x-p' ]; then
    msgfmt --statistics $TEMPLATE
else
    if [ -f $1.po ]; then
	msgmerge -o .tmp$1.po $1.po $TEMPLATE
	mv .tmp$1.po $1.po
	msgfmt --statistics $1.po
    else
	echo "Usage: $0 [-p|<basename>]"
    fi
fi
