annotate intl/generate_mo.sh @ 6:3021deef1599

Encoding related fixes * chomp encoding string * reformat else (seems someone hacked it in) * debug print encoding * do not use :utf8 binmode ("re-encode") on written file if the input is _already_ UTF-8
author Peter Gervai <grin@grin.hu>
date Thu, 16 Oct 2008 00:02:14 +0200
parents a84c32f131df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
1 #!/bin/sh
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
2
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
3 set -o errexit
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
4
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
5 if [ x$1 = x ] ; then
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
6 LG=fr
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
7 else
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
8 LG=`basename $1 .po`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
9 fi
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
10
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
11 cd `dirname $0`
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
12
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
13 echo "generation of gui-$LG.mo from gui-$LG.po... "
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
14 xgettext --keyword="_" --keyword="translate" --language=Perl \
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
15 --from-code=iso-8859-1 ../bins-edit-gui
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
16 #xpot --keyword="_" --keyword="translate" ../bins >messages.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
17 touch gui-$LG.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
18 mv gui-$LG.po gui-$LG.po.old
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
19 msgmerge gui-$LG.po.old messages.po >gui-$LG.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
20 msgfmt -o gui-$LG.mo gui-$LG.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
21 mv messages.po bins-edit-gui.pot
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
22
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
23 echo "generation of $LG.mo from $LG.po... "
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
24 xgettext --keyword="_" --keyword="translate" --language=Perl \
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
25 --from-code=iso-8859-1 ../bins
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
26 #xpot --keyword="_" --keyword="translate" ../bins >messages.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
27 touch $LG.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
28 mv $LG.po $LG.po.old
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
29 msgmerge $LG.po.old messages.po >$LG.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
30 msgfmt -o $LG.mo $LG.po
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
31 mv messages.po bins.pot
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
32
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
33 echo
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
34 echo "Now Copy the $LG.mo file to"\
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
35 "/usr/local/share/locale/$LG/LC_MESSAGES/bins.mo"
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
36
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
37 echo
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
38 echo "Now Copy the gui-$LG.mo file to"\
a84c32f131df Import vendor version
Peter Gervai <grin@grin.hu>
parents:
diff changeset
39 "/usr/local/share/locale/$LG/LC_MESSAGES/bins-edit-gui.mo"