[adding bug-gnu-gettext]

On 01/04/2011 02:45 PM, Eric Blake wrote:
> For that matter, merely adding the shell script file to po/POTFILES.in
> is not getting anything picked up into the pot file.  I wonder if I have
> to somehow teach xgettext to use --language=Shell for that one file.  In
> fact, how _does_ one concatenate input strings from multiple languages
> into a single .pot file?  Does it require multiple xgettext runs, one
> per language?  And if that is the case, how do I represent that in the
> autotooled build rules, such as po/Makevars.in?

Laurent Léonard forced me to look harder[1], and made me realize I was
overlooking a warning from xgettext:

/usr/bin/xgettext: warning: file `tools/libvirt-guests.init.in'
extension `init' is unknown; will try C

But this makes me think this is a weakness of xgettext worth fixing in
the next version of the gettext package.

Since .init is a common ending for init scripts, and xgettext is already
obviously smart enough to strip secondary .in suffixes when looking at
suffixes for language determination, should xgettext be taught to
recognize .init in addition to .sh as an extension indicative of shell
rather than C?  Similarly, could xgettext be taught to recognize
emacs-style mode lines at the header of a file, such as
 -*-sh-mode-*-
as indicative of shell, regardless of file suffix?

Meanwhile, Laurent has confirmed that I can use the hack of naming the
file libvirt-guests.init.sh instead of .in, as a workaround to let
xgettext auto-language determination kick in for the file in
isolation[2].  I'm hoping that with that hack, I can also get xgettext
on multiple files to allow mixed-language input and still get the right
output, alleviating my original concern about how to massage the
autotools input to add appropriate -L flags to xgettext.

[1] https://www.redhat.com/archives/libvir-list/2011-January/msg00103.html
[2] https://www.redhat.com/archives/libvir-list/2011-January/msg00104.html

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to