[PATCH 08 of 18] add function to move phase boundaries forward

Matt Mackall mpm at selenic.com
Thu Oct 13 13:17:35 CDT 2011


On Thu, 2011-10-13 at 12:28 +0200, Martin Geisler wrote:
> timeless <timeless at gmail.com> writes:
> 
> 
> > On 10/10/11, pierre-yves.david at logilab.fr <pierre-yves.david at logilab.fr> wrote:
> >> +    if not phase.isdigit() or int(phase) not in phases.allphases:
> >> +        raise util.Abort(_('unknown phase: %s' % phase),
> >> +                         hint=_('use one of: %r' % phases.allphases))
> 
> > I believe _("x %s" % variable) is relatively l10n unfriendly
> 
> Yes, it's wrong and should be
> 
>   _("x %s") % variable

We can probably make a decent check-code check for this. Something like:

r'_\([^)] % ' ->  '_("x" % y) should be _("x") % y'


(Aside: Python could have supported i18n directly in the syntax and
avoided these issues like this:

i'this string is localizable: %s' % var 

)

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list