From 2602ae42b02c243e4550cda7407eec86009aaa6e Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Wed, 1 Dec 2021 20:07:52 +1100 Subject: [PATCH 1/3] add translation strings - add logic when default shelves used - add trans strings in a few spots they were missing --- bookwyrm/templates/directory/directory.html | 4 ++-- bookwyrm/templates/get_started/book_preview.html | 9 +++++++-- bookwyrm/templates/search/book.html | 2 +- bookwyrm/templates/shelf/shelf.html | 5 ++++- bookwyrm/templates/snippets/shelf_selector.html | 9 ++++++++- bookwyrm/templates/user/user.html | 11 ++++++++--- 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/bookwyrm/templates/directory/directory.html b/bookwyrm/templates/directory/directory.html index 9753c4c0..c3ddb3c5 100644 --- a/bookwyrm/templates/directory/directory.html +++ b/bookwyrm/templates/directory/directory.html @@ -18,7 +18,7 @@

{% csrf_token %} - +

{% url 'prefs-profile' as path %} {% blocktrans with path=path %}You can opt-out at any time in your profile settings.{% endblocktrans %} @@ -28,7 +28,7 @@

{% trans "Dismiss message" as button_text %}
diff --git a/bookwyrm/templates/get_started/book_preview.html b/bookwyrm/templates/get_started/book_preview.html index 893e7593..8a20d0d7 100644 --- a/bookwyrm/templates/get_started/book_preview.html +++ b/bookwyrm/templates/get_started/book_preview.html @@ -4,9 +4,14 @@
diff --git a/bookwyrm/templates/search/book.html b/bookwyrm/templates/search/book.html index 704f055b..66adb8c8 100644 --- a/bookwyrm/templates/search/book.html +++ b/bookwyrm/templates/search/book.html @@ -39,7 +39,7 @@
diff --git a/bookwyrm/templates/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html index 01d41aa0..0184ab1d 100644 --- a/bookwyrm/templates/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -80,7 +80,10 @@

- {{ 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 %} {% include 'snippets/privacy-icons.html' with item=shelf %} diff --git a/bookwyrm/templates/snippets/shelf_selector.html b/bookwyrm/templates/snippets/shelf_selector.html index ca5a39f6..2bb5e253 100644 --- a/bookwyrm/templates/snippets/shelf_selector.html +++ b/bookwyrm/templates/snippets/shelf_selector.html @@ -13,7 +13,14 @@ - + {% endfor %} diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index 36e646aa..9e75cefc 100755 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -29,8 +29,13 @@
{% for shelf in shelves %}
-

{{ shelf.name }} - {% if shelf.size > 3 %}({% blocktrans with size=shelf.size %}View all {{ size }}{% endblocktrans %}){% endif %}

+

+ {% 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 %}({% blocktrans with size=shelf.size %}View all {{ size }}{% endblocktrans %}){% endif %} +

{% for book in shelf.books %}
@@ -49,7 +54,7 @@ {% if goal %}
-

{% now 'Y' %} Reading Goal

+

{% now 'Y' %} {% trans 'Reading Goal' %}

{% include 'snippets/goal_progress.html' with goal=goal %}
{% endif %} From 8e6619294f1864b83a51457a9475567eace42055 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Wed, 1 Dec 2021 21:02:25 +1100 Subject: [PATCH 2/3] oclc server sure is slow --- bookwyrm/utils/isni.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/utils/isni.py b/bookwyrm/utils/isni.py index a35c3f24..65d20c85 100644 --- a/bookwyrm/utils/isni.py +++ b/bookwyrm/utils/isni.py @@ -19,7 +19,7 @@ def request_isni_data(search_index, search_term, max_records=5): "recordPacking": "xml", "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 # in latin1, but we know better result.encoding = "utf-8" From 2ec6e566986de5ea4c85cf2ec43e002d58a9d4ac Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Thu, 2 Dec 2021 07:28:35 +1100 Subject: [PATCH 3/3] blocktrans for reading goal --- bookwyrm/templates/user/user.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index 9e75cefc..ccc4a44e 100755 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -54,7 +54,8 @@ {% if goal %}
-

{% now 'Y' %} {% trans 'Reading Goal' %}

+ {% now 'Y' as current_year%} +

{% blocktrans %}{{ current_year }} Reading Goal{% endblocktrans %}

{% include 'snippets/goal_progress.html' with goal=goal %}
{% endif %}