mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 11:31:08 +00:00
i18n for "page x of y"
This commit is contained in:
parent
34a32032c9
commit
fdfbf29744
2 changed files with 20 additions and 3 deletions
7
bookwyrm/templates/snippets/page_text.html
Normal file
7
bookwyrm/templates/snippets/page_text.html
Normal file
|
@ -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 %}
|
|
@ -9,8 +9,18 @@
|
|||
</dl>
|
||||
<ul>
|
||||
{% if readthrough.finish_date or readthrough.progress %}
|
||||
<li>{% if readthrough.finish_date %} {{ readthrough.finish_date | localtime | naturalday }}: {% trans "finished" %} {% else %}{% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %}
|
||||
{% else %}{{ readthrough.progress }}%{% endif %}{% endif %}
|
||||
<li>
|
||||
{% if readthrough.finish_date %}
|
||||
{{ readthrough.finish_date | localtime | naturalday }}: {% trans "finished" %}
|
||||
{% else %}
|
||||
|
||||
{% if readthrough.progress_mode == 'PG' %}
|
||||
{% include 'snippets/page_text.html' with page=readthrough.progress total_pages=book.pages %}
|
||||
{% else %}
|
||||
{{ readthrough.progress }}%
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if readthrough.progress %}
|
||||
{% trans "Show all updates" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="updates" controls_uid=readthrough.id class="is-small" %}
|
||||
|
@ -21,7 +31,7 @@
|
|||
{% csrf_token %}
|
||||
{{ progress_update.created_date | naturalday }}:
|
||||
{% if progress_update.mode == 'PG' %}
|
||||
page {{ progress_update.progress }} of {{ book.pages }}
|
||||
{% include 'snippets/page_text.html' with page=progress_update.progress total_pages=book.pages %}
|
||||
{% else %}
|
||||
{{ progress_update.progress }}%
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue