Ticket #3882: localflavor_br_en_messages.diff
File localflavor_br_en_messages.diff, 3.3 KB (added by , 18 years ago) |
---|
-
django/contrib/localflavor/br/forms.py
15 15 def __init__(self, *args, **kwargs): 16 16 super(BRZipCodeField, self).__init__(r'^\d{5}-\d{3}$', 17 17 max_length=None, min_length=None, 18 error_message= u'Informe um código postal no formato XXXXX-XXX.',18 error_message=gettext(u'Enter a zip code in the format XXXXX-XXX.'), 19 19 *args, **kwargs) 20 20 21 21 class BRPhoneNumberField(Field): … … 27 27 m = phone_digits_re.search(value) 28 28 if m: 29 29 return u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3)) 30 raise ValidationError( u'Números de telefone devem estar no formato XX-XXXX-XXXX.')30 raise ValidationError(gettext(u'Phone numbers must be in XX-XXXX-XXXX format.')) 31 31 32 32 class BRStateSelect(Select): 33 33 """ -
tests/regressiontests/forms/localflavor.py
734 734 >>> f.clean('12345_123') 735 735 Traceback (most recent call last): 736 736 ... 737 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']737 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 738 738 >>> f.clean('1234-123') 739 739 Traceback (most recent call last): 740 740 ... 741 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']741 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 742 742 >>> f.clean('abcde-abc') 743 743 Traceback (most recent call last): 744 744 ... 745 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']745 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 746 746 >>> f.clean('12345-') 747 747 Traceback (most recent call last): 748 748 ... 749 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']749 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 750 750 >>> f.clean('-123') 751 751 Traceback (most recent call last): 752 752 ... 753 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']753 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 754 754 >>> f.clean('') 755 755 Traceback (most recent call last): 756 756 ... … … 768 768 >>> f.clean('-123') 769 769 Traceback (most recent call last): 770 770 ... 771 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']771 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 772 772 >>> f.clean('12345-') 773 773 Traceback (most recent call last): 774 774 ... 775 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']775 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 776 776 >>> f.clean('abcde-abc') 777 777 Traceback (most recent call last): 778 778 ... 779 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']779 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 780 780 >>> f.clean('1234-123') 781 781 Traceback (most recent call last): 782 782 ... 783 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']783 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 784 784 >>> f.clean('12345_123') 785 785 Traceback (most recent call last): 786 786 ... 787 ValidationError: [u' Informe um c\xf3digo postal no formatoXXXXX-XXX.']787 ValidationError: [u'Enter a zip code in the format XXXXX-XXX.'] 788 788 >>> f.clean('12345-123') 789 789 u'12345-123' 790 790