Skip to content

Commit

Permalink
Translates expression for duration (#449)
Browse files Browse the repository at this point in the history
* Translates expression for duration

Fixes incorrect translation of expression with blocktrans introduced in PR #345.
Django docs show that expressions must be bound to a variable before
being used inside a blocktrans (now blocktranslate since 3.1)

https://docs.djangoproject.com/en/2.2/topics/i18n/translation/#blocktrans-template-tag

* Uses newer format for expression binding

This newer format is easier to read, and available since at least django
1.8.
  • Loading branch information
jtrain authored Jul 14, 2021
1 parent 407bcad commit 6f7c38c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion explorer/templates/explorer/preview_pane.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="row">
<div class="col-md-6">
{% if data %}<a title="Show row numbers" id="counter-toggle" href="#">#</a>&nbsp;{% endif %}
<span class="panel-title">{% blocktrans %}Execution time: {{ duration|floatformat:2 }} ms{% endblocktrans %}</span>
<span class="panel-title">{% blocktrans with duration=duration|floatformat:2 %}Execution time: {{ duration }} ms{% endblocktrans %}</span>
</div>
<div class="col-md-6 text-right">
<span class="row-control">
Expand Down

0 comments on commit 6f7c38c

Please sign in to comment.