[Buildd-tools-devel] [Fwd: Re: Please translate schroot]
Roger Leigh
rleigh at whinlatter.ukfsn.org
Tue Jul 18 23:24:56 UTC 2006
Denis Barbier <barbier at linuxfr.org> writes:
> On Tue, Jul 18, 2006 at 11:45:39PM +0100, Roger Leigh wrote:
>> > On Tue, Jul 18, 2006 at 03:47:57PM +0200, Luk Claes wrote:
>> > [...]
>> >> #: dchroot/dchroot-chroot-config.cc:125
>> >> #, boost-format
>> >> msgid "%1% chroot (dchroot compatibility)"
>> >> msgstr ""
>> >>
>> >> #: dchroot/dchroot-main-base.cc:60 schroot/schroot-main.cc:53
>> >> #, boost-format
>> >> msgid "schroot configuration generated by %1% %2% on %3%"
>> >> msgstr ""
>> >
>> > could you please add comments to explain what these %N% constructs
>> > are for?
>>
>> > Adding the requested comments is a matter of adding the comments in the
>> > source code one line above the translatable string...
>>
>> %n% is a C++ boost::format format string. This is indicated by the
>> "boost-format" line added by xgettext to the potfile (note "--boost"
>> in XGETTEXT_OPTIONS in po/Makevars). This is the same as a C printf
>> format string specifier, but is type-safe and indicates only the
>> position of the numbered argument.
>>
>> It would be used like this:
>>
>> std::cout
>> << boost::format(_("Format string: %1% and %2%")) % arg1 % arg2
>> << std::endl
>>
>> In a translation, the %n% should be preserved verbatim, just like for
>> a %x C printf format string specifier.
>>
>> This is a new feature of xgettext in gettext 0.15 (not yet released).
>
> Sorry I was unclear, your explanations are valuable, but my point was
> that a message like
> msgid "schroot configuration generated by %1% %2% on %3%"
> can hardly be translated if there is no comments telling what strings
> will be substituted to these numbered arguments. Something like
> #. %1% = configuration file
> #. %2% = host name
> #. %3% = date
> msgid "schroot configuration generated by %1% %2% on %3%"
> would help a lot, and do not hesitate to write more accurate comments ;)
> As said by Luk, those comments have to be written just above this string
> in the source file, and xgettext will extract them automatically.
I will do so. Thanks for explaining!
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please sign and encrypt your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20060719/35d5bbab/attachment.pgp
More information about the Buildd-tools-devel
mailing list