Hey Michael,
On Tue, 2007-04-17 at 10:31 +0200, Michael Radziej wrote:
> Hi Malcom and you all,
>
> On Tue, Apr 10, Malcolm Tredinnick wrote:
>
> > What I'd really like from you guys (Michael, Ivan, Gábor -- and anybody
> > else who wants to play along) is to see how the code fits in with your
> > existing workflow.
>
> How do the translation functions gettext() (_()) etc. fit in? Currently,
> they produce bytestrings. In case this isn't clear, it leads to problems
> in this context:
>
> return _("blabla %s ä blabla") % u"unicode stuff"
>
> Here, python will try to decode the result of _() with the python
> default charset, i.e. ASCII ... exception guaranteed ;-)
Yeah, this is a problematic area... I've moaned a bit about this before.
To be honest, my gut feeling about this is that the current gettext()
functions are pretty much broken in a unicode string world.
In my idle moments during the day, I keep trying to think of ways to
moderate this opinion a bit and make them work with little changes,
however, I think it's pretty hard to do so without breaking the meaning.
I think we're going to have to start using ugettext() and friends
(ugettext_lazy, ungettext, etc) in a lot of places. I'm not 100% certain
at the moment how many changes will be needed. I'm leaving the i18n bits
for towards the end, since they should fit in seamlessly with the
non-i18n string handling, so I need to get that right first. As usual,
my goal is to try and have minimal impact on existing end-user code, but
I'm not sure yet how successful we'll be in that respect.
What I don't think is the right answer is to suddenly start making
gettext() behave as if it were ugettext() -- using the wrong name for
something will lead to confusion for people who use Django as a tool,
not as a lifestyle choice.
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---