[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xgettext: Extracting comment blocks from YCP files
From: |
Bruno Haible |
Subject: |
Re: xgettext: Extracting comment blocks from YCP files |
Date: |
Tue, 12 Jun 2007 03:02:11 +0200 |
User-agent: |
KMail/1.5.4 |
Karl Eichwalder wrote:
> xgettext --version
> xgettext (GNU gettext-tools) 0.16
>
> Extracting comment blocks from YCP files does not work if the function
> body is longer than one line:
>
> echo '// Translators: limit to 2x 50 chars
> string nccc_top = _(
> "xxx"
> );' \
> | xgettext --language=YCP --add-comments=Translators --omit-header -o - -
> #: standard input:3
> msgid "xxx"
> msgstr ""
The fact that inserting a newline between "xxx" and ) causes xgettext to
lose the comment is a bug. As a workaround, put a comment on this line,
after the "xxx".
The fact that inserting a newline between _( and "xxx" causes xgettext to
lose the comment is not a bug. Some heuristic is needed to determine which
comment "belongs" to the string. The heuristic is that a non-empty line
without comments is a "separator line". Comments are combined, as long as
no "separator line" interrupts the flow of comments. As a workaround, put
a comment on this line, after the _(.
So this works:
// Translators: limit to 2x 50 chars
string nccc_top = _( //
"xxx" //
);
Thanks for reporting this. I'll align the heuristics for the various language
extractors and document it.
Bruno