Re: Translation problem in newforms

2007-04-12 Thread ann
if you have no hosting,I suggest you apply for a free forum. http://www.forumgogo.comMore powerful than the phpbb Trait: 100% free and no pop-ups. Unlimited Bandwidth, Unlimited Storage, Unlimited users, unlimited threads, unlimited topics.Fast, Friendly Tech Support.You have total control

Re: Translation problem in newforms

2007-04-12 Thread [EMAIL PROTECTED]
So basically, it's like the difference between range() and xrange(). Thanks Niels, that helped a lot. On Apr 12, 3:42 pm, "Niels" <[EMAIL PROTECTED]> wrote: > Your understanding is basically correct. Gettext_lazy returns an > object that will be stored inside the form class definition. The >

Re: Translation problem in newforms

2007-04-12 Thread Niels
Your understanding is basically correct. Gettext_lazy returns an object that will be stored inside the form class definition. The actual translation then occurs when that object is evaluated as a string. And there is quite some magic going on behind the scenes: >>> from django.utils.translation

Re: Translation problem in newforms

2007-04-12 Thread [EMAIL PROTECTED]
That worked, thanks very much. I'm not quite clear on the difference between gettext and gettext_lazy however. As I understand it, gettext will translate the string when the Python file is loaded (imported) and gettext_lazy will translate the string when the template is rendered. Is that it?

Re: Translation problem in newforms

2007-04-12 Thread Niels
Hi. I think you need the to add following import statement after importing newforms as well: from django.utils.translation import gettext_lazy as _ On Apr 12, 5:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have the following form: > > from django import newforms as forms > > class

Translation problem in newforms

2007-04-12 Thread [EMAIL PROTECTED]
I have the following form: from django import newforms as forms class ContactForm(forms.Form): to = forms.ChoiceField(label=_('To'), choices=CONTACTS) sender = forms.EmailField(label=_('Email')) subject = forms.CharField(label=_('Subject'), max_length=50) message =