#!/bin/sh

OUTPUT_CHARSET=$2

if [ "$OUTPUT_CHARSET" = "" ]
then
{
	OUTPUT_CHARSET="ISO-8859-1"
}
fi

echo "Merging $1.po and wordtrans.pot"
msgmerge --output-file=$1.pox $1.po wordtrans.pot

echo "Converting $1.pox (charset:$OUTPUT_CHARSET) to $1.utf8"
iconv -f $OUTPUT_CHARSET -t UTF-8 -o $1.utf8 $1.pox

echo "Creating binary catalog $1.mo from $1.utf8"
msgfmt --statistics --output-file=$1.mo $1.utf8

