prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  localisation string for a shelf is missing
  **Describe the bug**
  A translation exists, but the string "Currently reading" is shown in English language
  
  **To Reproduce**
  Switch language to non-english and check book status
  
  **Expected behavior**
  Translated string used instead of English
  
  **Screenshots**
  
  ![image](https://user-images.githubusercontent.com/81133/151704062-a99581a4-a941-4c6c-815a-62c7fd4885f6.png)
  
  **Instance**
  https://ziurkes.group.lt
  
  
  
  </issue>
  <code>
  [start of bookwyrm/templatetags/shelf_tags.py]
  1 """ Filters and tags related to shelving books """
  2 from django import template
  3 
  4 from bookwyrm import models
  5 from bookwyrm.utils import cache
  6 
  7 
  8 register = template.Library()
  9 
  10 
  11 @register.filter(name="is_book_on_shelf")
  12 def get_is_book_on_shelf(book, shelf):
  13     """is a book on a shelf"""
  14     return cache.get_or_set(
  15         f"book-on-shelf-{book.id}-{shelf.id}",
  16         lambda b, s: s.books.filter(id=b.id).exists(),
  17         book,
  18         shelf,
  19         timeout=15552000,
  20     )
  21 
  22 
  23 @register.filter(name="next_shelf")
  24 def get_next_shelf(current_shelf):
  25     """shelf you'd use to update reading progress"""
  26     if current_shelf == "to-read":
  27         return "reading"
  28     if current_shelf == "reading":
  29         return "read"
  30     if current_shelf == "read":
  31         return "complete"
  32     return "to-read"
  33 
  34 
  35 @register.simple_tag(takes_context=True)
  36 def active_shelf(context, book):
  37     """check what shelf a user has a book on, if any"""
  38     user = context["request"].user
  39     return cache.get_or_set(
  40         f"active_shelf-{user.id}-{book.id}",
  41         lambda u, b: (
  42             models.ShelfBook.objects.filter(
  43                 shelf__user=u,
  44                 book__parent_work__editions=b,
  45             ).first()
  46             or False
  47         ),
  48         user,
  49         book,
  50         timeout=15552000,
  51     ) or {"book": book}
  52 
  53 
  54 @register.simple_tag(takes_context=False)
  55 def latest_read_through(book, user):
  56     """the most recent read activity"""
  57     return cache.get_or_set(
  58         f"latest_read_through-{user.id}-{book.id}",
  59         lambda u, b: (
  60             models.ReadThrough.objects.filter(user=u, book=b, is_active=True)
  61             .order_by("-start_date")
  62             .first()
  63             or False
  64         ),
  65         user,
  66         book,
  67         timeout=15552000,
  68     )
  69
  [end of bookwyrm/templatetags/shelf_tags.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/bookwyrm/templatetags/shelf_tags.py b/bookwyrm/templatetags/shelf_tags.py
  --- a/bookwyrm/templatetags/shelf_tags.py
  +++ b/bookwyrm/templatetags/shelf_tags.py
  @@ -1,5 +1,6 @@
   """ Filters and tags related to shelving books """
   from django import template
  +from django.utils.translation import gettext_lazy as _
   
   from bookwyrm import models
   from bookwyrm.utils import cache
  @@ -32,6 +33,24 @@
       return "to-read"
   
   
  +@register.filter(name="translate_shelf_name")
  +def get_translated_shelf_name(shelf):
  +    """produced translated shelf nidentifierame"""
  +    if not shelf:
  +        return ""
  +    # support obj or dict
  +    identifier = shelf["identifier"] if isinstance(shelf, dict) else shelf.identifier
  +    if identifier == "all":
  +        return _("All books")
  +    if identifier == "to-read":
  +        return _("To Read")
  +    if identifier == "reading":
  +        return _("Currently Reading")
  +    if identifier == "read":
  +        return _("Read")
  +    return shelf["name"] if isinstance(shelf, dict) else shelf.name
  +
  +
   @register.simple_tag(takes_context=True)
   def active_shelf(context, book):
       """check what shelf a user has a book on, if any"""
  
verification_info: {"golden_diff": "diff --git a/bookwyrm/templatetags/shelf_tags.py b/bookwyrm/templatetags/shelf_tags.py\n--- a/bookwyrm/templatetags/shelf_tags.py\n+++ b/bookwyrm/templatetags/shelf_tags.py\n@@ -1,5 +1,6 @@\n \"\"\" Filters and tags related to shelving books \"\"\"\n from django import template\n+from django.utils.translation import gettext_lazy as _\n \n from bookwyrm import models\n from bookwyrm.utils import cache\n@@ -32,6 +33,24 @@\n     return \"to-read\"\n \n \n+@register.filter(name=\"translate_shelf_name\")\n+def get_translated_shelf_name(shelf):\n+    \"\"\"produced translated shelf nidentifierame\"\"\"\n+    if not shelf:\n+        return \"\"\n+    # support obj or dict\n+    identifier = shelf[\"identifier\"] if isinstance(shelf, dict) else shelf.identifier\n+    if identifier == \"all\":\n+        return _(\"All books\")\n+    if identifier == \"to-read\":\n+        return _(\"To Read\")\n+    if identifier == \"reading\":\n+        return _(\"Currently Reading\")\n+    if identifier == \"read\":\n+        return _(\"Read\")\n+    return shelf[\"name\"] if isinstance(shelf, dict) else shelf.name\n+\n+\n @register.simple_tag(takes_context=True)\n def active_shelf(context, book):\n     \"\"\"check what shelf a user has a book on, if any\"\"\"\n", "issue": "localisation string for a shelf is missing\n**Describe the bug**\r\nA translation exists, but the string \"Currently reading\"\u00a0is shown in English language\r\n\r\n**To Reproduce**\r\nSwitch language to non-english and check book status\r\n\r\n**Expected behavior**\r\nTranslated string used instead of English\r\n\r\n**Screenshots**\r\n\r\n![image](https://user-images.githubusercontent.com/81133/151704062-a99581a4-a941-4c6c-815a-62c7fd4885f6.png)\r\n\r\n**Instance**\r\nhttps://ziurkes.group.lt\r\n\r\n\n", "before_files": [{"content": "\"\"\" Filters and tags related to shelving books \"\"\"\nfrom django import template\n\nfrom bookwyrm import models\nfrom bookwyrm.utils import cache\n\n\nregister = template.Library()\n\n\n@register.filter(name=\"is_book_on_shelf\")\ndef get_is_book_on_shelf(book, shelf):\n    \"\"\"is a book on a shelf\"\"\"\n    return cache.get_or_set(\n        f\"book-on-shelf-{book.id}-{shelf.id}\",\n        lambda b, s: s.books.filter(id=b.id).exists(),\n        book,\n        shelf,\n        timeout=15552000,\n    )\n\n\n@register.filter(name=\"next_shelf\")\ndef get_next_shelf(current_shelf):\n    \"\"\"shelf you'd use to update reading progress\"\"\"\n    if current_shelf == \"to-read\":\n        return \"reading\"\n    if current_shelf == \"reading\":\n        return \"read\"\n    if current_shelf == \"read\":\n        return \"complete\"\n    return \"to-read\"\n\n\n@register.simple_tag(takes_context=True)\ndef active_shelf(context, book):\n    \"\"\"check what shelf a user has a book on, if any\"\"\"\n    user = context[\"request\"].user\n    return cache.get_or_set(\n        f\"active_shelf-{user.id}-{book.id}\",\n        lambda u, b: (\n            models.ShelfBook.objects.filter(\n                shelf__user=u,\n                book__parent_work__editions=b,\n            ).first()\n            or False\n        ),\n        user,\n        book,\n        timeout=15552000,\n    ) or {\"book\": book}\n\n\n@register.simple_tag(takes_context=False)\ndef latest_read_through(book, user):\n    \"\"\"the most recent read activity\"\"\"\n    return cache.get_or_set(\n        f\"latest_read_through-{user.id}-{book.id}\",\n        lambda u, b: (\n            models.ReadThrough.objects.filter(user=u, book=b, is_active=True)\n            .order_by(\"-start_date\")\n            .first()\n            or False\n        ),\n        user,\n        book,\n        timeout=15552000,\n    )\n", "path": "bookwyrm/templatetags/shelf_tags.py"}]}