allow po2po to run on several langs, all by default

This commit is contained in:
Yann Dirson 2004-09-03 09:16:47 +00:00
parent 77809ef7fe
commit 5857299d29

View file

@ -3,21 +3,39 @@ set -e
# copy relevant messages from SRCDOMAIN to DSTDOMAIN, for LANG
if [ $# -lt 2 ]
then
echo "Usage: $0 src-domain dst-domain [lang ...]"
exit 1
fi
SRCDOMAIN=$1
DSTDOMAIN=$2
LANG=$3
shift
shift
# merge the 2 files
msgcat --use-first -F po/$DSTDOMAIN/$LANG.po po/$SRCDOMAIN/$LANG.po >tmp
mv po/$DSTDOMAIN/$LANG.po po/$DSTDOMAIN/$LANG.po.bak
mv tmp po/$DSTDOMAIN/$LANG.po
if [ $# = 0 ]
then
set -- `cat po/LINGUAS`
fi
# sync with DST pot
make -C po DOMAIN=$DSTDOMAIN $LANG.po
tmp=`tempfile`
for LANG in "$@"
do
# merge the 2 files
msgcat --use-first -F po/$DSTDOMAIN/$LANG.po po/$SRCDOMAIN/$LANG.po >$tmp
mv po/$DSTDOMAIN/$LANG.po po/$DSTDOMAIN/$LANG.po.bak
mv $tmp po/$DSTDOMAIN/$LANG.po
# clear those obsolete strings added by SRC, but keep ours if any
msgattrib --no-obsolete po/$DSTDOMAIN/$LANG.po >tmp
msgcat --use-first -F tmp po/$DSTDOMAIN/$LANG.po.bak > po/$DSTDOMAIN/$LANG.po
# sync with DST pot
touch -d '1970-01-02' po/$DSTDOMAIN/$LANG.po
make -C po $DSTDOMAIN/$LANG.po
rm po/stamp-po
make -C po
# clear those obsolete strings added by SRC, but keep ours if any
msgattrib --no-obsolete po/$DSTDOMAIN/$LANG.po >$tmp
msgcat --use-first -F $tmp po/$DSTDOMAIN/$LANG.po.bak > po/$DSTDOMAIN/$LANG.po
rm po/stamp-po
make -C po
done
rm $tmp