prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  bing_news can't parse other languages date
  When searching for french article, the time is noted as "Il y a 5 minutes", and so, doesn't match for the regex `"^[0-9]+ minute(s|) ago$"`.
  
  Do you see a way to internationalize this detection ?
  
  
  </issue>
  <code>
  [start of searx/engines/bing_news.py]
  1 ## Bing (News)
  2 #
  3 # @website     https://www.bing.com/news
  4 # @provide-api yes (http://datamarket.azure.com/dataset/bing/search),
  5 #              max. 5000 query/month
  6 #
  7 # @using-api   no (because of query limit)
  8 # @results     HTML (using search portal)
  9 # @stable      no (HTML can change)
  10 # @parse       url, title, content, publishedDate
  11 
  12 from urllib import urlencode
  13 from cgi import escape
  14 from lxml import html
  15 from datetime import datetime, timedelta
  16 from dateutil import parser
  17 import re
  18 
  19 # engine dependent config
  20 categories = ['news']
  21 paging = True
  22 language_support = True
  23 
  24 # search-url
  25 base_url = 'https://www.bing.com/'
  26 search_string = 'news/search?{query}&first={offset}'
  27 
  28 
  29 # do search-request
  30 def request(query, params):
  31     offset = (params['pageno'] - 1) * 10 + 1
  32 
  33     if params['language'] == 'all':
  34         language = 'en-US'
  35     else:
  36         language = params['language'].replace('_', '-')
  37 
  38     search_path = search_string.format(
  39         query=urlencode({'q': query, 'setmkt': language}),
  40         offset=offset)
  41 
  42     params['cookies']['SRCHHPGUSR'] = \
  43         'NEWWND=0&NRSLT=-1&SRCHLANG=' + language.split('-')[0]
  44 
  45     params['url'] = base_url + search_path
  46     return params
  47 
  48 
  49 # get response from search-request
  50 def response(resp):
  51     results = []
  52 
  53     dom = html.fromstring(resp.content)
  54 
  55     # parse results
  56     for result in dom.xpath('//div[@class="sn_r"]'):
  57         link = result.xpath('.//div[@class="newstitle"]/a')[0]
  58         url = link.attrib.get('href')
  59         title = ' '.join(link.xpath('.//text()'))
  60         contentXPath = result.xpath('.//div[@class="sn_txt"]/div'
  61                                     '//span[@class="sn_snip"]//text()')
  62         if contentXPath is not None:
  63             content = escape(' '.join(contentXPath))
  64 
  65         # parse publishedDate
  66         publishedDateXPath = result.xpath('.//div[@class="sn_txt"]/div'
  67                                           '//span[contains(@class,"sn_ST")]'
  68                                           '//span[contains(@class,"sn_tm")]'
  69                                           '//text()')
  70         if publishedDateXPath is not None:
  71             publishedDate = escape(' '.join(publishedDateXPath))
  72 
  73         if re.match("^[0-9]+ minute(s|) ago$", publishedDate):
  74             timeNumbers = re.findall(r'\d+', publishedDate)
  75             publishedDate = datetime.now()\
  76                 - timedelta(minutes=int(timeNumbers[0]))
  77         elif re.match("^[0-9]+ hour(s|) ago$", publishedDate):
  78             timeNumbers = re.findall(r'\d+', publishedDate)
  79             publishedDate = datetime.now()\
  80                 - timedelta(hours=int(timeNumbers[0]))
  81         elif re.match("^[0-9]+ hour(s|),"
  82                       " [0-9]+ minute(s|) ago$", publishedDate):
  83             timeNumbers = re.findall(r'\d+', publishedDate)
  84             publishedDate = datetime.now()\
  85                 - timedelta(hours=int(timeNumbers[0]))\
  86                 - timedelta(minutes=int(timeNumbers[1]))
  87         elif re.match("^[0-9]+ day(s|) ago$", publishedDate):
  88             timeNumbers = re.findall(r'\d+', publishedDate)
  89             publishedDate = datetime.now()\
  90                 - timedelta(days=int(timeNumbers[0]))
  91         else:
  92             try:
  93                 # FIXME use params['language'] to parse either mm/dd or dd/mm
  94                 publishedDate = parser.parse(publishedDate, dayfirst=False)
  95             except TypeError:
  96                 # FIXME
  97                 publishedDate = datetime.now()
  98 
  99         # append result
  100         results.append({'url': url,
  101                         'title': title,
  102                         'publishedDate': publishedDate,
  103                         'content': content})
  104 
  105     # return results
  106     return results
  107
  [end of searx/engines/bing_news.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/searx/engines/bing_news.py b/searx/engines/bing_news.py
  --- a/searx/engines/bing_news.py
  +++ b/searx/engines/bing_news.py
  @@ -39,8 +39,7 @@
           query=urlencode({'q': query, 'setmkt': language}),
           offset=offset)
   
  -    params['cookies']['SRCHHPGUSR'] = \
  -        'NEWWND=0&NRSLT=-1&SRCHLANG=' + language.split('-')[0]
  +    params['cookies']['_FP'] = "ui=en-US"
   
       params['url'] = base_url + search_path
       return params
  
verification_info: {"golden_diff": "diff --git a/searx/engines/bing_news.py b/searx/engines/bing_news.py\n--- a/searx/engines/bing_news.py\n+++ b/searx/engines/bing_news.py\n@@ -39,8 +39,7 @@\n         query=urlencode({'q': query, 'setmkt': language}),\n         offset=offset)\n \n-    params['cookies']['SRCHHPGUSR'] = \\\n-        'NEWWND=0&NRSLT=-1&SRCHLANG=' + language.split('-')[0]\n+    params['cookies']['_FP'] = \"ui=en-US\"\n \n     params['url'] = base_url + search_path\n     return params\n", "issue": "bing_news can't parse other languages date\nWhen searching for french article, the time is noted as \"Il y a 5 minutes\", and so, doesn't match for the regex `\"^[0-9]+ minute(s|) ago$\"`.\n\nDo you see a way to internationalize this detection ?\n\n", "before_files": [{"content": "## Bing (News)\n#\n# @website     https://www.bing.com/news\n# @provide-api yes (http://datamarket.azure.com/dataset/bing/search),\n#              max. 5000 query/month\n#\n# @using-api   no (because of query limit)\n# @results     HTML (using search portal)\n# @stable      no (HTML can change)\n# @parse       url, title, content, publishedDate\n\nfrom urllib import urlencode\nfrom cgi import escape\nfrom lxml import html\nfrom datetime import datetime, timedelta\nfrom dateutil import parser\nimport re\n\n# engine dependent config\ncategories = ['news']\npaging = True\nlanguage_support = True\n\n# search-url\nbase_url = 'https://www.bing.com/'\nsearch_string = 'news/search?{query}&first={offset}'\n\n\n# do search-request\ndef request(query, params):\n    offset = (params['pageno'] - 1) * 10 + 1\n\n    if params['language'] == 'all':\n        language = 'en-US'\n    else:\n        language = params['language'].replace('_', '-')\n\n    search_path = search_string.format(\n        query=urlencode({'q': query, 'setmkt': language}),\n        offset=offset)\n\n    params['cookies']['SRCHHPGUSR'] = \\\n        'NEWWND=0&NRSLT=-1&SRCHLANG=' + language.split('-')[0]\n\n    params['url'] = base_url + search_path\n    return params\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n\n    dom = html.fromstring(resp.content)\n\n    # parse results\n    for result in dom.xpath('//div[@class=\"sn_r\"]'):\n        link = result.xpath('.//div[@class=\"newstitle\"]/a')[0]\n        url = link.attrib.get('href')\n        title = ' '.join(link.xpath('.//text()'))\n        contentXPath = result.xpath('.//div[@class=\"sn_txt\"]/div'\n                                    '//span[@class=\"sn_snip\"]//text()')\n        if contentXPath is not None:\n            content = escape(' '.join(contentXPath))\n\n        # parse publishedDate\n        publishedDateXPath = result.xpath('.//div[@class=\"sn_txt\"]/div'\n                                          '//span[contains(@class,\"sn_ST\")]'\n                                          '//span[contains(@class,\"sn_tm\")]'\n                                          '//text()')\n        if publishedDateXPath is not None:\n            publishedDate = escape(' '.join(publishedDateXPath))\n\n        if re.match(\"^[0-9]+ minute(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now()\\\n                - timedelta(minutes=int(timeNumbers[0]))\n        elif re.match(\"^[0-9]+ hour(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now()\\\n                - timedelta(hours=int(timeNumbers[0]))\n        elif re.match(\"^[0-9]+ hour(s|),\"\n                      \" [0-9]+ minute(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now()\\\n                - timedelta(hours=int(timeNumbers[0]))\\\n                - timedelta(minutes=int(timeNumbers[1]))\n        elif re.match(\"^[0-9]+ day(s|) ago$\", publishedDate):\n            timeNumbers = re.findall(r'\\d+', publishedDate)\n            publishedDate = datetime.now()\\\n                - timedelta(days=int(timeNumbers[0]))\n        else:\n            try:\n                # FIXME use params['language'] to parse either mm/dd or dd/mm\n                publishedDate = parser.parse(publishedDate, dayfirst=False)\n            except TypeError:\n                # FIXME\n                publishedDate = datetime.now()\n\n        # append result\n        results.append({'url': url,\n                        'title': title,\n                        'publishedDate': publishedDate,\n                        'content': content})\n\n    # return results\n    return results\n", "path": "searx/engines/bing_news.py"}]}