Ticket #3600: newforms_translation_fix.patch
File newforms_translation_fix.patch, 1.9 KB (added by , 18 years ago) |
---|
-
fields.py
49 49 # *not* used as a fallback if data isn't given. 50 50 # help_text -- An optional string to use as "help text" for this Field. 51 51 if label is not None: 52 label = smart_unicode(label)52 label = label 53 53 self.required, self.label, self.initial = required, label, initial 54 self.help_text = smart_unicode(help_text or '')54 self.help_text = help_text or '' 55 55 widget = widget or self.widget 56 56 if isinstance(widget, type): 57 57 widget = widget() -
forms.py
8 8 from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput 9 9 from util import flatatt, StrAndUnicode, ErrorDict, ErrorList, ValidationError 10 10 import copy 11 from util import smart_unicode 11 12 12 13 __all__ = ('BaseForm', 'Form') 13 14 … … 123 124 output.append(error_row % bf_errors) 124 125 label = bf.label and bf.label_tag(escape(bf.label + ':')) or '' 125 126 if field.help_text: 126 help_text = help_text_html % field.help_text127 help_text = help_text_html % smart_unicode(field.help_text) 127 128 else: 128 129 help_text = u'' 129 output.append(normal_row % {'errors': bf_errors, 'label': label, 'field': unicode(bf), 'help_text': help_text})130 output.append(normal_row % {'errors': bf_errors, 'label': smart_unicode(label), 'field': unicode(bf), 'help_text': help_text}) 130 131 if top_errors: 131 132 output.insert(0, error_row % top_errors) 132 133 if hidden_fields: # Insert any hidden fields in the last row.