Skip to content

Commit

Permalink
fix(auth): improve account form strings
Browse files Browse the repository at this point in the history
  • Loading branch information
comradekingu authored and nijel committed Feb 6, 2025
1 parent b0bc76b commit 05ff7ab
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions weblate/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def clean(self, value):
existing = User.objects.filter(username=value)
if existing.exists() and value != self.valid:
raise forms.ValidationError(
gettext("This username is already taken. Please choose another.")
gettext(
"This username is already taken. Please pick something else."
)
)

return super().clean(value)
Expand Down Expand Up @@ -195,7 +197,7 @@ class CommitForm(ProfileBaseForm):
label=gettext_lazy("Commit e-mail"),
choices=[("", gettext_lazy("Use account e-mail address"))],
help_text=gettext_lazy(
"Used in version control commits. The address will stay in the repository forever once changes are committed by Weblate."
"Used in version-control commits. The address stays in the repository forever once changes are committed by Weblate."
),
required=False,
widget=forms.RadioSelect,
Expand Down Expand Up @@ -228,7 +230,7 @@ class ProfileForm(ProfileBaseForm):

public_email = forms.ChoiceField(
label=gettext_lazy("Public e-mail"),
choices=[("", gettext_lazy("Do not publicly display e-mail address"))],
choices=[("", gettext_lazy("Hide e-mail address from public view"))],
required=False,
)

Expand Down Expand Up @@ -567,8 +569,8 @@ class ContactForm(CaptchaForm):
label=gettext_lazy("Message"),
required=True,
help_text=gettext_lazy(
"Please contact us in English, otherwise we might "
"be unable to process your request."
"Please contact us in English. Otherwise, we might "
"not process your request."
),
max_length=2000,
widget=forms.Textarea,
Expand All @@ -585,7 +587,7 @@ class EmailForm(CaptchaForm, UniqueEmailMixin):

email = EmailField(
label=gettext_lazy("E-mail"),
help_text=gettext_lazy("E-mail with a confirmation link will be sent here."),
help_text=gettext_lazy("An e-mail with a confirmation link will be sent here."),
)

field_order = ["email", "captcha"]
Expand Down Expand Up @@ -679,7 +681,7 @@ def __init__(self, request: AuthenticatedHttpRequest, *args, **kwargs) -> None:
class PasswordConfirmForm(EmptyConfirmForm):
password = PasswordField(
label=gettext_lazy("Current password"),
help_text=gettext_lazy("Leave empty if you have not yet set a password."),
help_text=gettext_lazy("Leave empty if you have not set a password yet."),
required=False,
)

Expand Down Expand Up @@ -1008,7 +1010,9 @@ def clean_sort_by(self):
sort_by = self.cleaned_data.get("sort_by")
if sort_by:
if sort_by not in self.sort_values:
raise forms.ValidationError(gettext("Chosen sorting is not supported."))
raise forms.ValidationError(
gettext("The chosen sorting is not supported.")
)
return sort_by
return None

Expand Down Expand Up @@ -1067,7 +1071,7 @@ class TOTPDeviceForm(forms.Form):
)

error_messages = {
"invalid_token": gettext_lazy("Entered token is not valid."),
"invalid_token": gettext_lazy("The entered token is not valid."),
}

def __init__(self, key, user, metadata=None, **kwargs):
Expand Down Expand Up @@ -1137,7 +1141,7 @@ class OTPTokenForm(DjangoOTPTokenForm):
otp_token = forms.CharField(
label=gettext("Recovery token"),
help_text=gettext(
"Recovery token can be used just once, mark your token as used after using it."
"Recovery codes can only be used once. Remember to mark used ones as expired."
),
)
device_class: type[Device] = StaticDevice
Expand Down

0 comments on commit 05ff7ab

Please sign in to comment.