summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-01-30 21:29:39 +0100
committerClaude Paroz <claude@2xlibre.net>2013-01-30 21:44:14 +0100
commitfc8efc2d9e693923d3da272e0978e5b0631006f9 (patch)
tree2edf1ff53f257a48afab6f2956f4f0d7c26ae1fc /django/forms
parentc8c7cdc8f8f81b2f162db7acc8faaef0ece3b6ae (diff)
Fixed #19034 -- Added proper i18n pluralization for max/min length validation messages
This was made possible by commit 3f1a0c0040b9. Thanks Evil Clay for the report and Alexey Boriskin his work on the ticket.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/fields.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py
index 9fbbce107c..c547d1456c 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -28,7 +28,7 @@ from django.utils import formats
from django.utils.encoding import smart_text, force_str, force_text
from django.utils.ipv6 import clean_ipv6_address
from django.utils import six
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _, ungettext_lazy
# Provide this import for backwards compatibility.
from django.core.validators import EMPTY_VALUES
@@ -505,7 +505,10 @@ class FileField(Field):
'invalid': _("No file was submitted. Check the encoding type on the form."),
'missing': _("No file was submitted."),
'empty': _("The submitted file is empty."),
- 'max_length': _('Ensure this filename has at most %(max)d characters (it has %(length)d).'),
+ 'max_length': ungettext_lazy(
+ 'Ensure this filename has at most %(max)d character (it has %(length)d).',
+ 'Ensure this filename has at most %(max)d characters (it has %(length)d).',
+ 'max'),
'contradiction': _('Please either submit a file or check the clear checkbox, not both.')
}