aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates/search.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-11-05 14:52:43 -0800
committerBryan Newbold <bnewbold@archive.org>2020-11-05 14:55:08 -0800
commite9d9934b2d8a67fbd47816cc3f84f142298cbcfb (patch)
tree46b10a0e610cf4d571e856a9b14a5ba101c47426 /fatcat_scholar/templates/search.html
parent2b99551390d574d7518b67731c77937422c845f9 (diff)
downloadfatcat-scholar-e9d9934b2d8a67fbd47816cc3f84f142298cbcfb.tar.gz
fatcat-scholar-e9d9934b2d8a67fbd47816cc3f84f142298cbcfb.zip
pluralize result and 'additional' strings (for i18n)
Thanks to Mito Ivir on weblate for the recommendation.
Diffstat (limited to 'fatcat_scholar/templates/search.html')
-rw-r--r--fatcat_scholar/templates/search.html28
1 files changed, 22 insertions, 6 deletions
diff --git a/fatcat_scholar/templates/search.html b/fatcat_scholar/templates/search.html
index 27b1676..d91b78a 100644
--- a/fatcat_scholar/templates/search.html
+++ b/fatcat_scholar/templates/search.html
@@ -3,9 +3,9 @@
{% macro format_query_time(query_time_ms) -%}
{% if query_time_ms >= 10000 %}
- {{ "{:0.3}".format(hits.query_time_ms/1000.0) }}sec
+ {{ "{:0.3}".format(hits.query_time_ms/1000.0) }}
{% else %}
- {{ "{:0.2}".format(hits.query_time_ms/1000.0) }}sec
+ {{ "{:0.2}".format(hits.query_time_ms/1000.0) }}
{% endif %}
{%- endmacro %}
@@ -43,8 +43,16 @@
{% if hits %}
<span class="hit-count" style="font-size: 1.5em;">{{ "{:,}".format(hits.count_found) }}</span>
- Hits
- <span style="color: rgba(0,0,0,0.55);">in {{ format_query_time(hits.query_time_ms) }}</span>
+ {% trans trimmed count=hits.count_found %}
+ Hit
+ {% pluralize %}
+ Hits
+ {% endtrans %}
+ <span style="color: rgba(0,0,0,0.55);">
+ {% trans trimmed frac_sec=format_query_time(hits.query_time_ms) %}
+ in {{ frac_sec }}sec
+ {% endtrans %}
+ </span>
{% else %}
&nbsp;
{% endif %}
@@ -65,10 +73,18 @@
<span class="hit-count" style="display: block; font-size: {{ count_size }};">
{{ "{:,}".format(hits.count_found) }}
</span>
- {{ _("Hits") }}
+ {% trans trimmed count=hits.count_found %}
+ Hit
+ {% pluralize %}
+ Hits
+ {% endtrans %}
</div>
<div style="text-align: end;">
- <span style="color: rgba(0,0,0,0.55);">in {{ format_query_time(hits.query_time_ms) }}</span>
+ <span style="color: rgba(0,0,0,0.55);">
+ {% trans trimmed frac_sec=format_query_time(hits.query_time_ms) %}
+ in {{ frac_sec }}sec
+ {% endtrans %}
+ </span>
</div>
<div class="ui clearing divider"></div>
{% endif %}