From 6f7c38c0dc58cf0b440b6bcb91b199df4e2b0314 Mon Sep 17 00:00:00 2001 From: jtrain Date: Thu, 15 Jul 2021 09:57:08 +1000 Subject: [PATCH] Translates expression for duration (#449) * 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. --- explorer/templates/explorer/preview_pane.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explorer/templates/explorer/preview_pane.html b/explorer/templates/explorer/preview_pane.html index fa3aa8e9..d5cde41d 100644 --- a/explorer/templates/explorer/preview_pane.html +++ b/explorer/templates/explorer/preview_pane.html @@ -16,7 +16,7 @@
{% if data %}# {% endif %} - {% blocktrans %}Execution time: {{ duration|floatformat:2 }} ms{% endblocktrans %} + {% blocktrans with duration=duration|floatformat:2 %}Execution time: {{ duration }} ms{% endblocktrans %}