mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
9107ab6e1d
commit
44ba9aa674
|
@ -15,7 +15,7 @@ class BRZipCodeField(RegexField):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(BRZipCodeField, self).__init__(r'^\d{5}-\d{3}$',
|
super(BRZipCodeField, self).__init__(r'^\d{5}-\d{3}$',
|
||||||
max_length=None, min_length=None,
|
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)
|
*args, **kwargs)
|
||||||
|
|
||||||
class BRPhoneNumberField(Field):
|
class BRPhoneNumberField(Field):
|
||||||
|
@ -27,7 +27,7 @@ class BRPhoneNumberField(Field):
|
||||||
m = phone_digits_re.search(value)
|
m = phone_digits_re.search(value)
|
||||||
if m:
|
if m:
|
||||||
return u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3))
|
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):
|
class BRStateSelect(Select):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -734,23 +734,23 @@ u'12345-123'
|
||||||
>>> f.clean('12345_123')
|
>>> f.clean('12345_123')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('1234-123')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('abcde-abc')
|
||||||
Traceback (most recent call last):
|
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-')
|
>>> f.clean('12345-')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('-123')
|
||||||
Traceback (most recent call last):
|
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('')
|
>>> f.clean('')
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
|
@ -768,23 +768,23 @@ u''
|
||||||
>>> f.clean('-123')
|
>>> f.clean('-123')
|
||||||
Traceback (most recent call last):
|
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-')
|
>>> f.clean('12345-')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('abcde-abc')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('1234-123')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('12345_123')
|
||||||
Traceback (most recent call last):
|
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')
|
>>> f.clean('12345-123')
|
||||||
u'12345-123'
|
u'12345-123'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue