On Wed, Aug 29, Jarek Zgoda wrote:

> 
> Kenneth Gonsalves napisał(a):
> 
> >>>>>>> now, this doesnt work - when I remove the _(), then the choices
> >>>>>>> appear. How do I then mark them for translation?
> >>>>>>>
> >>>>>> Make sure to use gettext_lazy
> >>>>> i *am* using: from django.utils.translation import gettext_lazy  
> >>>>> as _
> >>>> Ha! How should we know?
> >>>>
> >>>> Does it help to use ugettext_lazy instead?
> >>> doesnt work - i just marked one string, the marked string didnt
> >>> appear, the other two did.
> >> The next testing option is to try with non-lazy version.
> > 
> > that works! import gettext as _
> 
> And that's a real bug, I think.
> 
> Anyway, for future reference, keep in mind that lazily translated
> "strings" become real strings at access time. Before that they are
> function objects. That is, you cann't, for example, pickle them - and in
> consequence put in session because session data is pickled before
> saving. Laziness isn't always good. ;)

If I haven't mistaken anything, we're talking about the choices setting in
model fields. The models are read in during initialization. But the choices
need to be translated for each request, and for different languages. I don't
see how this could work without lazy translation, and I'd be astonished if
the solution above really worked.

Michael


-- 
noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The IT-Outsourcing Company
 
Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk - 
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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