[xliff-tools] Another question on PO and XLIFF

Karl Eichwalder ke at suse.de
Wed May 4 07:04:25 PDT 2005


Asgeir Frimannsson <asgeirf at redhat.com> writes:


> /* xgettext:no-wrap */
> printf( _("\
> this is a very long long line with more than 80 characters\n\
> this is another line\n" ) );
>
> becomes
> msgid ""
> "this is a very long long line with more than 80 characters\n"
> "this is another line\n"
>
> instead of 
> msgid ""
> "this is a very long long line with more "
> "than 80 characters\n" 
> "this is another line\n"

I always thought, no-wrap in .c source files signals line-breaks which
are to be kept; thus such a no-wrap is mostly meant as a translator
comment (of course, xgettext must respect it as well).  Both your .po
file fragments are equivalent.

The confusion arises because the command line tools offer a switch with
the same name (--no-wrap) and this switch works as you explained it.

That's how things look to me and I hope, it is clear what I want to say
;)

> From the manual (describing no-wrap): "Do not break long message lines. 
> Message lines whose width exceeds the output page width will not be split 
> into several lines."

That's the --no-wrap switch--the other no-wrap usage does not seem to
be documented at all; but it is used here (gettext source code):

#: src/hostname.c:182 src/msgattrib.c:311 src/msgcat.c:263 src/msgcmp.c:140
#: src/msgcomm.c:260 src/msgconv.c:217 src/msgen.c:203 src/msgexec.c:177
#: src/msgfilter.c:270 src/msgfmt.c:361 src/msggrep.c:314 src/msginit.c:266
#: src/msgmerge.c:297 src/msgunfmt.c:246 src/msguniq.c:239 src/urlget.c:134
#: src/xgettext.c:498
#, c-format, no-wrap
msgid ""
"Copyright (C) %s Free Software Foundation, Inc.\n"
"This is free software; see the source for copying conditions.  There is NO\n"
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"

I just wanted to point out that besides c-format another flag exists
that should be honored somehow.  Especially, if you convert .xml to .po,
you should add the "no-wrap" flag if appropriate.  Of course, it is not
that important if you .xml straight to the .xliff format.

-- 
Key fingerprint = B2A3 AF2F CFC8 40B1 67EA  475A 5903 A21B 06EB 882E


More information about the xliff-tools mailing list