Commits

James Bennett  committed 36ede9e

Wherever possible, use strings already translated as part of Django itself.

  • Participants
  • Parent commits a12e368

Comments (0)

Files changed (2)

File registration/forms.py

                                 max_length=30,
                                 widget=forms.TextInput(attrs=attrs_dict),
                                 label=_(u'username'),
-                                error_messages={ 'invalid': _(u'This value must contain only letters, numbers and underscores.') })
+                                error_messages={ 'invalid': _("This value must contain only letters, numbers and underscores.")) })
     email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict,
                                                                maxlength=75)),
-                             label=_(u'email address'))
+                             label=_("Email address"))
     password1 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
-                                label=_(u'password'))
+                                label=_("Password"))
     password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
-                                label=_(u'password (again)'))
+                                label=_("Password (again)"))
     
     def clean_username(self):
         """
             user = User.objects.get(username__iexact=self.cleaned_data['username'])
         except User.DoesNotExist:
             return self.cleaned_data['username']
-        raise forms.ValidationError(_(u'This username is already taken. Please choose another.'))
+        raise forms.ValidationError(_("A user with that username already exists."))
 
     def clean(self):
         """
         """
         if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
             if self.cleaned_data['password1'] != self.cleaned_data['password2']:
-                raise forms.ValidationError(_(u'You must type the same password each time'))
+                raise forms.ValidationError(_("The two password fields didn't match."))
         return self.cleaned_data
 
 
     """
     tos = forms.BooleanField(widget=forms.CheckboxInput(attrs=attrs_dict),
                              label=_(u'I have read and agree to the Terms of Service'),
-                             error_messages={ 'required': _(u"You must agree to the terms to register") })
+                             error_messages={ 'required': _("You must agree to the terms to register") })
 
 
 class RegistrationFormUniqueEmail(RegistrationForm):
         
         """
         if User.objects.filter(email__iexact=self.cleaned_data['email']):
-            raise forms.ValidationError(_(u'This email address is already in use. Please supply a different email address.'))
+            raise forms.ValidationError(_("This email address is already in use. Please supply a different email address."))
         return self.cleaned_data['email']
 
 
         """
         email_domain = self.cleaned_data['email'].split('@')[1]
         if email_domain in self.bad_domains:
-            raise forms.ValidationError(_(u'Registration using free email addresses is prohibited. Please supply a different email address.'))
+            raise forms.ValidationError(_("Registration using free email addresses is prohibited. Please supply a different email address."))
         return self.cleaned_data['email']

File registration/locale/en/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-10-09 05:58-0500\n"
+"POT-Creation-Date: 2009-10-12 14:09-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 msgid "Re-send activation emails"
 msgstr ""
 
-#: forms.py:37
+#: forms.py:35
 msgid "username"
 msgstr ""
 
-#: forms.py:38
+#: forms.py:36
 msgid "This value must contain only letters, numbers and underscores."
 msgstr ""
 
+#: forms.py:39
+msgid "Email address"
+msgstr ""
+
 #: forms.py:41
-msgid "email address"
+msgid "Password"
 msgstr ""
 
 #: forms.py:43
-msgid "password"
+msgid "Password (again)"
 msgstr ""
 
-#: forms.py:45
-msgid "password (again)"
+#: forms.py:55
+msgid "A user with that username already exists."
 msgstr ""
 
-#: forms.py:57
-msgid "This username is already taken. Please choose another."
+#: forms.py:67
+msgid "The two password fields didn't match."
 msgstr ""
 
-#: forms.py:69
-msgid "You must type the same password each time"
-msgstr ""
-
-#: forms.py:80
+#: forms.py:78
 msgid "I have read and agree to the Terms of Service"
 msgstr ""
 
-#: forms.py:81
+#: forms.py:79
 msgid "You must agree to the terms to register"
 msgstr ""
 
-#: forms.py:97
+#: forms.py:95
 msgid ""
 "This email address is already in use. Please supply a different email "
 "address."
 msgstr ""
 
-#: forms.py:124
+#: forms.py:122
 msgid ""
 "Registration using free email addresses is prohibited. Please supply a "
 "different email address."
 msgstr ""
 
-#: models.py:166
+#: models.py:165
 msgid "user"
 msgstr ""
 
-#: models.py:167
+#: models.py:166
 msgid "activation key"
 msgstr ""
 
-#: models.py:172
+#: models.py:171
 msgid "registration profile"
 msgstr ""
 
-#: models.py:173
+#: models.py:172
 msgid "registration profiles"
 msgstr ""