[Top][All Lists]

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

[bug-gettext] xgettext shell extraction

From: David Adam
Subject: [bug-gettext] xgettext shell extraction
Date: Fri, 21 Nov 2014 22:56:05 +0800 (AWST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

This command:
  xgettext -LShell -o - input.sh
on this file input.sh:
  oddpos gettext "string bar"
  evenpos foo gettext "string foo"
  #: input.sh:2
  msgid "string foo"
  msgstr ""
(and nothing else).

That is, keywords are only acted upon if in an even (one-indexed) 
position. Is this a bug? Is keyword extraction even supposed to work on 
anything except the first part of the command? The source for 
gettext-0.19.3 suggests it is according to the comments on read_command() 
in gettext-tools/src/x-sh.c, but I appreciate it is something of an edge 

The context for this comes from the fact that the a program I am 
contributing to has a command that takes a string as an argument like this:
  complete -c ls -s l --description "Long"

The string passed as the description argument is translated by the 
complete program, rather than requiring shell scripts to call gettext 
themselves. The build process uses `xgettext -LShell -k--description` to 
extract these messages for translation, but it only works if there are the 
right number of other arguments before the keyword `--description`.

I'm not sure whether this is the right use of xgettext, but it got 
introduced back in 2007 in our codebase.

David Adam

reply via email to

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