Is this a bug? - Translation in error messages django.forms.models._update_errors()

69 views
Skip to first unread message

david_aa

unread,
Apr 3, 2012, 6:33:32 AM4/3/12
to django...@googlegroups.com
First at all, my apologies if this message is off-topic. I'm not sure if this is a bug and I can't find any related ticket in code.djangoproject.com

The problem is the following:

I've defined in my model some fields with the attribute verbose_name marked for translation:

class Item():
    name = models.CharField(max_length=75, verbose_name=_('name'))

When I access to validation errors, the field's name is not translated.

I've found that editing the method _update_errors() in django/forms/models.py the field names are properly translated, here is the diff:

254c254
<                 self._errors.setdefault(k, self.error_class()).extend(v)
---
>                 self._errors.setdefault(_(k), self.error_class()).extend(v)

My question: is this a bug? Shall I report it?

Thanks in advance and excuse my newbie questions.

-- 
David.




david_aa

unread,
Apr 3, 2012, 6:53:00 AM4/3/12
to django...@googlegroups.com
Sorry, my django version: 1.4.0
Reply all
Reply to author
Forward
0 new messages