On Thu, 2007-05-10 at 14:52 +0200, Sandro Dentella wrote:
> 
> 
> Thanks a lot for your answer that explained what I was underevaluating.
> 
> My example was not the real one and while trying to strip it as simple as
> possible I missed to say that I used 'smart_unicode' to get unicode
> object... and smart_unicode changed in r4904 to "respect deferred
> evaluation".

Unfortunately, it wasn't changed in a particularly correct fashion (I
can say that safely, since I was the idiot who made the change). It
still doesn't work properly. That's one of the things we are fixing in
the Unicode branch.

> In my real view I was using gettext, not gettext_lazy but the model has
> defined help_text as gettext_lazy so that I have it as a __proxy__ object.
> 
> I resorted to use for this particular case the old version of smart_unicode,
> could I have done something smarter?

This has a potential problem in that when smart_unicode() is called,
your string is translated at that moment. So if you define your form
well ahead of time and then, when the form is being converted to a
template, the locale setting is different from when you defined the
form, the translation will be in the wrong language.

This isn't fixable in trunk. After spending almost three days chasing
problems trying to fix that in a "simple" way, I ended up starting the
unicode branch because it requires a more holistic change. Ultimately,
getting gettext_lazy() to work with things like smart_unicode() is
probably going to require a bit of a redesign of gettext_lazy(), I
suspect.

For now, all I can say is get by with what you have working for now and
very shortly we will have unicode conversion finished and you can use
that.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to