r1996: Cope slightly better with invalid filenames in various places (reported by
[rox-filer.git] / ROX-Filer / src / po / make-mo
blob0a5027dbd35d5ff839b13f50823951c862a9855e
1 #!/bin/sh
3 # Set to 'yes' if you want UTF-8 strings, then run 'dist'.
4 utf=yes
6 if [ $# = 1 ]; then
7 OUT=../../Messages/$1.gmo
9 if [ "$utf" = "yes" ]; then
10 # This code converts to UTF-8 format. Needed by Gtk+-2.0 at
11 # least, and may help with other versions.
12 charset=`grep "charset=" $1.po | head -1 |\
13 sed 's/^.*charset=\(.*\)\\\n.*/\1/'`
14 echo Using charset \'$charset\'
15 iconv -f $charset -t utf-8 $1.po | sed 's/; charset=\(.*\)\\n"/; charset=utf-8\\n"/' | msgfmt - -o $OUT &&
16 echo Created file $OUT OK
17 else
18 # This does not convert to UTF-8. Use this to get the old
19 # behaviour. Gtk+-1.2.6 at least can't handle UTF-8 :-(
20 msgfmt $1.po -o $OUT && echo Created file $OUT OK
22 exit 0
25 cat << HERE
26 Usage: 'make-mo <LANG>'
27 Eg: 'make-mo fr'
28 to compile the French translation, fr.po, ready for use.
29 HERE