Use translation snippet

This commit is contained in:
Mouse Reeve 2022-01-11 12:10:30 -08:00
parent 150756dbd0
commit 5fd0115216
3 changed files with 8 additions and 20 deletions

View file

@ -16,10 +16,7 @@
{% with shelf_counter=forloop.counter %} {% with shelf_counter=forloop.counter %}
<li> <li>
<p> <p>
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %} {% include "snippets/translated_shelf_name.html" with shelf=shelf %}
{% 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

@ -25,10 +25,7 @@
<button class="button is-fullwidth is-small shelf-option is-radiusless is-white" type="submit" {% if shelf.identifier == current.identifier %}disabled{% endif %}> <button class="button is-fullwidth is-small shelf-option is-radiusless is-white" type="submit" {% if shelf.identifier == current.identifier %}disabled{% endif %}>
<span> <span>
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %} {% include "snippets/translated_shelf_name.html" with shelf=shelf %}
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
{% else %}{{ shelf.name }}{% endif %}
</span> </span>
</button> </button>
</form> </form>

View file

@ -1,16 +1,10 @@
{% load i18n %} {% load i18n %}
{% if is_self %} {% if is_self %}
{% if shelf.identifier == 'to-read' %} {% if shelf.identifier == 'all' %}
{% trans "To Read" %} {% trans "Your books" %}
{% elif shelf.identifier == 'reading' %} {% else %}
{% trans "Currently Reading" %} {% include "snippets/translated_shelf_name.html" with shelf=shelf %}
{% elif shelf.identifier == 'read' %} {% endif %}
{% trans "Read" %}
{% elif shelf.identifier == 'all' %}
{% trans "Your books" %}
{% else %} {% else %}
{{ shelf.name }} {% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}
{% endif %}
{% else %}
{% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}
{% endif %} {% endif %}