diff --git a/django/contrib/localflavor/br/forms.py b/django/contrib/localflavor/br/forms.py index d3ca28f0538..8e3285729de 100644 --- a/django/contrib/localflavor/br/forms.py +++ b/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 @@ 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): """ diff --git a/tests/regressiontests/forms/localflavor.py b/tests/regressiontests/forms/localflavor.py index f166a24ef0d..8e3d9dff09a 100644 --- a/tests/regressiontests/forms/localflavor.py +++ b/tests/regressiontests/forms/localflavor.py @@ -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'