I'm trying to pass a translated string to a select box using a Forms
Select widget and it always presents the output string with all the
accent HTML entity codes.

In my models file, I have a range of subjects:

Models.py
from django.utils import translation
from django.utils.translation import ugettext_lazy as _

SUBJECT = (
    (10, _('Log-in or Account related problems')),
    (20, _('General enquiry')),
    (30, _('Other feedback')),
)

This is used in a form:

class HelpFeedbackForm(forms.Form):
        #form for user to submit their feedback when not logged in
                subject = forms.CharField(widget=forms.Select(choices=SUBJECT))

and presented in the template as:

{{ form.subject }}

The translations are returned from the django.po file, but all of the
HTML entity codes are returned as is in the Select box as shown below.
If also tried using the safe template filter tag but to no avail.

"Problemas para el Inicio de Sesión o relacionados con la
Cuenta"


I'm sure I'm doing something silly, but having tried a number of
options, I need a fresh viewpoint. Could anyone suggest how I might
overcome the problem?

Thanks,

Tim









I may be doing something silly, but I can't find the solution
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to