From e146e508da283db93cea9fb3d91b78db9e47976f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 18 Jun 2008 13:10:05 +0000 Subject: [PATCH] Fixed #7554 -- Modified contrib.localflavor to make use of ugettext, rather than ugettext. Thanks to msaelices for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7689 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/localflavor/ar/forms.py | 12 ++++++------ django/contrib/localflavor/au/forms.py | 4 ++-- django/contrib/localflavor/br/forms.py | 2 +- django/contrib/localflavor/ca/forms.py | 6 +++--- django/contrib/localflavor/ch/forms.py | 6 +++--- django/contrib/localflavor/cl/forms.py | 8 ++++---- django/contrib/localflavor/de/forms.py | 6 +++--- django/contrib/localflavor/es/forms.py | 2 +- django/contrib/localflavor/fi/forms.py | 6 +++--- django/contrib/localflavor/fr/forms.py | 4 ++-- django/contrib/localflavor/is_/forms.py | 6 +++--- django/contrib/localflavor/it/forms.py | 8 ++++---- django/contrib/localflavor/jp/forms.py | 4 ++-- django/contrib/localflavor/nl/forms.py | 2 +- django/contrib/localflavor/no/forms.py | 6 +++--- django/contrib/localflavor/pe/forms.py | 10 +++++----- django/contrib/localflavor/pl/forms.py | 2 +- django/contrib/localflavor/sk/forms.py | 4 ++-- django/contrib/localflavor/uk/forms.py | 4 ++-- django/contrib/localflavor/uk/uk_regions.py | 2 +- django/contrib/localflavor/us/forms.py | 6 +++--- 21 files changed, 55 insertions(+), 55 deletions(-) diff --git a/django/contrib/localflavor/ar/forms.py b/django/contrib/localflavor/ar/forms.py index b23923b47a7..464399188f1 100644 --- a/django/contrib/localflavor/ar/forms.py +++ b/django/contrib/localflavor/ar/forms.py @@ -6,7 +6,7 @@ AR-specific Form helpers. from django.newforms import ValidationError from django.newforms.fields import RegexField, CharField, Select, EMPTY_VALUES from django.utils.encoding import smart_unicode -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ class ARProvinceSelect(Select): """ @@ -24,7 +24,7 @@ class ARPostalCodeField(RegexField): See http://www.correoargentino.com.ar/consulta_cpa/home.php """ default_error_messages = { - 'invalid': ugettext("Enter a postal code in the format NNNN or ANNNNAAA."), + 'invalid': _("Enter a postal code in the format NNNN or ANNNNAAA."), } def __init__(self, *args, **kwargs): @@ -46,8 +46,8 @@ class ARDNIField(CharField): A field that validates 'Documento Nacional de Identidad' (DNI) numbers. """ default_error_messages = { - 'invalid': ugettext("This field requires only numbers."), - 'max_digits': ugettext("This field requires 7 or 8 digits."), + 'invalid': _("This field requires only numbers."), + 'max_digits': _("This field requires 7 or 8 digits."), } def __init__(self, *args, **kwargs): @@ -76,8 +76,8 @@ class ARCUITField(RegexField): CUIT is of the form XX-XXXXXXXX-V. The last digit is a check digit. """ default_error_messages = { - 'invalid': ugettext('Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'), - 'checksum': ugettext("Invalid CUIT."), + 'invalid': _('Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'), + 'checksum': _("Invalid CUIT."), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/au/forms.py b/django/contrib/localflavor/au/forms.py index ada27b69b93..41d4e04fece 100644 --- a/django/contrib/localflavor/au/forms.py +++ b/django/contrib/localflavor/au/forms.py @@ -5,7 +5,7 @@ Australian-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES from django.newforms.util import smart_unicode -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ import re PHONE_DIGITS_RE = re.compile(r'^(\d{10})$') @@ -13,7 +13,7 @@ PHONE_DIGITS_RE = re.compile(r'^(\d{10})$') class AUPostCodeField(RegexField): """Australian post code field.""" default_error_messages = { - 'invalid': ugettext('Enter a 4 digit post code.'), + 'invalid': _('Enter a 4 digit post code.'), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/br/forms.py b/django/contrib/localflavor/br/forms.py index aa7e3b23fd5..81dcb8228b8 100644 --- a/django/contrib/localflavor/br/forms.py +++ b/django/contrib/localflavor/br/forms.py @@ -6,7 +6,7 @@ BR-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, CharField, Select, EMPTY_VALUES from django.utils.encoding import smart_unicode -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ import re try: diff --git a/django/contrib/localflavor/ca/forms.py b/django/contrib/localflavor/ca/forms.py index b40dba83357..548f85b7f63 100644 --- a/django/contrib/localflavor/ca/forms.py +++ b/django/contrib/localflavor/ca/forms.py @@ -5,7 +5,7 @@ Canada-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES from django.newforms.util import smart_unicode -from django.utils.translation import gettext, ugettext +from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.compile(r'^(?:1-?)?(\d{3})[-\.]?(\d{3})[-\.]?(\d{4})$') @@ -14,7 +14,7 @@ sin_re = re.compile(r"^(\d{3})-(\d{3})-(\d{3})$") class CAPostalCodeField(RegexField): """Canadian postal code field.""" default_error_messages = { - 'invalid': gettext(u'Enter a postal code in the format XXX XXX.'), + 'invalid': _(u'Enter a postal code in the format XXX XXX.'), } def __init__(self, *args, **kwargs): @@ -85,7 +85,7 @@ class CASocialInsuranceNumberField(Field): See: http://en.wikipedia.org/wiki/Social_Insurance_Number """ default_error_messages = { - 'invalid': ugettext('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'), + 'invalid': _('Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format.'), } def clean(self, value): diff --git a/django/contrib/localflavor/ch/forms.py b/django/contrib/localflavor/ch/forms.py index 2158fba6971..e2d3aea9443 100644 --- a/django/contrib/localflavor/ch/forms.py +++ b/django/contrib/localflavor/ch/forms.py @@ -5,7 +5,7 @@ Swiss-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES from django.utils.encoding import smart_unicode -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ import re id_re = re.compile(r"^(?P\w{8})(?P(\d{1}|<))(?P\d{1})$") @@ -13,7 +13,7 @@ phone_digits_re = re.compile(r'^0([1-9]{1})\d{8}$') class CHZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a zip code in the format XXXX.'), + 'invalid': _('Enter a zip code in the format XXXX.'), } def __init__(self, *args, **kwargs): @@ -61,7 +61,7 @@ class CHIdentityCardNumberField(Field): Algorithm is documented at http://adi.kousz.ch/artikel/IDCHE.htm """ default_error_messages = { - 'invalid': ugettext('Enter a valid Swiss identity or passport card number in X1234567<0 or 1234567890 format.'), + 'invalid': _('Enter a valid Swiss identity or passport card number in X1234567<0 or 1234567890 format.'), } def has_valid_checksum(self, number): diff --git a/django/contrib/localflavor/cl/forms.py b/django/contrib/localflavor/cl/forms.py index 2f5ac29b391..69473607a63 100644 --- a/django/contrib/localflavor/cl/forms.py +++ b/django/contrib/localflavor/cl/forms.py @@ -4,7 +4,7 @@ Chile specific form helpers. from django.newforms import ValidationError from django.newforms.fields import RegexField, Select, EMPTY_VALUES -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode @@ -26,9 +26,9 @@ class CLRutField(RegexField): https://palena.sii.cl/cvc/dte/ee_empresas_emisoras.html """ default_error_messages = { - 'invalid': ugettext('Enter a valid Chilean RUT.'), - 'strict': ugettext('Enter a valid Chilean RUT. The format is XX.XXX.XXX-X.'), - 'checksum': ugettext('The Chilean RUT is not valid.'), + 'invalid': _('Enter a valid Chilean RUT.'), + 'strict': _('Enter a valid Chilean RUT. The format is XX.XXX.XXX-X.'), + 'checksum': _('The Chilean RUT is not valid.'), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/de/forms.py b/django/contrib/localflavor/de/forms.py index 76ce215dcac..c5402fa2607 100644 --- a/django/contrib/localflavor/de/forms.py +++ b/django/contrib/localflavor/de/forms.py @@ -4,14 +4,14 @@ DE-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ import re id_re = re.compile(r"^(?P\d{10})(?P\w{1,3})[-\ ]?(?P\d{7})[-\ ]?(?P\d{7})[-\ ]?(?P\d{1})$") class DEZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a zip code in the format XXXXX.'), + 'invalid': _('Enter a zip code in the format XXXXX.'), } def __init__(self, *args, **kwargs): super(DEZipCodeField, self).__init__(r'^\d{5}$', @@ -38,7 +38,7 @@ class DEIdentityCardNumberField(Field): Algorithm is documented at http://de.wikipedia.org/wiki/Personalausweis """ default_error_messages = { - 'invalid': ugettext('Enter a valid German identity card number in XXXXXXXXXXX-XXXXXXX-XXXXXXX-X format.'), + 'invalid': _('Enter a valid German identity card number in XXXXXXXXXXX-XXXXXXX-XXXXXXX-X format.'), } def has_valid_checksum(self, number): diff --git a/django/contrib/localflavor/es/forms.py b/django/contrib/localflavor/es/forms.py index 81186f8b3df..57e730b2cf4 100644 --- a/django/contrib/localflavor/es/forms.py +++ b/django/contrib/localflavor/es/forms.py @@ -5,7 +5,7 @@ Spanish-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import RegexField, Select, EMPTY_VALUES -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ import re class ESPostalCodeField(RegexField): diff --git a/django/contrib/localflavor/fi/forms.py b/django/contrib/localflavor/fi/forms.py index a0274da44c9..e9e0fc1e93f 100644 --- a/django/contrib/localflavor/fi/forms.py +++ b/django/contrib/localflavor/fi/forms.py @@ -5,11 +5,11 @@ FI-specific Form helpers import re from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ class FIZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a zip code in the format XXXXX.'), + 'invalid': _('Enter a zip code in the format XXXXX.'), } def __init__(self, *args, **kwargs): super(FIZipCodeField, self).__init__(r'^\d{5}$', @@ -25,7 +25,7 @@ class FIMunicipalitySelect(Select): class FISocialSecurityNumber(Field): default_error_messages = { - 'invalid': ugettext('Enter a valid Finnish social security number.'), + 'invalid': _('Enter a valid Finnish social security number.'), } def clean(self, value): diff --git a/django/contrib/localflavor/fr/forms.py b/django/contrib/localflavor/fr/forms.py index 635b62edd59..960e8b221c2 100644 --- a/django/contrib/localflavor/fr/forms.py +++ b/django/contrib/localflavor/fr/forms.py @@ -5,14 +5,14 @@ FR-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES from django.utils.encoding import smart_unicode -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.compile(r'^0\d(\s|\.)?(\d{2}(\s|\.)?){3}\d{2}$') class FRZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a zip code in the format XXXXX.'), + 'invalid': _('Enter a zip code in the format XXXXX.'), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/is_/forms.py b/django/contrib/localflavor/is_/forms.py index ea7a1e00c38..9f7b6f02113 100644 --- a/django/contrib/localflavor/is_/forms.py +++ b/django/contrib/localflavor/is_/forms.py @@ -5,7 +5,7 @@ Iceland specific form helpers. from django.newforms import ValidationError from django.newforms.fields import RegexField, EMPTY_VALUES from django.newforms.widgets import Select -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode class ISIdNumberField(RegexField): @@ -14,8 +14,8 @@ class ISIdNumberField(RegexField): of Iceland has. """ default_error_messages = { - 'invalid': ugettext('Enter a valid Icelandic identification number. The format is XXXXXX-XXXX.'), - 'checksum': ugettext(u'The Icelandic identification number is not valid.'), + 'invalid': _('Enter a valid Icelandic identification number. The format is XXXXXX-XXXX.'), + 'checksum': _(u'The Icelandic identification number is not valid.'), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/it/forms.py b/django/contrib/localflavor/it/forms.py index 901c86fafae..7d4a82dd636 100644 --- a/django/contrib/localflavor/it/forms.py +++ b/django/contrib/localflavor/it/forms.py @@ -4,14 +4,14 @@ IT-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode from django.contrib.localflavor.it.util import ssn_check_digit, vat_number_check_digit import re class ITZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a valid zip code.'), + 'invalid': _('Enter a valid zip code.'), } def __init__(self, *args, **kwargs): super(ITZipCodeField, self).__init__(r'^\d{5}$', @@ -40,7 +40,7 @@ class ITSocialSecurityNumberField(RegexField): 'Informazioni sulla codificazione delle persone fisiche'. """ default_error_messages = { - 'invalid': ugettext(u'Enter a valid Social Security number.'), + 'invalid': _(u'Enter a valid Social Security number.'), } def __init__(self, *args, **kwargs): @@ -65,7 +65,7 @@ class ITVatNumberField(Field): A form field that validates Italian VAT numbers (partita IVA). """ default_error_messages = { - 'invalid': ugettext(u'Enter a valid VAT number.'), + 'invalid': _(u'Enter a valid VAT number.'), } def clean(self, value): diff --git a/django/contrib/localflavor/jp/forms.py b/django/contrib/localflavor/jp/forms.py index d726f822d7e..70def85351c 100644 --- a/django/contrib/localflavor/jp/forms.py +++ b/django/contrib/localflavor/jp/forms.py @@ -4,7 +4,7 @@ JP-specific Form helpers from django.core import validators from django.newforms import ValidationError -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ from django.newforms.fields import RegexField, Select class JPPostalCodeField(RegexField): @@ -14,7 +14,7 @@ class JPPostalCodeField(RegexField): Accepts 7 digits, with or without a hyphen. """ default_error_messages = { - 'invalid': ugettext('Enter a postal code in the format XXXXXXX or XXX-XXXX.'), + 'invalid': _('Enter a postal code in the format XXXXXXX or XXX-XXXX.'), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/nl/forms.py b/django/contrib/localflavor/nl/forms.py index 748484926e3..6f9e887339d 100644 --- a/django/contrib/localflavor/nl/forms.py +++ b/django/contrib/localflavor/nl/forms.py @@ -6,7 +6,7 @@ import re from django.newforms import ValidationError from django.newforms.fields import Field, Select, EMPTY_VALUES -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode pc_re = re.compile('^\d{4}[A-Z]{2}$') diff --git a/django/contrib/localflavor/no/forms.py b/django/contrib/localflavor/no/forms.py index 8dc001955dd..39c80ec0b28 100644 --- a/django/contrib/localflavor/no/forms.py +++ b/django/contrib/localflavor/no/forms.py @@ -5,11 +5,11 @@ Norwegian-specific Form helpers import re, datetime from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ class NOZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a zip code in the format XXXX.'), + 'invalid': _('Enter a zip code in the format XXXX.'), } def __init__(self, *args, **kwargs): @@ -30,7 +30,7 @@ class NOSocialSecurityNumber(Field): Algorithm is documented at http://no.wikipedia.org/wiki/Personnummer """ default_error_messages = { - 'invalid': ugettext(u'Enter a valid Norwegian social security number.'), + 'invalid': _(u'Enter a valid Norwegian social security number.'), } def clean(self, value): diff --git a/django/contrib/localflavor/pe/forms.py b/django/contrib/localflavor/pe/forms.py index 57c9d441f7b..328b2e36e12 100644 --- a/django/contrib/localflavor/pe/forms.py +++ b/django/contrib/localflavor/pe/forms.py @@ -5,7 +5,7 @@ PE-specific Form helpers. from django.newforms import ValidationError from django.newforms.fields import RegexField, CharField, Select, EMPTY_VALUES -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ class PEDepartmentSelect(Select): """ @@ -20,8 +20,8 @@ class PEDNIField(CharField): A field that validates `Documento Nacional de IdentidadŽ (DNI) numbers. """ default_error_messages = { - 'invalid': ugettext("This field requires only numbers."), - 'max_digits': ugettext("This field requires 8 digits."), + 'invalid': _("This field requires only numbers."), + 'max_digits': _("This field requires 8 digits."), } def __init__(self, *args, **kwargs): @@ -48,8 +48,8 @@ class PERUCField(RegexField): the form XXXXXXXXXXX. """ default_error_messages = { - 'invalid': ugettext("This field requires only numbers."), - 'max_digits': ugettext("This field requires 11 digits."), + 'invalid': _("This field requires only numbers."), + 'max_digits': _("This field requires 11 digits."), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/pl/forms.py b/django/contrib/localflavor/pl/forms.py index b02dad7025f..32d00cc3a89 100644 --- a/django/contrib/localflavor/pl/forms.py +++ b/django/contrib/localflavor/pl/forms.py @@ -6,7 +6,7 @@ import re from django.newforms import ValidationError from django.newforms.fields import Select, RegexField -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ class PLVoivodeshipSelect(Select): """ diff --git a/django/contrib/localflavor/sk/forms.py b/django/contrib/localflavor/sk/forms.py index 711d70fc2bc..d12927ecab5 100644 --- a/django/contrib/localflavor/sk/forms.py +++ b/django/contrib/localflavor/sk/forms.py @@ -3,7 +3,7 @@ Slovak-specific form helpers """ from django.newforms.fields import Select, RegexField -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ class SKRegionSelect(Select): """ @@ -27,7 +27,7 @@ class SKPostalCodeField(RegexField): Valid form is XXXXX or XXX XX, where X represents integer. """ default_error_messages = { - 'invalid': ugettext(u'Enter a postal code in the format XXXXX or XXX XX.'), + 'invalid': _(u'Enter a postal code in the format XXXXX or XXX XX.'), } def __init__(self, *args, **kwargs): diff --git a/django/contrib/localflavor/uk/forms.py b/django/contrib/localflavor/uk/forms.py index 52cd7ad2325..b3883f64776 100644 --- a/django/contrib/localflavor/uk/forms.py +++ b/django/contrib/localflavor/uk/forms.py @@ -6,7 +6,7 @@ import re from django.newforms.fields import CharField, Select from django.newforms import ValidationError -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ class UKPostcodeField(CharField): """ @@ -18,7 +18,7 @@ class UKPostcodeField(CharField): The value is uppercased and a space added in the correct place, if required. """ default_error_messages = { - 'invalid': ugettext(u'Enter a valid postcode.'), + 'invalid': _(u'Enter a valid postcode.'), } outcode_pattern = '[A-PR-UWYZ]([0-9]{1,2}|([A-HIK-Y][0-9](|[0-9]|[ABEHMNPRVWXY]))|[0-9][A-HJKSTUW])' incode_pattern = '[0-9][ABD-HJLNP-UW-Z]{2}' diff --git a/django/contrib/localflavor/uk/uk_regions.py b/django/contrib/localflavor/uk/uk_regions.py index 61d08124882..dd92f5e7584 100644 --- a/django/contrib/localflavor/uk/uk_regions.py +++ b/django/contrib/localflavor/uk/uk_regions.py @@ -5,7 +5,7 @@ Sources: Welsh regions: http://en.wikipedia.org/wiki/Preserved_counties_of_Wales Scottish regions: http://en.wikipedia.org/wiki/Regions_and_districts_of_Scotland """ -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ ENGLAND_REGION_CHOICES = ( ("Bedfordshire", _("Bedfordshire")), diff --git a/django/contrib/localflavor/us/forms.py b/django/contrib/localflavor/us/forms.py index d6aa684cba6..a17062d61f5 100644 --- a/django/contrib/localflavor/us/forms.py +++ b/django/contrib/localflavor/us/forms.py @@ -5,7 +5,7 @@ USA-specific Form helpers from django.newforms import ValidationError from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES from django.utils.encoding import smart_unicode -from django.utils.translation import ugettext +from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.compile(r'^(?:1-?)?(\d{3})[-\.]?(\d{3})[-\.]?(\d{4})$') @@ -13,7 +13,7 @@ ssn_re = re.compile(r"^(?P\d{3})[-\ ]?(?P\d{2})[-\ ]?(?P\d{ class USZipCodeField(RegexField): default_error_messages = { - 'invalid': ugettext('Enter a zip code in the format XXXXX or XXXXX-XXXX.'), + 'invalid': _('Enter a zip code in the format XXXXX or XXXXX-XXXX.'), } def __init__(self, *args, **kwargs): @@ -51,7 +51,7 @@ class USSocialSecurityNumberField(Field): 1962 promotional number). """ default_error_messages = { - 'invalid': ugettext('Enter a valid U.S. Social Security number in XXX-XX-XXXX format.'), + 'invalid': _('Enter a valid U.S. Social Security number in XXX-XX-XXXX format.'), } def clean(self, value):