Adds default shelf names translations

This commit is contained in:
Mouse Reeve 2021-03-02 10:32:46 -08:00
parent 27914d07b9
commit 2c37893790
3 changed files with 6 additions and 2 deletions

View file

@ -20,7 +20,10 @@
{% with shelf_counter=forloop.counter %} {% with shelf_counter=forloop.counter %}
<li> <li>
<p> <p>
{{ shelf.name }} {% if shelf.identifier == 'to-read' %}{% trans "To Read" %}
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
{% else %}{{ shelf.name }}{% endif %}
</p> </p>
<div class="tabs is-small is-toggle"> <div class="tabs is-small is-toggle">
<ul> <ul>

View file

@ -21,7 +21,7 @@
<ul> <ul>
{% for shelf_tab in shelves %} {% for shelf_tab in shelves %}
<li class="{% if shelf_tab.identifier == shelf.identifier %}is-active{% endif %}"> <li class="{% if shelf_tab.identifier == shelf.identifier %}is-active{% endif %}">
<a href="/user/{{ user | username }}/shelf/{{ shelf_tab.identifier }}"{% if shelf_tab.identifier == shelf.identifier %} aria-current="page"{% endif %}>{{ shelf_tab.name }}</a> <a href="/user/{{ user | username }}/shelf/{{ shelf_tab.identifier }}"{% if shelf_tab.identifier == shelf.identifier %} aria-current="page"{% endif %}>{% if shelf_tab.identifier == 'to-read' %}{% trans "To Read" %}{% elif shelf_tab.identifier == 'reading' %}{% trans "Currently Reading" %}{% elif shelf_tab.identifier == 'read' %}{% trans "Read" %}{% else %}{{ shelf_tab.name }}{% endif %}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

View file

@ -166,6 +166,7 @@ def get_suggested_books(user, max_books=5):
continue continue
shelf_preview = { shelf_preview = {
'name': shelf.name, 'name': shelf.name,
'identifier': shelf.identifier,
'books': [s.book for s in shelf_books] 'books': [s.book for s in shelf_books]
} }
suggested_books.append(shelf_preview) suggested_books.append(shelf_preview)