We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
add languages to project detail page in wagtail (user manuals)
The titles of the user manuals or only in english and there are no fieldsfor translating them in wagtail. Is it possible to add the languages? :)
![grafik](https://user-images.githubusercontent.com/24652917/36986808-106f0bac-209b-11e8-9170-d48c83d42485.png)
![grafik](https://user-images.githubusercontent.com/24652917/36986822-1cda333a-209b-11e8-9af1-ed7b69386d5f.png)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `home/templatetags/base_tags.py`
Content:
```
1 import bleach
2 import feedparser
3 from dateutil import parser
4 from django import template
5 from django.conf import settings
6 
7 from home.models.snippets import NavigationMenu
8 
9 register = template.Library()
10 
11 
12 @register.assignment_tag(takes_context=True)
13 def get_site_root(context):
14     return context['request'].site.root_page
15 
16 
17 @register.inclusion_tag('tags/top_menu.html', takes_context=True)
18 def top_menu(context, parent, calling_page=None):
19     menuitems = parent.get_children().live().in_menu().specific()
20 
21     return {
22         'calling_page': calling_page,
23         'menuitems': menuitems,
24         'request': context['request'],
25     }
26 
27 
28 @register.inclusion_tag('includes/rss_import.html', takes_context=True)
29 def import_rss(context, rss_import):
30 
31     feeds = feedparser.parse(rss_import.url)
32     entries = feeds.entries[:2]
33 
34     result = []
35 
36     for entry in entries:
37         try:
38             published = parser.parse(entry["published"])
39         except Exception:
40             published = ''
41 
42         result.append({
43             'published': published,
44             'title': entry.title,
45             'link': entry.link,
46             'description': bleach.clean(entry.summary,
47                                         tags=[],
48                                         attributes={},
49                                         styles=[],
50                                         strip=True
51                                         )
52         }
53         )
54 
55     return {
56         'title': rss_import.translated_rss_title,
57         'entries': result
58     }
59 
60 
61 @register.assignment_tag(takes_context=False)
62 def load_site_menu(menu_name):
63     menu = NavigationMenu.objects.filter(menu_name=menu_name)
64 
65     if menu:
66         return menu[0].menu_items.all()
67     else:
68         return None
69 
70 
71 @register.filter(name='clear_class')
72 def clear_class(columns_per_row, count):
73     if (count-1) % (12/int(columns_per_row)) == 0:
74         return "m-clear"
75     else:
76         return ""
77 
78 
79 @register.simple_tag
80 def settings_value(name):
81     return getattr(settings, name, "")
82
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/home/templatetags/base_tags.py b/home/templatetags/base_tags.py
--- a/home/templatetags/base_tags.py
+++ b/home/templatetags/base_tags.py
@@ -3,12 +3,22 @@
 from dateutil import parser
 from django import template
 from django.conf import settings
+from django.core.exceptions import ObjectDoesNotExist
 
+from home.models.manual_pages import ManualsDetailPage
 from home.models.snippets import NavigationMenu
 
 register = template.Library()
 
 
+@register.assignment_tag(takes_context=True)
+def get_page_name(context, page):
+    try:
+        return ManualsDetailPage.objects.get(id=page.id).translated_title
+    except ObjectDoesNotExist:
+        return page
+
+
 @register.assignment_tag(takes_context=True)
 def get_site_root(context):
     return context['request'].site.root_page

{"golden_diff": "diff --git a/home/templatetags/base_tags.py b/home/templatetags/base_tags.py\n--- a/home/templatetags/base_tags.py\n+++ b/home/templatetags/base_tags.py\n@@ -3,12 +3,22 @@\n from dateutil import parser\n from django import template\n from django.conf import settings\n+from django.core.exceptions import ObjectDoesNotExist\n \n+from home.models.manual_pages import ManualsDetailPage\n from home.models.snippets import NavigationMenu\n \n register = template.Library()\n \n \n+@register.assignment_tag(takes_context=True)\n+def get_page_name(context, page):\n+    try:\n+        return ManualsDetailPage.objects.get(id=page.id).translated_title\n+    except ObjectDoesNotExist:\n+        return page\n+\n+\n @register.assignment_tag(takes_context=True)\n def get_site_root(context):\n     return context['request'].site.root_page\n", "issue": "add languages to project detail page in wagtail (user manuals)\nThe titles of the user manuals or only in english and there are no fieldsfor translating them in wagtail. Is it possible to add the languages? :)\r\n![grafik](https://user-images.githubusercontent.com/24652917/36986808-106f0bac-209b-11e8-9170-d48c83d42485.png)\r\n![grafik](https://user-images.githubusercontent.com/24652917/36986822-1cda333a-209b-11e8-9af1-ed7b69386d5f.png)\r\n\n", "before_files": [{"content": "import bleach\nimport feedparser\nfrom dateutil import parser\nfrom django import template\nfrom django.conf import settings\n\nfrom home.models.snippets import NavigationMenu\n\nregister = template.Library()\n\n\n@register.assignment_tag(takes_context=True)\ndef get_site_root(context):\n    return context['request'].site.root_page\n\n\n@register.inclusion_tag('tags/top_menu.html', takes_context=True)\ndef top_menu(context, parent, calling_page=None):\n    menuitems = parent.get_children().live().in_menu().specific()\n\n    return {\n        'calling_page': calling_page,\n        'menuitems': menuitems,\n        'request': context['request'],\n    }\n\n\n@register.inclusion_tag('includes/rss_import.html', takes_context=True)\ndef import_rss(context, rss_import):\n\n    feeds = feedparser.parse(rss_import.url)\n    entries = feeds.entries[:2]\n\n    result = []\n\n    for entry in entries:\n        try:\n            published = parser.parse(entry[\"published\"])\n        except Exception:\n            published = ''\n\n        result.append({\n            'published': published,\n            'title': entry.title,\n            'link': entry.link,\n            'description': bleach.clean(entry.summary,\n                                        tags=[],\n                                        attributes={},\n                                        styles=[],\n                                        strip=True\n                                        )\n        }\n        )\n\n    return {\n        'title': rss_import.translated_rss_title,\n        'entries': result\n    }\n\n\n@register.assignment_tag(takes_context=False)\ndef load_site_menu(menu_name):\n    menu = NavigationMenu.objects.filter(menu_name=menu_name)\n\n    if menu:\n        return menu[0].menu_items.all()\n    else:\n        return None\n\n\n@register.filter(name='clear_class')\ndef clear_class(columns_per_row, count):\n    if (count-1) % (12/int(columns_per_row)) == 0:\n        return \"m-clear\"\n    else:\n        return \"\"\n\n\n@register.simple_tag\ndef settings_value(name):\n    return getattr(settings, name, \"\")\n", "path": "home/templatetags/base_tags.py"}], "after_files": [{"content": "import bleach\nimport feedparser\nfrom dateutil import parser\nfrom django import template\nfrom django.conf import settings\nfrom django.core.exceptions import ObjectDoesNotExist\n\nfrom home.models.manual_pages import ManualsDetailPage\nfrom home.models.snippets import NavigationMenu\n\nregister = template.Library()\n\n\n@register.assignment_tag(takes_context=True)\ndef get_page_name(context, page):\n    try:\n        return ManualsDetailPage.objects.get(id=page.id).translated_title\n    except ObjectDoesNotExist:\n        return page\n\n\n@register.assignment_tag(takes_context=True)\ndef get_site_root(context):\n    return context['request'].site.root_page\n\n\n@register.inclusion_tag('tags/top_menu.html', takes_context=True)\ndef top_menu(context, parent, calling_page=None):\n    menuitems = parent.get_children().live().in_menu().specific()\n\n    return {\n        'calling_page': calling_page,\n        'menuitems': menuitems,\n        'request': context['request'],\n    }\n\n\n@register.inclusion_tag('includes/rss_import.html', takes_context=True)\ndef import_rss(context, rss_import):\n\n    feeds = feedparser.parse(rss_import.url)\n    entries = feeds.entries[:2]\n\n    result = []\n\n    for entry in entries:\n        try:\n            published = parser.parse(entry[\"published\"])\n        except Exception:\n            published = ''\n\n        result.append({\n            'published': published,\n            'title': entry.title,\n            'link': entry.link,\n            'description': bleach.clean(entry.summary,\n                                        tags=[],\n                                        attributes={},\n                                        styles=[],\n                                        strip=True\n                                        )\n        }\n        )\n\n    return {\n        'title': rss_import.translated_rss_title,\n        'entries': result\n    }\n\n\n@register.assignment_tag(takes_context=False)\ndef load_site_menu(menu_name):\n    menu = NavigationMenu.objects.filter(menu_name=menu_name)\n\n    if menu:\n        return menu[0].menu_items.all()\n    else:\n        return None\n\n\n@register.filter(name='clear_class')\ndef clear_class(columns_per_row, count):\n    if (count-1) % (12/int(columns_per_row)) == 0:\n        return \"m-clear\"\n    else:\n        return \"\"\n\n\n@register.simple_tag\ndef settings_value(name):\n    return getattr(settings, name, \"\")\n", "path": "home/templatetags/base_tags.py"}]}