On 4/1/06, Max Ischenko <[EMAIL PROTECTED]> wrote:
>
> > Done at r1030.
>
> Well, it broke some of code that used gettext and did string
> concatentation like this:
>
> return _(u'Today') + ', ' + unicode(dt.strftime('%H:%M'))

We could overload the operators so that if you add to a string it
automatically runs the gettext then. That would seem reasonable and
not surprising.

>
> Changing gettext into plain_gettext helped it. (Note: I added
> plain_gettext to the list of exported symbols by i18n, r1051).
>
> <rant>
> In  general though, I don't think I like increasing amount of magic
> (read: hidden non-obvious behaviour) in TurboGears. It certainly
> cool...when works but PITA when doesn't.
> </rant>

I agree that this is something we need to keep an eye out for. We have
to strike a balance between making the common cases as easy as
possible while still providing straightforward (and obvious) ways to
handle the less-common cases.

I gathered that changing _ to lazy gettext handled the common cases
better, and I don't know that one definition of _ is necessarily
superior to the other beyond that.

To be completely free of magic is to write code in C. But, we
definitely don't want to carry the magic as far as Rails has, for
example.

Kevin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to