Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two-factor strings #12448

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
24 changes: 13 additions & 11 deletions weblate/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ 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. Pick something else.")
comradekingu marked this conversation as resolved.
Show resolved Hide resolved
)

return super().clean(value)
Expand Down Expand Up @@ -197,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 @@ -230,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 @@ -421,7 +421,7 @@ class ContactForm(forms.Form):
label=gettext_lazy("Message"),
required=True,
help_text=gettext_lazy(
"Please contact us in English, otherwise we might "
"Please contact us in English. Otherwise we might "
"be unable to process your request."
orangesunny marked this conversation as resolved.
Show resolved Hide resolved
),
max_length=2000,
Expand All @@ -437,7 +437,7 @@ class EmailForm(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("En e-mail with a confirmation link will be sent here."),
comradekingu marked this conversation as resolved.
Show resolved Hide resolved
)


Expand All @@ -464,7 +464,7 @@ def clean(self):
ngettext(
(
"Too many failed registration attempts from this location. "
"Please try again in %d minute."
"Please try again in one minute."
Copy link
Contributor Author

@comradekingu comradekingu Sep 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was GTK for whatever reason this isn't allowed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this fails:

>>> ngettext('one apple', '%d apples', 1) % 1
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: not all arguments converted during string formatting

comradekingu marked this conversation as resolved.
Show resolved Hide resolved
),
(
"Too many failed registration attempts from this location. "
Expand Down Expand Up @@ -586,7 +586,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 @@ -642,7 +642,7 @@ def clean(self):
ngettext(
(
"Too many authentication attempts from this location. "
"Please try again in %d minute."
"Please try again in one minute."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...same here.

nijel marked this conversation as resolved.
Show resolved Hide resolved
),
(
"Too many authentication attempts from this location. "
Expand Down Expand Up @@ -916,7 +916,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 @@ -975,7 +977,7 @@ class TOTPDeviceForm(forms.Form):
)

error_messages = {
"invalid_token": gettext_lazy("Entered token is not valid."),
"invalid_token": gettext_lazy("The entered token is wrong."),
comradekingu marked this conversation as resolved.
Show resolved Hide resolved
}

def __init__(self, key, user, metadata=None, **kwargs):
Expand Down Expand Up @@ -1045,7 +1047,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 token can be used just once. Mark your token as used after having using it."
comradekingu marked this conversation as resolved.
Show resolved Hide resolved
),
)
device_class: type[Device] = StaticDevice
Expand Down
20 changes: 10 additions & 10 deletions weblate/templates/accounts/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ <h4 class="panel-title">
<div class="col-sm-4">
<h5>{% trans "Security keys (WebAuthn)" %}</h5>
{% if not webauthn_keys %}
<p><em>{% trans "There are currently no WebAuthn keys registered." %}</em></p>
<p><em>{% trans "No WebAuthn keys registered yet." %}</em></p>
{% else %}
<ul class="list-group">
{% for key in webauthn_keys %}
Expand All @@ -217,7 +217,7 @@ <h5>{% trans "Security keys (WebAuthn)" %}</h5>
</template>

<template id="passkey-registration-unavailable-template">
<p>{% trans "Unfortunately, your browser has no WebAuthn support." %}</p>
<p>{% trans "Your web browser lacks WebAuthn support." %}</p>
</template>

<span id="passkey-registration-placeholder"></span>
Expand All @@ -227,7 +227,7 @@ <h5>{% trans "Security keys (WebAuthn)" %}</h5>
<div class="col-sm-4">
<h5>{% trans "Authenticator apps (TOTP)" %}</h5>
{% if not totp_keys %}
<p><em>{% trans "There are currently no authenticator apps registered." %}</em></p>
<p><em>{% trans "No authenticator apps registered yet." %}</em></p>
{% else %}
<ul class="list-group">
{% for key in totp_keys %}
Expand All @@ -244,14 +244,14 @@ <h5>{% trans "Authenticator apps (TOTP)" %}</h5>
<div class="col-sm-4">
<h5>{% trans "Recovery codes" %}</h5>
{% if recovery_keys_count == 0 %}
<p><em>{% trans "There are currently no recovery codes generated." %}</em></p>
<p><em>{% trans "No recovery codes generated yet." %}</em></p>
<a href="" data-href="{% url "recovery-codes" %}" class="btn btn-primary link-post">{% trans "Generate new recovery codes" %}</a>
{% else %}
<p>
{% blocktranslate count count=recovery_keys_count trimmed %}
{{ count }} recovery code is available.
{{ count }} recovery code available.
{% plural %}
{{ count }} recovery codes are available.
{{ count }} recovery codes available.
{% endblocktranslate %}
</p>
<a href="{% url "recovery-codes" %}" class="btn btn-primary">{% trans "View recovery codes" %}</a>
Expand Down Expand Up @@ -300,7 +300,7 @@ <h5>{% trans "Recovery codes" %}</h5>
<div class="panel-body">
{% crispy profileform %}
<p class="help-block">
{% blocktrans %}All of the fields on this page are optional and can be deleted at any time, and by filling them out, you're giving us consent to share this data wherever your user profile appears.{% endblocktrans %}
{% blocktrans %}All fields on this page are optional and can be deleted at any time. By filling them out, you are consent to their use wherever your user profile appears.{% endblocktrans %}
comradekingu marked this conversation as resolved.
Show resolved Hide resolved
</p>
</div>
<div class="panel-footer">
Expand Down Expand Up @@ -390,7 +390,7 @@ <h5>{% trans "Recovery codes" %}</h5>
<div class="panel panel-default">
<div class="panel-heading"><h4 class="panel-title">{% trans "Description" %}</h4></div>
<div class="panel-body">
<p>{% blocktrans %}Contact us immediately if you see anything suspicious in the audit log.{% endblocktrans %}</p>
<p>{% blocktrans %}Get in contact immediately if you notice anything suspicious in the audit log.{% endblocktrans %}</p>
</div>
</div>

Expand All @@ -414,7 +414,7 @@ <h5>{% trans "Recovery codes" %}</h5>
<td>{{ log.user_agent }}</td>
</tr>
{% empty %}
<tr><td colspan="4">{% trans "No recent activity found!" %}</td></tr>
<tr><td colspan="4">{% trans "No recent activity found." %}</td></tr>
{% endfor %}
</tbody>
</table>
Expand All @@ -430,7 +430,7 @@ <h5>{% trans "Recovery codes" %}</h5>
<div class="panel-heading"><h4 class="panel-title">{% documentation_icon 'api' right=True %}{% trans "API access" %}</h4></div>
<table class="table">
<tr><td colspan="2">
<p>{% blocktrans %}You can control Weblate using the HTTP REST API and your API key is used to authenticate to it.{% endblocktrans %}</p>
<p>{% blocktrans %}You can control Weblate using the HTTP REST API, and your API key is used to authenticate to it.{% endblocktrans %}</p>
comradekingu marked this conversation as resolved.
Show resolved Hide resolved
</td></tr>
<tr>
<th>{% trans "Your personal API key:" %}</th>
Expand Down
Loading