prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fulah locale exposes _XXX_LAST_SUBMISSION_
  When in the Fulah (ff) locale, all pages expose the `_XXX_LAST_SUBMISSION_` text used to mangle timesince messages.
  
  ![screen shot 2017-05-11 at 19 58 59](https://cloud.githubusercontent.com/assets/647438/25966915/58d16d2e-3684-11e7-9eac-28fbe147a7ab.png)
  
  
  </issue>
  <code>
  [start of pootle/i18n/dates.py]
  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 datetime import datetime
  10 
  11 
  12 from .formatter import get_locale_formats
  13 
  14 
  15 def timesince(timestamp, locale=None):
  16     timedelta = datetime.now() - datetime.fromtimestamp(timestamp)
  17     return get_locale_formats(locale).timedelta(timedelta, format='long')
  18
  [end of pootle/i18n/dates.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/pootle/i18n/dates.py b/pootle/i18n/dates.py
  --- a/pootle/i18n/dates.py
  +++ b/pootle/i18n/dates.py
  @@ -8,10 +8,15 @@
   
   from datetime import datetime
   
  +from django.conf import settings
   
   from .formatter import get_locale_formats
   
   
   def timesince(timestamp, locale=None):
       timedelta = datetime.now() - datetime.fromtimestamp(timestamp)
  -    return get_locale_formats(locale).timedelta(timedelta, format='long')
  +    formatted = get_locale_formats(locale).timedelta(timedelta, format='long')
  +    if formatted:
  +        return formatted
  +    return get_locale_formats(
  +        settings.LANGUAGE_CODE).timedelta(timedelta, format='long')
  
verification_info: {"golden_diff": "diff --git a/pootle/i18n/dates.py b/pootle/i18n/dates.py\n--- a/pootle/i18n/dates.py\n+++ b/pootle/i18n/dates.py\n@@ -8,10 +8,15 @@\n \n from datetime import datetime\n \n+from django.conf import settings\n \n from .formatter import get_locale_formats\n \n \n def timesince(timestamp, locale=None):\n     timedelta = datetime.now() - datetime.fromtimestamp(timestamp)\n-    return get_locale_formats(locale).timedelta(timedelta, format='long')\n+    formatted = get_locale_formats(locale).timedelta(timedelta, format='long')\n+    if formatted:\n+        return formatted\n+    return get_locale_formats(\n+        settings.LANGUAGE_CODE).timedelta(timedelta, format='long')\n", "issue": "Fulah locale exposes _XXX_LAST_SUBMISSION_\nWhen in the Fulah (ff) locale, all pages expose the `_XXX_LAST_SUBMISSION_` text used to mangle timesince messages.\r\n\r\n![screen shot 2017-05-11 at 19 58 59](https://cloud.githubusercontent.com/assets/647438/25966915/58d16d2e-3684-11e7-9eac-28fbe147a7ab.png)\r\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 datetime import datetime\n\n\nfrom .formatter import get_locale_formats\n\n\ndef timesince(timestamp, locale=None):\n    timedelta = datetime.now() - datetime.fromtimestamp(timestamp)\n    return get_locale_formats(locale).timedelta(timedelta, format='long')\n", "path": "pootle/i18n/dates.py"}]}