prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Lost timeSince data for suggestions
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pootle/apps/pootle_misc/templatetags/locale.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 #
  3 # Copyright (C) Pootle contributors.
  4 #
  5 # This file is a part of the Pootle project. It is distributed under the GPL3
  6 # or later license. See the LICENSE file for a copy of the license and the
  7 # AUTHORS file for copyright and authorship information.
  8 
  9 from django import template
  10 from django.utils.formats import get_format
  11 from django.utils.translation import trans_real
  12 
  13 from pootle.core.utils import dateformat
  14 
  15 
  16 register = template.Library()
  17 
  18 
  19 @register.simple_tag
  20 def locale_dir():
  21     """Returns current locale's direction."""
  22     return trans_real.get_language_bidi() and "rtl" or "ltr"
  23 
  24 
  25 @register.filter(name='dateformat')
  26 def do_dateformat(value, use_format='c'):
  27     """Formats a `value` date using `format`.
  28 
  29     :param value: a datetime object.
  30     :param use_format: a format string accepted by
  31         :func:`django.utils.formats.get_format` or
  32         :func:`django.utils.dateformat.format`. If none is set, the current
  33         locale's default format will be used.
  34     """
  35     try:
  36         use_format = get_format(use_format)
  37     except AttributeError:
  38         pass
  39 
  40     return dateformat.format(value, use_format)
  41 
  42 
  43 @register.simple_tag
  44 def locale_align():
  45     """Returns current locale's default alignment."""
  46     return trans_real.get_language_bidi() and "right" or "left"
  47
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/pootle/apps/pootle_misc/templatetags/locale.py b/pootle/apps/pootle_misc/templatetags/locale.py
  --- a/pootle/apps/pootle_misc/templatetags/locale.py
  +++ b/pootle/apps/pootle_misc/templatetags/locale.py
  @@ -6,11 +6,14 @@
   # or later license. See the LICENSE file for a copy of the license and the
   # AUTHORS file for copyright and authorship information.
   
  +import calendar
  +
   from django import template
   from django.utils.formats import get_format
   from django.utils.translation import trans_real
   
   from pootle.core.utils import dateformat
  +from pootle.local.dates import timesince
   
   
   register = template.Library()
  @@ -40,6 +43,11 @@
       return dateformat.format(value, use_format)
   
   
  +@register.filter(name='relative_datetime_format')
  +def do_relative_datetime_format(value):
  +    return timesince(calendar.timegm(value.timetuple()))
  +
  +
   @register.simple_tag
   def locale_align():
       """Returns current locale's default alignment."""
  
verification_info: {"golden_diff": "diff --git a/pootle/apps/pootle_misc/templatetags/locale.py b/pootle/apps/pootle_misc/templatetags/locale.py\n--- a/pootle/apps/pootle_misc/templatetags/locale.py\n+++ b/pootle/apps/pootle_misc/templatetags/locale.py\n@@ -6,11 +6,14 @@\n # or later license. See the LICENSE file for a copy of the license and the\n # AUTHORS file for copyright and authorship information.\n \n+import calendar\n+\n from django import template\n from django.utils.formats import get_format\n from django.utils.translation import trans_real\n \n from pootle.core.utils import dateformat\n+from pootle.local.dates import timesince\n \n \n register = template.Library()\n@@ -40,6 +43,11 @@\n     return dateformat.format(value, use_format)\n \n \n+@register.filter(name='relative_datetime_format')\n+def do_relative_datetime_format(value):\n+    return timesince(calendar.timegm(value.timetuple()))\n+\n+\n @register.simple_tag\n def locale_align():\n     \"\"\"Returns current locale's default alignment.\"\"\"\n", "issue": "Lost timeSince data for suggestions\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nfrom django import template\nfrom django.utils.formats import get_format\nfrom django.utils.translation import trans_real\n\nfrom pootle.core.utils import dateformat\n\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef locale_dir():\n    \"\"\"Returns current locale's direction.\"\"\"\n    return trans_real.get_language_bidi() and \"rtl\" or \"ltr\"\n\n\n@register.filter(name='dateformat')\ndef do_dateformat(value, use_format='c'):\n    \"\"\"Formats a `value` date using `format`.\n\n    :param value: a datetime object.\n    :param use_format: a format string accepted by\n        :func:`django.utils.formats.get_format` or\n        :func:`django.utils.dateformat.format`. If none is set, the current\n        locale's default format will be used.\n    \"\"\"\n    try:\n        use_format = get_format(use_format)\n    except AttributeError:\n        pass\n\n    return dateformat.format(value, use_format)\n\n\n@register.simple_tag\ndef locale_align():\n    \"\"\"Returns current locale's default alignment.\"\"\"\n    return trans_real.get_language_bidi() and \"right\" or \"left\"\n", "path": "pootle/apps/pootle_misc/templatetags/locale.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimport calendar\n\nfrom django import template\nfrom django.utils.formats import get_format\nfrom django.utils.translation import trans_real\n\nfrom pootle.core.utils import dateformat\nfrom pootle.local.dates import timesince\n\n\nregister = template.Library()\n\n\n@register.simple_tag\ndef locale_dir():\n    \"\"\"Returns current locale's direction.\"\"\"\n    return trans_real.get_language_bidi() and \"rtl\" or \"ltr\"\n\n\n@register.filter(name='dateformat')\ndef do_dateformat(value, use_format='c'):\n    \"\"\"Formats a `value` date using `format`.\n\n    :param value: a datetime object.\n    :param use_format: a format string accepted by\n        :func:`django.utils.formats.get_format` or\n        :func:`django.utils.dateformat.format`. If none is set, the current\n        locale's default format will be used.\n    \"\"\"\n    try:\n        use_format = get_format(use_format)\n    except AttributeError:\n        pass\n\n    return dateformat.format(value, use_format)\n\n\n@register.filter(name='relative_datetime_format')\ndef do_relative_datetime_format(value):\n    return timesince(calendar.timegm(value.timetuple()))\n\n\n@register.simple_tag\ndef locale_align():\n    \"\"\"Returns current locale's default alignment.\"\"\"\n    return trans_real.get_language_bidi() and \"right\" or \"left\"\n", "path": "pootle/apps/pootle_misc/templatetags/locale.py"}]}