[Buildd-tools-devel] [Fwd: Re: Please translate schroot]

Denis Barbier barbier at linuxfr.org
Tue Jul 18 23:17:50 UTC 2006


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.
Thanks

Denis



More information about the Buildd-tools-devel mailing list