Code

Ticket #3882: localflavor_br_en_messages.diff

File localflavor_br_en_messages.diff, 3.3 KB (added by Wiliam Alves de Souza <wiliamsouza83@…>, 7 years ago)
Line 
1Index: django/contrib/localflavor/br/forms.py
2===================================================================
3--- django/contrib/localflavor/br/forms.py      (revision 4906)
4+++ django/contrib/localflavor/br/forms.py      (working copy)
5@@ -15,7 +15,7 @@
6     def __init__(self, *args, **kwargs):
7         super(BRZipCodeField, self).__init__(r'^\d{5}-\d{3}$',
8             max_length=None, min_length=None,
9-            error_message=u'Informe um código postal no formato XXXXX-XXX.',
10+            error_message=gettext(u'Enter a zip code in the format XXXXX-XXX.'),
11             *args, **kwargs)
12 
13 class BRPhoneNumberField(Field):
14@@ -27,7 +27,7 @@
15         m = phone_digits_re.search(value)
16         if m:
17             return u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3))
18-        raise ValidationError(u'Números de telefone devem estar no formato XX-XXXX-XXXX.')
19+        raise ValidationError(gettext(u'Phone numbers must be in XX-XXXX-XXXX format.'))
20 
21 class BRStateSelect(Select):
22     """
23Index: tests/regressiontests/forms/localflavor.py
24===================================================================
25--- tests/regressiontests/forms/localflavor.py  (revision 4906)
26+++ tests/regressiontests/forms/localflavor.py  (working copy)
27@@ -734,23 +734,23 @@
28 >>> f.clean('12345_123')
29 Traceback (most recent call last):
30 ...
31-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
32+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
33 >>> f.clean('1234-123')
34 Traceback (most recent call last):
35 ...
36-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
37+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
38 >>> f.clean('abcde-abc')
39 Traceback (most recent call last):
40 ...
41-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
42+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
43 >>> f.clean('12345-')
44 Traceback (most recent call last):
45 ...
46-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
47+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
48 >>> f.clean('-123')
49 Traceback (most recent call last):
50 ...
51-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
52+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
53 >>> f.clean('')
54 Traceback (most recent call last):
55 ...
56@@ -768,23 +768,23 @@
57 >>> f.clean('-123')
58 Traceback (most recent call last):
59 ...
60-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
61+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
62 >>> f.clean('12345-')
63 Traceback (most recent call last):
64 ...
65-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
66+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
67 >>> f.clean('abcde-abc')
68 Traceback (most recent call last):
69 ...
70-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
71+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
72 >>> f.clean('1234-123')
73 Traceback (most recent call last):
74 ...
75-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
76+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
77 >>> f.clean('12345_123')
78 Traceback (most recent call last):
79 ...
80-ValidationError: [u'Informe um c\xf3digo postal no formato XXXXX-XXX.']
81+ValidationError: [u'Enter a zip code in the format XXXXX-XXX.']
82 >>> f.clean('12345-123')
83 u'12345-123'
84