Merge pull request #1639 from hughrun/shelfnames

add translation strings
This commit is contained in:
Mouse Reeve 2021-12-02 12:45:41 -08:00 committed by GitHub
commit 9ee248033d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 11 deletions

View file

@ -18,7 +18,7 @@
</p> </p>
<form name="directory" method="POST" action="{% url 'directory' %}"> <form name="directory" method="POST" action="{% url 'directory' %}">
{% csrf_token %} {% csrf_token %}
<button class="button is-primary" type="submit">Join Directory</button> <button class="button is-primary" type="submit">{% trans "Join Directory" %}</button>
<p class="help"> <p class="help">
{% url 'prefs-profile' as path %} {% url 'prefs-profile' as path %}
{% blocktrans with path=path %}You can opt-out at any time in your <a href="{{ path }}">profile settings.</a>{% endblocktrans %} {% blocktrans with path=path %}You can opt-out at any time in your <a href="{{ path }}">profile settings.</a>{% endblocktrans %}
@ -28,7 +28,7 @@
<div class="column is-narrow"> <div class="column is-narrow">
{% trans "Dismiss message" as button_text %} {% trans "Dismiss message" as button_text %}
<button type="button" class="delete set-display" data-id="hide_join_directory" data-value="true"> <button type="button" class="delete set-display" data-id="hide_join_directory" data-value="true">
<span>Dismiss message</span> <span>{% trans "Dismiss message" %}</span>
</button> </button>
</div> </div>
</div></div> </div></div>

View file

@ -4,9 +4,14 @@
<div class="select is-small mt-1 mb-3"> <div class="select is-small mt-1 mb-3">
<select name="{{ book.id }}" aria-label="{% blocktrans with book_title=book.title %}Have you read {{ book_title }}?{% endblocktrans %}"> <select name="{{ book.id }}" aria-label="{% blocktrans with book_title=book.title %}Have you read {{ book_title }}?{% endblocktrans %}">
<option disabled selected value>Add to your books</option> <option disabled selected value>{% trans 'Add to your books' %}</option>
{% for shelf in user_shelves %} {% for shelf in user_shelves %}
<option value="{{ shelf.id }}">{{ shelf.name }}</option> <option value="{{ shelf.id }}">
{% 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 %}
</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>

View file

@ -39,7 +39,7 @@
<header class="columns is-mobile"> <header class="columns is-mobile">
<div class="column"> <div class="column">
<h3 class="title is-5"> <h3 class="title is-5">
Results from {% trans 'Results from' %}
<a href="{{ result_set.connector.base_url }}" target="_blank">{{ result_set.connector.name|default:result_set.connector.identifier }}</a> <a href="{{ result_set.connector.base_url }}" target="_blank">{{ result_set.connector.name|default:result_set.connector.identifier }}</a>
</h3> </h3>
</div> </div>

View file

@ -80,7 +80,10 @@
<div class="block columns is-mobile"> <div class="block columns is-mobile">
<div class="column"> <div class="column">
<h2 class="title is-3"> <h2 class="title is-3">
{{ 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 %}
<span class="subtitle"> <span class="subtitle">
{% include 'snippets/privacy-icons.html' with item=shelf %} {% include 'snippets/privacy-icons.html' with item=shelf %}
</span> </span>

View file

@ -22,7 +22,15 @@
<input type="hidden" name="book" value="{{ book.id }}"> <input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="change-shelf-from" value="{{ current.identifier }}"> <input type="hidden" name="change-shelf-from" value="{{ current.identifier }}">
<input type="hidden" name="shelf" value="{{ shelf.identifier }}"> <input type="hidden" name="shelf" value="{{ shelf.identifier }}">
<button class="button is-fullwidth is-small shelf-option is-radiusless is-white" type="submit" {% if shelf in book.shelf_set.all %} disabled {% endif %}><span>{{ shelf.name }}</span></button>
<button class="button is-fullwidth is-small shelf-option is-radiusless is-white" type="submit" {% if shelf.identifier == current.identifier %}disabled{% endif %}>
<span>
{% 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 %}
</span>
</button>
</form> </form>
</li> </li>
{% else%} {% else%}

View file

@ -29,8 +29,13 @@
<div class="columns is-mobile scroll-x"> <div class="columns is-mobile scroll-x">
{% for shelf in shelves %} {% for shelf in shelves %}
<div class="column is-narrow"> <div class="column is-narrow">
<h3>{{ shelf.name }} <h3>
{% if shelf.size > 3 %}<small>(<a href="{{ shelf.local_path }}">{% blocktrans with size=shelf.size %}View all {{ size }}{% endblocktrans %}</a>)</small>{% endif %}</h3> {% if shelf.name == 'To Read' %}{% trans "To Read" %}
{% elif shelf.name == 'Currently Reading' %}{% trans "Currently Reading" %}
{% elif shelf.name == 'Read' %}{% trans "Read" %}
{% else %}{{ shelf.name }}{% endif %}
{% if shelf.size > 3 %}<small>(<a href="{{ shelf.local_path }}">{% blocktrans with size=shelf.size %}View all {{ size }}{% endblocktrans %}</a>)</small>{% endif %}
</h3>
<div class="is-mobile field is-grouped"> <div class="is-mobile field is-grouped">
{% for book in shelf.books %} {% for book in shelf.books %}
<div class="control"> <div class="control">
@ -49,7 +54,8 @@
{% if goal %} {% if goal %}
<div class="block"> <div class="block">
<h2 class="title">{% now 'Y' %} Reading Goal</h2> {% now 'Y' as current_year%}
<h2 class="title">{% blocktrans %}{{ current_year }} Reading Goal{% endblocktrans %}</h2>
{% include 'snippets/goal_progress.html' with goal=goal %} {% include 'snippets/goal_progress.html' with goal=goal %}
</div> </div>
{% endif %} {% endif %}

View file

@ -19,7 +19,7 @@ def request_isni_data(search_index, search_term, max_records=5):
"recordPacking": "xml", "recordPacking": "xml",
"sortKeys": "RLV,pica,0,,", "sortKeys": "RLV,pica,0,,",
} }
result = requests.get("http://isni.oclc.org/sru/", params=query_params, timeout=10) result = requests.get("http://isni.oclc.org/sru/", params=query_params, timeout=15)
# the OCLC ISNI server asserts the payload is encoded # the OCLC ISNI server asserts the payload is encoded
# in latin1, but we know better # in latin1, but we know better
result.encoding = "utf-8" result.encoding = "utf-8"