On Wed, 2009-04-29 at 14:46 -0500, Steve Borho wrote:
> On Wed, Apr 29, 2009 at 2:37 PM, Germán Póo-Caamaño <[email protected]> wrote:
> > On Wed, 2009-04-29 at 14:23 -0500, Steve Borho wrote:
> >> On Wed, Apr 29, 2009 at 2:18 PM, Trey Roessig <[email protected]>
> >> wrote:
> >> > On Wed, Apr 29, 2009 at 11:46 AM, Steve Borho <[email protected]> wrote:
> >> >>> + if sumlen and len(lines[0].rstrip()) > sumlen:
> >> >>> + resp = Confirm(_('Commit'), [], self,
> >> >>> + _('The summary line length of %i is
> >> >>> greater than'
> >> >>> + ' %i. Would you like to continue?' %
> >> >>
> >> >> The gettext wrapper _() should only go around the string.
> >> >
> >> > Just to be sure I understand, you'd want to see
> >> >
> >> > _("This is my value: %i") % val
> >> >
> >> > instead of
> >> >
> >> > _("This is my value: %i" % val)
> >> >
> >> > Correct? No problem at all. May I ask why?
> >>
> >> the _() function is doing a string lookup for translation. The only sane
> >> way
> >> to do translations is to perform them before variable substitutions.
> >>
> >> I noticed that one of these slipped by me in a previous patch in your
> >> word wrap function.
> >
> > On the other hand, sometimes is useful add a comment for translators
> > (before the _()). It may give the a clue about what is supposed to be
> > the variable.
> >
> > The way a variable is located in a sentence may be constructed different
> > in a different language (i.e. right-to-left written).
>
> So they can move the variable subst (%s) within the translated string?
Yes. But it is also useful when you are using a short name for some
reason, for instance, 'Rev' as Revision to be used in a column header,
specially when that column is not expected to be too wide.
Usually is used something like:
# Translators: %s is the day of the week.
or:
# Translators: 'Rev' is the column header. It shouldn't have more
than 6 figures.
More critical when the string is something like:
_('%s: %s of %s')
In summary:
1. To let them translate in a way that makes sense in the
target language. Sometimes is obvious, but not always.
2. To avoid the translated version gets unusable.
--
Germán Póo-Caamaño
Concepción - Chile
http://www.calcifer.org/
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop