From b8eee39e7873c888f0335bf0af6c4011550499a8 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 14 Jul 2007 13:39:41 +0000 Subject: [PATCH] Fixed a problem with translatable strings from [5686]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5695 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/newforms/fields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/newforms/fields.py b/django/newforms/fields.py index c18de0f35b..58b46ce2b8 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -113,9 +113,9 @@ class CharField(Field): value = smart_unicode(value) value_length = len(value) if self.max_length is not None and value_length > self.max_length: - raise ValidationError(ugettext(u'Ensure this value has at most %d characters (it has %d).') % (self.max_length, value_length)) + raise ValidationError(ugettext(u'Ensure this value has at most %(max)d characters (it has %(length)d).') % {'max': self.max_length, 'length': value_length}) if self.min_length is not None and value_length < self.min_length: - raise ValidationError(ugettext(u'Ensure this value has at least %d characters (it has %d).') % (self.min_length, value_length)) + raise ValidationError(ugettext(u'Ensure this value has at least %(min)d characters (it has %(length)d).') % {'min': self.min_length, 'length': value_length}) return value def widget_attrs(self, widget):