From fdfbf2974440d5604f13f09b3ac92daa1635c88b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 1 Apr 2021 20:22:42 -0700 Subject: [PATCH] i18n for "page x of y" --- bookwyrm/templates/snippets/page_text.html | 7 +++++++ bookwyrm/templates/snippets/readthrough.html | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 bookwyrm/templates/snippets/page_text.html diff --git a/bookwyrm/templates/snippets/page_text.html b/bookwyrm/templates/snippets/page_text.html new file mode 100644 index 000000000..dc7a6a337 --- /dev/null +++ b/bookwyrm/templates/snippets/page_text.html @@ -0,0 +1,7 @@ +{% load humanize %} +{% load i18n %} +{% if total_pages %} +{% blocktrans with page=page|intcomma total_pages=total_pages|intcomma %}page {{ page }} of {{ total_pages }}{% endblocktrans %} +{% else %} +{% blocktrans with page=page|intcomma %}page {{ page }}{% endblocktrans %} +{% endif %} diff --git a/bookwyrm/templates/snippets/readthrough.html b/bookwyrm/templates/snippets/readthrough.html index 3e694f616..766118629 100644 --- a/bookwyrm/templates/snippets/readthrough.html +++ b/bookwyrm/templates/snippets/readthrough.html @@ -9,8 +9,18 @@