#!/bin/sh

if [ $# = 1 ]; then
	OUT=../../Messages/$1.gmo
	
	# This code converts to UTF-8 format. Needed by Gtk+-2.0.
	charset=`grep "charset=" $1.po | head -1 |\
			sed 's/^.*charset=\(.*\)\\\n.*/\1/'`
	echo Using charset \'$charset\'
	iconv -f $charset -t utf-8 $1.po | msgfmt - -o $OUT &&
			echo Created file $OUT OK
	exit 0
fi

cat << HERE
Usage: 'make-mo <LANG>'
Eg:    'make-mo fr'
	to compile the French translation, fr.po, ready for use.
HERE
