Convert trans to translate in templates

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
This commit is contained in:
Andrew-Chen-Wang 2021-07-27 01:20:30 -04:00
parent 76f1a2875f
commit 88c487dfbd
16 changed files with 77 additions and 77 deletions

View File

@ -2,11 +2,11 @@
{% load i18n %}
{% block head_title %}{% trans "Account Inactive" %}{% endblock %}
{% block head_title %}{% translate "Account Inactive" %}{% endblock %}
{% block inner %}
<h1>{% trans "Account Inactive" %}</h1>
<h1>{% translate "Account Inactive" %}</h1>
<p>{% trans "This account is inactive." %}</p>
<p>{% translate "This account is inactive." %}</p>
{% endblock %}
{%- endraw %}

View File

@ -4,13 +4,13 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Account" %}{% endblock %}
{% block head_title %}{% translate "Account" %}{% endblock %}
{% block inner %}
<h1>{% trans "E-mail Addresses" %}</h1>
<h1>{% translate "E-mail Addresses" %}</h1>
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
<p>{% translate 'The following e-mail addresses are associated with your account:' %}</p>
<form action="{% url 'account_email' %}" class="email_list" method="post">
{% csrf_token %}
@ -24,36 +24,36 @@
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="verified">{% trans "Verified" %}</span>
<span class="verified">{% translate "Verified" %}</span>
{% else %}
<span class="unverified">{% trans "Unverified" %}</span>
<span class="unverified">{% translate "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
{% if emailaddress.primary %}<span class="primary">{% translate "Primary" %}</span>{% endif %}
</label>
</div>
{% endfor %}
<div class="form-group">
<button class="secondaryAction btn btn-primary" type="submit" name="action_primary" >{% trans 'Make Primary' %}</button>
<button class="secondaryAction btn btn-primary" type="submit" name="action_send" >{% trans 'Re-send Verification' %}</button>
<button class="primaryAction btn btn-primary" type="submit" name="action_remove" >{% trans 'Remove' %}</button>
<button class="secondaryAction btn btn-primary" type="submit" name="action_primary" >{% translate 'Make Primary' %}</button>
<button class="secondaryAction btn btn-primary" type="submit" name="action_send" >{% translate 'Re-send Verification' %}</button>
<button class="primaryAction btn btn-primary" type="submit" name="action_remove" >{% translate 'Remove' %}</button>
</div>
</fieldset>
</form>
{% else %}
<p><strong>{% trans 'Warning:'%}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p>
<p><strong>{% translate 'Warning:'%}</strong> {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<h2>{% translate "Add E-mail Address" %}</h2>
<form method="post" action="{% url 'account_email' %}" class="add_email">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" name="action_add" type="submit">{% trans "Add E-mail" %}</button>
<button class="btn btn-primary" name="action_add" type="submit">{% translate "Add E-mail" %}</button>
</form>
{% endblock %}
@ -63,7 +63,7 @@
{{ block.super }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded',function() {
const message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
const message = "{% translate 'Do you really want to remove the selected e-mail address?' %}";
const actions = document.getElementsByName('action_remove');
if (actions.length) {
actions[0].addEventListener("click", function(e) {

View File

@ -3,28 +3,28 @@
{% load i18n %}
{% load account %}
{% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %}
{% block head_title %}{% translate "Confirm E-mail Address" %}{% endblock %}
{% block inner %}
<h1>{% trans "Confirm E-mail Address" %}</h1>
<h1>{% translate "Confirm E-mail Address" %}</h1>
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}
<p>{% blocktrans with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktrans %}</p>
<p>{% blocktranslate with confirmation.email_address.email as email %}Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.{% endblocktranslate %}</p>
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
{% csrf_token %}
<button class="btn btn-primary" type="submit">{% trans 'Confirm' %}</button>
<button class="btn btn-primary" type="submit">{% translate 'Confirm' %}</button>
</form>
{% else %}
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}This e-mail confirmation link expired or is invalid. Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.{% endblocktranslate %}</p>
{% endif %}

View File

@ -4,18 +4,18 @@
{% load account socialaccount %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Sign In" %}{% endblock %}
{% block head_title %}{% translate "Sign In" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign In" %}</h1>
<h1>{% translate "Sign In" %}</h1>
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
<p>{% blocktrans with site.name as site_name %}Please sign in with one
<p>{% blocktranslate with site.name as site_name %}Please sign in with one
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
for a {{ site_name }} account and sign in below:{% endblocktranslate %}</p>
<div class="socialaccount_ballot">
@ -23,15 +23,15 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul>
<div class="login-or">{% trans 'or' %}</div>
<div class="login-or">{% translate 'or' %}</div>
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% else %}
<p>{% blocktrans %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
<p>{% blocktranslate %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktranslate %}</p>
{% endif %}
<form class="login" method="POST" action="{% url 'account_login' %}">
@ -40,8 +40,8 @@ for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
<button class="primaryAction btn btn-primary" type="submit">{% trans "Sign In" %}</button>
<a class="button secondaryAction" href="{% url 'account_reset_password' %}">{% translate "Forgot Password?" %}</a>
<button class="primaryAction btn btn-primary" type="submit">{% translate "Sign In" %}</button>
</form>
{% endblock %}

View File

@ -2,19 +2,19 @@
{% load i18n %}
{% block head_title %}{% trans "Sign Out" %}{% endblock %}
{% block head_title %}{% translate "Sign Out" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign Out" %}</h1>
<h1>{% translate "Sign Out" %}</h1>
<p>{% trans 'Are you sure you want to sign out?' %}</p>
<p>{% translate 'Are you sure you want to sign out?' %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}
<button class="btn btn-danger" type="submit">{% trans 'Sign Out' %}</button>
<button class="btn btn-danger" type="submit">{% translate 'Sign Out' %}</button>
</form>
{% endblock %}
{%- endraw %}

View File

@ -3,15 +3,15 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block head_title %}{% translate "Change Password" %}{% endblock %}
{% block inner %}
<h1>{% trans "Change Password" %}</h1>
<h1>{% translate "Change Password" %}</h1>
<form method="POST" action="{% url 'account_change_password' %}" class="password_change">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit" name="action">{% trans "Change Password" %}</button>
<button class="btn btn-primary" type="submit" name="action">{% translate "Change Password" %}</button>
</form>
{% endblock %}
{%- endraw %}

View File

@ -4,23 +4,23 @@
{% load account %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block head_title %}{% translate "Password Reset" %}{% endblock %}
{% block inner %}
<h1>{% trans "Password Reset" %}</h1>
<h1>{% translate "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
<p>{% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}</p>
<form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" value="{% trans 'Reset My Password' %}" />
<input class="btn btn-primary" type="submit" value="{% translate 'Reset My Password' %}" />
</form>
<p>{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}</p>
<p>{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -3,15 +3,15 @@
{% load i18n %}
{% load account %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block head_title %}{% translate "Password Reset" %}{% endblock %}
{% block inner %}
<h1>{% trans "Password Reset" %}</h1>
<h1>{% translate "Password Reset" %}</h1>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
<p>{% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -2,23 +2,23 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block head_title %}{% translate "Change Password" %}{% endblock %}
{% block inner %}
<h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
<h1>{% if token_fail %}{% translate "Bad Token" %}{% else %}{% translate "Change Password" %}{% endif %}</h1>
{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktranslate %}</p>
{% else %}
{% if form %}
<form method="POST" action=".">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" name="action" value="{% trans 'change password' %}"/>
<input class="btn btn-primary" type="submit" name="action" value="{% translate 'change password' %}"/>
</form>
{% else %}
<p>{% trans 'Your password is now changed.' %}</p>
<p>{% translate 'Your password is now changed.' %}</p>
{% endif %}
{% endif %}
{% endblock %}

View File

@ -1,10 +1,10 @@
{% raw %}{% extends "account/base.html" %}
{% load i18n %}
{% block head_title %}{% trans "Change Password" %}{% endblock %}
{% block head_title %}{% translate "Change Password" %}{% endblock %}
{% block inner %}
<h1>{% trans "Change Password" %}</h1>
<p>{% trans 'Your password is now changed.' %}</p>
<h1>{% translate "Change Password" %}</h1>
<p>{% translate 'Your password is now changed.' %}</p>
{% endblock %}
{%- endraw %}

View File

@ -3,15 +3,15 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Set Password" %}{% endblock %}
{% block head_title %}{% translate "Set Password" %}{% endblock %}
{% block inner %}
<h1>{% trans "Set Password" %}</h1>
<h1>{% translate "Set Password" %}</h1>
<form method="POST" action="{% url 'account_set_password' %}" class="password_set">
{% csrf_token %}
{{ form|crispy }}
<input class="btn btn-primary" type="submit" name="action" value="{% trans 'Set Password' %}"/>
<input class="btn btn-primary" type="submit" name="action" value="{% translate 'Set Password' %}"/>
</form>
{% endblock %}
{%- endraw %}

View File

@ -3,12 +3,12 @@
{% load i18n %}
{% load crispy_forms_tags %}
{% block head_title %}{% trans "Signup" %}{% endblock %}
{% block head_title %}{% translate "Signup" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign Up" %}</h1>
<h1>{% translate "Sign Up" %}</h1>
<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktranslate %}</p>
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
{% csrf_token %}
@ -16,7 +16,7 @@
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button class="btn btn-primary" type="submit">{% trans "Sign Up" %} &raquo;</button>
<button class="btn btn-primary" type="submit">{% translate "Sign Up" %} &raquo;</button>
</form>
{% endblock %}

View File

@ -2,11 +2,11 @@
{% load i18n %}
{% block head_title %}{% trans "Sign Up Closed" %}{% endblock %}
{% block head_title %}{% translate "Sign Up Closed" %}{% endblock %}
{% block inner %}
<h1>{% trans "Sign Up Closed" %}</h1>
<h1>{% translate "Sign Up Closed" %}</h1>
<p>{% trans "We are sorry, but the sign up is currently closed." %}</p>
<p>{% translate "We are sorry, but the sign up is currently closed." %}</p>
{% endblock %}
{%- endraw %}

View File

@ -2,12 +2,12 @@
{% load i18n %}
{% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %}
{% block head_title %}{% translate "Verify Your E-mail Address" %}{% endblock %}
{% block inner %}
<h1>{% trans "Verify Your E-mail Address" %}</h1>
<h1>{% translate "Verify Your E-mail Address" %}</h1>
<p>{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
<p>{% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -2,21 +2,21 @@
{% load i18n %}
{% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %}
{% block head_title %}{% translate "Verify Your E-mail Address" %}{% endblock %}
{% block inner %}
<h1>{% trans "Verify Your E-mail Address" %}</h1>
<h1>{% translate "Verify Your E-mail Address" %}</h1>
{% url 'account_email' as email_url %}
<p>{% blocktrans %}This part of the site requires us to verify that
<p>{% blocktranslate %}This part of the site requires us to verify that
you are who you claim to be. For this purpose, we require that you
verify ownership of your e-mail address. {% endblocktrans %}</p>
verify ownership of your e-mail address. {% endblocktranslate %}</p>
<p>{% blocktrans %}We have sent an e-mail to you for
<p>{% blocktranslate %}We have sent an e-mail to you for
verification. Please click on the link inside this e-mail. Please
contact us if you do not receive it within a few minutes.{% endblocktrans %}</p>
contact us if you do not receive it within a few minutes.{% endblocktranslate %}</p>
<p>{% blocktrans %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your e-mail address</a>.{% endblocktrans %}</p>
<p>{% blocktranslate %}<strong>Note:</strong> you can still <a href="{{ email_url }}">change your e-mail address</a>.{% endblocktranslate %}</p>
{% endblock %}
{%- endraw %}

View File

@ -78,20 +78,20 @@
{% if request.user.is_authenticated %}
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a class="nav-link" href="{% url 'users:detail' request.user.username %}">{% trans "My Profile" %}</a>
<a class="nav-link" href="{% url 'users:detail' request.user.username %}">{% translate "My Profile" %}</a>
</li>
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a class="nav-link" href="{% url 'account_logout' %}">{% trans "Sign Out" %}</a>
<a class="nav-link" href="{% url 'account_logout' %}">{% translate "Sign Out" %}</a>
</li>
{% else %}
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a>
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% translate "Sign Up" %}</a>
</li>
<li class="nav-item">
{# URL provided by django-allauth/account/urls.py #}
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% trans "Sign In" %}</a>
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% translate "Sign In" %}</a>
</li>
{% endif %}
</ul>