Skip to content

Commit 9021f65

Browse files
committed
Fix translations unparsable by Django's extractor
1 parent 486fb07 commit 9021f65

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
<a href="{{ url('user_page') }}">
211211
<span>
212212
<img src="{{ gravatar(request.user, 32) }}" height="24" width="24">{# -#}
213-
<span>{{ _('Hello, %(username)s.', username=('<b>%s</b>'|safe|format(request.profile.display_name))) }}</span>
213+
<span>{{ _('Hello, %(username)s.', username=bold(request.profile.display_name)) }}</span>
214214
</span>
215215
</a>
216216
<ul style="width: 150px">

templates/contest/contest.html

+11-10
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,17 @@
5555
{%- endif -%}
5656
</a>
5757
<div id="time">
58-
{% if contest.time_limit %}
59-
{{ _('%(time_limit)s window between %(start_time)s and %(end_time)s',
60-
start_time='<b>%s</b>'|safe|format(contest.start_time|date(_("F j, Y, G:i T"))),
61-
end_time='<b>%s</b>'|safe|format(contest.end_time|date(_("F j, Y, G:i T"))),
62-
time_limit='<b>%s</b>'|safe|format(contest.time_limit|timedelta('localized-no-seconds'))) }}
63-
{% else %}
64-
{{ _('%(length)s long starting on %(start_time)s',
65-
start_time='<b>%s</b>'|safe|format(contest.start_time|date(_("F j, Y, G:i T"))),
66-
length='<b>%s</b>'|safe|format(contest.contest_window_length|timedelta('localized-no-seconds'))) }}
67-
{% endif %}
58+
{% with start_time = contest.start_time|date(_("F j, Y, G:i T")) %}
59+
{% if contest.time_limit %}
60+
{% with end_time = contest.end_time|date(_("F j, Y, G:i T")), time_limit = contest.time_limit|timedelta('localized-no-seconds') %}
61+
{{ _('%(time_limit)s window between %(start_time)s and %(end_time)s', start_time=bold(start_time), end_time=bold(end_time), time_limit=bold(time_limit)) }}
62+
{% endwith %}
63+
{% else %}
64+
{% with length = contest.contest_window_length|timedelta('localized-no-seconds') %}
65+
{{ _('%(length)s long starting on %(start_time)s', start_time=bold(start_time), length=bold(length)) }}
66+
{% endwith %}
67+
{% endif %}
68+
{% endwith %}
6869
</div>
6970
{% if contest.show_short_display %}
7071
<div id="details">

templates/problem/submit.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@
202202
<div class="alert alert-warning alert-dismissable">
203203
<a class="close">x</a>
204204
<b>{{ _('Warning!') }}</b>
205-
{{ _('Your default language, %(language)s, is unavailable for this problem and has been deselected.',
206-
language='<b>%s</b>'|safe|format(default_lang.name)) }}
205+
{{ _('Your default language, %(language)s, is unavailable for this problem and has been deselected.', language=bold(default_lang.name)) }}
207206
</div>
208207
{% endif %}
209208

0 commit comments

Comments
 (0)