aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/templates/search_macros.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-01-25 22:44:38 -0800
committerBryan Newbold <bnewbold@archive.org>2021-01-25 22:44:38 -0800
commitb9ad86071622b0e12cc5ff7fccc4e094785891fb (patch)
treecb566c0c5005b48d5260a56786a0e0e123b58548 /fatcat_scholar/templates/search_macros.html
parent9e73da0e40f7cf38de0ae3413fdf0d202493525d (diff)
downloadfatcat-scholar-b9ad86071622b0e12cc5ff7fccc4e094785891fb.tar.gz
fatcat-scholar-b9ad86071622b0e12cc5ff7fccc4e094785891fb.zip
i18n: use babel.numbers.format_number() in web interface
Diffstat (limited to 'fatcat_scholar/templates/search_macros.html')
-rw-r--r--fatcat_scholar/templates/search_macros.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html
index 5038e65..57d981b 100644
--- a/fatcat_scholar/templates/search_macros.html
+++ b/fatcat_scholar/templates/search_macros.html
@@ -141,7 +141,7 @@
{% macro journal_row(biblio, paper) -%}
{# NOTE: should be able to call with paper.biblio or any paper.release[] #}
{% if biblio.release_year %}
- <span title="{{ biblio.release_date or '' }}">{{ biblio.release_year }}</span>
+ <span title="{{ biblio.release_date or '' }}">{% trans year=biblio.release_year %}{{ year }}{% endtrans %}</span>
{% endif %}
{% if biblio.container_name %}
<i {% if biblio.publisher %}title="{{ biblio.publisher }}"{% endif %}>
@@ -169,7 +169,7 @@
{% endif %}
{% endmacro %}
-{% macro fulltext_search_result_row(paper, locale=None, debug_mode=False, expand=False) -%}
+{% macro fulltext_search_result_row(paper, locale, debug_mode=False, expand=False) -%}
<div class="ui stackable doubling grid">
<div class="thirteen wide column biblio-record">
@@ -487,7 +487,7 @@
</div> {# final row close #}
{% endmacro %}
-{% macro search_pagination(hits, top) %}
+{% macro search_pagination(hits, locale) %}
{% if hits.offset > 0 %}
<button class="text-button" form="search_form" type="submit" name="offset" value="{{ hits.offset - hits.limit }}" style="float: left;" rel="prev">
<a>{% trans %}&laquo; Previous{% endtrans %}</a>
@@ -505,7 +505,9 @@
{% endif %}
<i style="padding-left: 0.5em; padding-right: 0.5em;">
- {% trans trimmed start=(hits.offset + 1), end=(hits.offset + hits.limit), total="{:,}".format(hits.count_found) %}
+ {% trans trimmed start=babel_numbers.format_number(hits.offset + 1, locale=locale),
+ end=babel_numbers.format_number(hits.offset + hits.limit, locale=locale),
+ total=babel_numbers.format_number(hits.count_found, locale=locale) %}
Showing results {{ start }} &mdash; {{ end }} out of {{ total }} results
{% endtrans %}
</i>