Django form and i18n

Posted by madewulf on Stack Overflow See other posts from Stack Overflow or by madewulf
Published on 2010-04-22T21:53:15Z Indexed on 2010/04/22 22:03 UTC
Read the original article Hit count: 265

Filed under:
|
|

I have forms that I want to display in different languages : I used the label parameter to set a parameter, and used ugettext() on the labels :

agreed_tos = forms.BooleanField(label=ugettext('I agree to the terms of service and to the privacy policy.'))

But when I am rendering the form in my template, using

{{form.as_p}}

The labels are not translated. Does somebody have a solution for this problem ?

© Stack Overflow or respective owner

Related posts about django

Related posts about forms