Ticket #13000: lazy-translation-not-so-lazy.diff

File lazy-translation-not-so-lazy.diff, 1.4 KB (added by Lorenzo Gil Sanchez, 14 years ago)
  • contrib/auth/forms.py

     
    1313    """
    1414    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
    1515        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
    16         error_message = _("This value must contain only letters, numbers and underscores."))
     16        error_messages = {'invalid': _("This value must contain only letters, numbers and underscores.")})
    1717    password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
    1818    password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput,
    1919        help_text = _("Enter the same password as above, for verification."))
     
    4747class UserChangeForm(forms.ModelForm):
    4848    username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
    4949        help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
    50         error_message = _("This value must contain only letters, numbers and underscores."))
     50        error_messages = {'invalid': _("This value must contain only letters, numbers and underscores.")})
    5151   
    5252    class Meta:
    5353        model = User
Back to Top