Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #3882 -- Changed error messages in Brazilian localflavor to be in

English. Thanks, Wiliam Alves de Souza.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 44ba9aa6747de919b71a603b9b971927a00eb585 1 parent 9107ab6
@malcolmt malcolmt authored
View
4 django/contrib/localflavor/br/forms.py
@@ -15,7 +15,7 @@ class BRZipCodeField(RegexField):
def __init__(self, *args, **kwargs):
super(BRZipCodeField, self).__init__(r'^\d{5}-\d{3}$',
max_length=None, min_length=None,
- error_message=u'Informe um código postal no formato XXXXX-XXX.',
+ error_message=gettext(u'Enter a zip code in the format XXXXX-XXX.'),
*args, **kwargs)
class BRPhoneNumberField(Field):
@@ -27,7 +27,7 @@ def clean(self, value):
m = phone_digits_re.search(value)
if m:
return u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3))
- raise ValidationError(u'Números de telefone devem estar no formato XX-XXXX-XXXX.')
+ raise ValidationError(gettext(u'Phone numbers must be in XX-XXXX-XXXX format.'))
class BRStateSelect(Select):
"""
View
20 tests/regressiontests/forms/localflavor.py
@@ -734,23 +734,23 @@
>>> f.clean('12345_123')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('1234-123')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('abcde-abc')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('12345-')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('-123')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('')
Traceback (most recent call last):
...
@@ -768,23 +768,23 @@
>>> f.clean('-123')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('12345-')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('abcde-abc')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('1234-123')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('12345_123')
Traceback (most recent call last):
...
-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
>>> f.clean('12345-123')
u'12345-123'
Please sign in to comment.
Something went wrong with that request. Please try again.