@@ -34,15 +45,7 @@
href="{{ shelf_tab.local_path }}"
{% 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 %}
+ {% include 'user/books_header.html' with shelf=shelf_tab %}
{% endfor %}
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/snippets/translated_shelf_name.html b/bookwyrm/templates/snippets/translated_shelf_name.html
new file mode 100644
index 00000000..4da47e37
--- /dev/null
+++ b/bookwyrm/templates/snippets/translated_shelf_name.html
@@ -0,0 +1,12 @@
+{% load i18n %}
+{% if shelf.identifier == 'all' %}
+ {% trans "All books" %}
+{% elif shelf.identifier == 'to-read' %}
+ {% trans "To Read" %}
+{% elif shelf.identifier == 'reading' %}
+ {% trans "Currently Reading" %}
+{% elif shelf.identifier == 'read' %}
+ {% trans "Read" %}
+{% else %}
+ {{ shelf.name }}
+{% endif %}
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 %}