Opened 18 years ago

Closed 18 years ago

#3947 closed (duplicate)

Localized labels don't work with newforms

Reported by: anonymous Owned by: Adrian Holovaty
Component: Forms Version: dev
Severity: Keywords: newforms, unicode
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have this form.

from django import newforms as forms
from django.utils.translation import gettext_lazy as _

LANGUAGES = (
    ('cs', _('Czech')),
    ('en', _('English')),
)

class ChangeProfileForm(forms.Form):
    language = forms.ChoiceField(label=_('Language'), choices=LANGUAGES)
    email = forms.EmailField(label=_('Email'))
    phone = forms.CharField(label=_('Phone'))

If localized labels are in UTF-8 and I don't use attached patch, forms don't work (UnicodeDecodeError).

Attachments (1)

newforms-unicode.diff (1.9 KB ) - added by anonymous 18 years ago.

Download all attachments as: .zip

Change History (2)

by anonymous, 18 years ago

Attachment: newforms-unicode.diff added

comment:1 by Malcolm Tredinnick, 18 years ago

Resolution: duplicate
Status: newclosed

This is the same underlying problem as #3924. I'm working on it now.

Note: See TracTickets for help on using tickets.
Back to Top