[Libguestfs] [PATCH 1/3] po: fix broken message extraction

Pino Toscano ptoscano at redhat.com
Thu Dec 5 17:51:09 UTC 2013


On Thursday 05 December 2013 16:01:59 Richard W.M. Jones wrote:
> This appears to be OK, and the results look sane:
> 
> $ ll po/libguestfs.pot*
> -rw-rw-r--. 1 rjones rjones 180001 Dec  5 15:52 po/libguestfs.pot
> -rw-rw-r--. 1 rjones rjones 178207 Dec  5 15:40 po/libguestfs.pot-backup
> 
> and I also checked the pot file (which is basically impossible) but it
> doesn't look as if messages are being dropped.

You don't really need to manually check the .pot file (even if doing it
is certainly a good thing) to see whether its strings changed. :)
You can do something like the following:

# create an "english translation" of the current pot
$ msgen -o libguestfs_old.po libguestfs.pot
# check it is fully translated (the warning can be ignored, since it is
# about the header which we didn't fill, but we are not interested in
# it anyway)
libguestfs_old.po: warning: Charset "CHARSET" is not a portable encoding name.
                            Message conversion to user's charset might not work.
1353 translated messages.
# edit po/Makefile.am as willing
[...]
# create the new pot
$ rm po/libguestfs.pot && make -C po libguestfs.pot
# update the english translation using the new pot
$ msgmerge -o libguestfs_new.po libguestfs_old.po libguestfs.pot
# check the new translation is still fully translated
libguestfs_new.po: warning: Charset "CHARSET" is not a portable encoding name.
                            Message conversion to user's charset might not work.
1353 translated messages.

(the actual number of messages in the pot could be different, but it is
not relevant for the method, anyway)

-- 
Pino Toscano




More information about the Libguestfs mailing list