Skip to content

Commit

Permalink
Remove html tags in i18n translations
Browse files Browse the repository at this point in the history
  • Loading branch information
int-y1 authored and quantum5 committed May 20, 2022
1 parent 7fb0d74 commit 966b37d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
10 changes: 4 additions & 6 deletions templates/registration/password_reset_email.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<span style="display:block;margin: 0 2px;padding: 1em;border: 3px solid #FFDE05;background-color: #000;border-radius: 6px;font-size: .95em;color: #444;margin-bottom:0.75em">
<div style="display:table;margin-left:2em"><img src="https://avatars1.githubusercontent.com/u/6934864?v=3&s=101" style="display:inline;vertical-align: middle">
<h1 style="font-size:4em;display:inline;vertical-align: middle"><a href="//{{ domain }}" style="text-decoration:none;color:gray"><span style="color: #FFDE05">DM::</span>OJ</a>
<h1 style="font-size:4em;display:inline;vertical-align: middle"><a href="{{ protocol }}://{{ domain }}" style="text-decoration:none;color:gray"><span style="color: #FFDE05">DM::</span>OJ</a>
</h1>
</div>
</span>
<div style="display:block;margin: 0 2px;padding: 1em;border: 3px solid #2980B9;background-color: #f8f8f8;border-radius: 6px;font-size: .95em;color: #444;">

{% trans username=user.get_username() %}
<b>Forgot your password on the {{ site_name }}? Don't worry!</b><br><br>
To reset the password for your account "{{ username }}", click the button below.
{% endtrans %}
<b>{{ _("Forgot your password on the %(site_name)s? Don't worry!", site_name=site_name) }}</b><br><br>
{{ _('To reset the password for your account "%(username)s", click the button below.', username=user.get_username()) }}
<p align="center">
<a href="{{ protocol }}://{{ domain }}{{ url('password_reset_confirm', uidb64=uid, token=token) }}" style="cursor: pointer;display:block;text-align: center;padding: 4px 2px 5px;color: white;border: 1px solid #666;border-radius: 1px;background: #2980b9;background: linear-gradient(180deg, #00aee0, #2980b9);text-decoration: none;line-height:2em;font-size:1em;width:12em;">Reset password</a>
<a href="{{ protocol }}://{{ domain }}{{ url('password_reset_confirm', uidb64=uid, token=token) }}" style="cursor: pointer;display:block;text-align: center;padding: 4px 2px 5px;color: white;border: 1px solid #666;border-radius: 1px;background: #2980b9;background: linear-gradient(180deg, #00aee0, #2980b9);text-decoration: none;line-height:2em;font-size:1em;width:12em;">{{ _('Reset Password') }}</a>
</p>
{% if SITE_ADMIN_EMAIL %}
{{ _('See you soon! If you have problems resetting your email, feel free to shoot us an email at') }} <a href="mailto:{{ SITE_ADMIN_EMAIL }}">{{ SITE_ADMIN_EMAIL }}</a>
Expand Down
9 changes: 4 additions & 5 deletions templates/submission/internal-error-message.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<h3 style="color:red;font-weight:bold">
{% if request.user == submission.user.user %}
{% trans trimmed %}
An internal error occurred while grading, and the {{ SITE_NAME }} administrators have been notified.<br>
In the meantime, try resubmitting in a few seconds.
{% endtrans %}
{{ _('An internal error occurred while grading, and the %(site_name)s administrators have been notified.', site_name=SITE_NAME) }}
<br>
{{ _('In the meantime, try resubmitting in a few seconds.') }}
{% else %}
{{ _('An internal error occurred while grading.') }}
{% endif %}
Expand All @@ -15,4 +14,4 @@ <h3 style="color:red;font-weight:bold">
<h4>{{ _('Error information') }}</h4>
<pre><code>{{ submission.error|highlight('pytb') }}</code></pre>
{% endif %}
{% endif %}
{% endif %}

0 comments on commit 966b37d

Please sign in to comment.