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?

Vincent.

On Apr 12, 12:44 pm, "Niels" <[EMAIL PROTECTED]> wrote:
> 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 ContactForm(forms.Form):
> >     to      = forms.ChoiceField(label=_('To'), choices=CONTACTS)
> >     sender  = forms.EmailField(label=_('Email'))
> >     subject = forms.CharField(label=_('Subject'), max_length=50)
> >     message = forms.CharField(label=_('Message'),
> > widget=forms.Textarea)
>
> > I made the french translation for the labels, but when I display the
> > form in a template, they always use the language as defined with
> > LANGUAGE_CODE in settings.py.  Changing from 'en' to 'fr' and back
> > again changed the label titles, but using the setlang view, they
> > weren't translated.
>
> > Should that be considered a bug?
>
> > I'm using 0.96


--~--~---------~--~----~------------~-------~--~----~
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