From 5fd0115216f73cbd98d373e830b752be15e09a2e Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 11 Jan 2022 12:10:30 -0800 Subject: [PATCH] Use translation snippet --- bookwyrm/templates/feed/suggested_books.html | 5 +---- .../templates/snippets/shelf_selector.html | 5 +---- bookwyrm/templates/user/books_header.html | 18 ++++++------------ 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/bookwyrm/templates/feed/suggested_books.html b/bookwyrm/templates/feed/suggested_books.html index 899767d1..a3d3f1fa 100644 --- a/bookwyrm/templates/feed/suggested_books.html +++ b/bookwyrm/templates/feed/suggested_books.html @@ -16,10 +16,7 @@ {% with shelf_counter=forloop.counter %}
  • - {% 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 %} + {% include "snippets/translated_shelf_name.html" with shelf=shelf %}

      diff --git a/bookwyrm/templates/snippets/shelf_selector.html b/bookwyrm/templates/snippets/shelf_selector.html index 85ecc4ee..97e9809d 100644 --- a/bookwyrm/templates/snippets/shelf_selector.html +++ b/bookwyrm/templates/snippets/shelf_selector.html @@ -25,10 +25,7 @@ diff --git a/bookwyrm/templates/user/books_header.html b/bookwyrm/templates/user/books_header.html index 7311e242..bd01e6b9 100644 --- a/bookwyrm/templates/user/books_header.html +++ b/bookwyrm/templates/user/books_header.html @@ -1,16 +1,10 @@ {% load i18n %} {% if is_self %} -{% if shelf.identifier == 'to-read' %} -{% trans "To Read" %} -{% elif shelf.identifier == 'reading' %} -{% trans "Currently Reading" %} -{% elif shelf.identifier == 'read' %} -{% trans "Read" %} -{% elif shelf.identifier == 'all' %} -{% trans "Your books" %} + {% if shelf.identifier == 'all' %} + {% trans "Your books" %} + {% else %} + {% include "snippets/translated_shelf_name.html" with shelf=shelf %} + {% endif %} {% else %} -{{ shelf.name }} -{% endif %} -{% else %} -{% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %} + {% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %} {% endif %}