models.py:
BOOL_CHOICES = ((True, _(u'Yes')), (False, _(u'No')))
forms.py:
from models import BOOL_CHOICES
1) does work an translates the choices
form.fields['accomdation'].widget = forms.RadioSelect(choices = ((True, _(u’Yes')), (False, _(u'No'))))
2) does not translate the choices
form.fields['accomdation'].widget = forms.RadioSelect(choices = BOOL_CHOICES)
something similar happens for a label
STATIC = _(u”mystring”)
...label = STATIC does not work
...label = _(STATIC) does work
Is this a bug or a desired behavior or am I missing something?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
> Are you doing: from django.utils.translation import ugettext_lazy as _ ?
> or: from django.utils.translation import ugettext as _ ?
>
> The first one shoud work.
Indeed I used ugettext instead of ugettext_lazy
Thanks!