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:
Malcolm Tredinnick 2007-04-03 03:13:21 +00:00
parent 9107ab6e1d
commit 44ba9aa674
2 changed files with 12 additions and 12 deletions

View File

@ -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 @@ class BRPhoneNumberField(Field):
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 File

@ -734,23 +734,23 @@ u'12345-123'
>>> 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 @@ u''
>>> 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'