bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xgettext and init scripts [was: maint.mk: sc_po_check misses out on tran


From: Eric Blake
Subject: xgettext and init scripts [was: maint.mk: sc_po_check misses out on translated shell scripts]
Date: Tue, 04 Jan 2011 17:32:20 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

[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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]