[PATCH 1 of 2] Add a new --log (or -l) option to bisect

Martin Geisler mg at daimi.au.dk
Wed Nov 12 01:28:31 CST 2008

Bernhard Leiner <mailinglists.bleiner at gmail.com> writes:

Hi Bernhard,

I have some comments on the i18n stuff, not for you in particular.

> +            for l in repo.opener("bisect.state"):
> +                ui.write(_("%s" % l))

Please do not use the _ function here -- there is nothing to
translate. And remember to always translate the *format string*, not
the *result* of the formatting.

So mark stuff as

  _("%d changesets") % n

and not

  _("%d changesets" % n)

The second form wont be extracted (put into the .pot file) since the
argument for _ is not a literal string. Even if it did, it wouldn't
work at runtime since the _ function would see different strings all
the time ("7 changesets", "2 changesets", ...) and wouldn't be able to
find translations for them all.

Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.

More information about the Mercurial-devel mailing list