Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

newforms-admin: Fixed #6774, #7068 -- Use ugettext_lazy instead of ug…

…ettext in django/contrib/auth/forms.py. Marked a few strings for translation in the forms.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7449 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7b7f4bdee251459760184e879be8faeca719ab01 1 parent 0f5ffbf
Brian Rosner authored

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  django/contrib/auth/forms.py
18  django/contrib/auth/forms.py
@@ -4,7 +4,7 @@
4 4
 from django.template import Context, loader
5 5
 from django.core import validators
6 6
 from django import newforms as forms
7  
-from django.utils.translation import ugettext as _
  7
+from django.utils.translation import ugettext_lazy as _
8 8
 
9 9
 class UserCreationForm(forms.ModelForm):
10 10
     """
@@ -47,8 +47,8 @@ class AuthenticationForm(forms.Form):
47 47
     Base class for authenticating users. Extend this to get a form that accepts
48 48
     username/password logins.
49 49
     """
50  
-    username = forms.CharField(max_length=30)
51  
-    password = forms.CharField(max_length=30, widget=forms.PasswordInput)
  50
+    username = forms.CharField(label=_("Username"), max_length=30)
  51
+    password = forms.CharField(label=_("Password"), max_length=30, widget=forms.PasswordInput)
52 52
     
53 53
     def __init__(self, request=None, *args, **kwargs):
54 54
         """
@@ -88,7 +88,7 @@ def get_user(self):
88 88
         return self.user_cache
89 89
 
90 90
 class PasswordResetForm(forms.Form):
91  
-    email = forms.EmailField(max_length=40)
  91
+    email = forms.EmailField(label=_("Email"), max_length=40)
92 92
     
93 93
     def clean_email(self):
94 94
         """
@@ -129,9 +129,9 @@ class PasswordChangeForm(forms.Form):
129 129
     """
130 130
     A form that lets a user change his/her password.
131 131
     """
132  
-    old_password = forms.CharField(max_length=30, widget=forms.PasswordInput)
133  
-    new_password1 = forms.CharField(max_length=30, widget=forms.PasswordInput)
134  
-    new_password2 = forms.CharField(max_length=30, widget=forms.PasswordInput)
  132
+    old_password = forms.CharField(label=_("Old password"), max_length=30, widget=forms.PasswordInput)
  133
+    new_password1 = forms.CharField(label=_("New password"), max_length=30, widget=forms.PasswordInput)
  134
+    new_password2 = forms.CharField(label=_("New password confirmation"), max_length=30, widget=forms.PasswordInput)
135 135
     
136 136
     def __init__(self, user, *args, **kwargs):
137 137
         self.user = user
@@ -164,8 +164,8 @@ class AdminPasswordChangeForm(forms.Form):
164 164
     """
165 165
     A form used to change the password of a user in the admin interface.
166 166
     """
167  
-    password1 = forms.CharField(max_length=60, widget=forms.PasswordInput)
168  
-    password2 = forms.CharField(max_length=60, widget=forms.PasswordInput)
  167
+    password1 = forms.CharField(label=_("Password"), max_length=60, widget=forms.PasswordInput)
  168
+    password2 = forms.CharField(label=_("Password (again)"), max_length=60, widget=forms.PasswordInput)
169 169
     
170 170
     def __init__(self, user, *args, **kwargs):
171 171
         self.user = user

0 notes on commit 7b7f4bd

Please sign in to comment.
Something went wrong with that request. Please try again.