Ticket #2816: auth-form-i18n.diff

File auth-form-i18n.diff, 1.4 KB (added by Ramiro Morales, 18 years ago)
  • contrib/auth/forms.py

    old new  
    44from django.template import Context, loader
    55from django.core import validators
    66from django import forms
     7#from django.utils.translation import _
    78
    89class UserCreationForm(forms.Manipulator):
    910    "A form that creates a user, with no privileges, from the given username and password."
     
    1314                validator_list=[validators.isAlphaNumeric, self.isValidUsername]),
    1415            forms.PasswordField(field_name='password1', length=30, maxlength=60, is_required=True),
    1516            forms.PasswordField(field_name='password2', length=30, maxlength=60, is_required=True,
    16                 validator_list=[validators.AlwaysMatchesOtherField('password1', "The two password fields didn't match.")]),
     17                validator_list=[validators.AlwaysMatchesOtherField('password1', _("The two password fields didn't match."))]),
    1718        )
    1819
    1920    def isValidUsername(self, field_data, all_data):
     
    2122            User.objects.get(username=field_data)
    2223        except User.DoesNotExist:
    2324            return
    24         raise validators.ValidationError, 'A user with that username already exists.'
     25        raise validators.ValidationError, _("A user with that username already exists.")
    2526
    2627    def save(self, new_data):
    2728        "Creates the user."
Back to Top