prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Handle Translation of the <title> tag
  Currently we can't really translate the `<title>` tag because our block doesn't allow a template to add a l20n ID to it.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `warehouse/i18n/l20n.py`
  Content:
  ```
  1 # Licensed under the Apache License, Version 2.0 (the "License");
  2 # you may not use this file except in compliance with the License.
  3 # You may obtain a copy of the License at
  4 #
  5 # http://www.apache.org/licenses/LICENSE-2.0
  6 #
  7 # Unless required by applicable law or agreed to in writing, software
  8 # distributed under the License is distributed on an "AS IS" BASIS,
  9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10 # See the License for the specific language governing permissions and
  11 # limitations under the License.
  12 
  13 import jinja2
  14 
  15 from markupsafe import Markup as M  # noqa
  16 
  17 from warehouse.filters import tojson
  18 
  19 
  20 _L20N_TEMPLATE = jinja2.Template(
  21     'data-l10n-id="{{ tid }}"'
  22     '{% if data %} data-l10n-args="{{ data }}"{% endif %}',
  23     autoescape=True,
  24 )
  25 
  26 
  27 def l20n(tid, **kwargs):
  28     data = tojson(kwargs) if kwargs else None
  29     return M(_L20N_TEMPLATE.render(tid=tid, data=data))
  30
  ```
  
  Path: `warehouse/i18n/__init__.py`
  Content:
  ```
  1 # Licensed under the Apache License, Version 2.0 (the "License");
  2 # you may not use this file except in compliance with the License.
  3 # You may obtain a copy of the License at
  4 #
  5 # http://www.apache.org/licenses/LICENSE-2.0
  6 #
  7 # Unless required by applicable law or agreed to in writing, software
  8 # distributed under the License is distributed on an "AS IS" BASIS,
  9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10 # See the License for the specific language governing permissions and
  11 # limitations under the License.
  12 
  13 from babel.core import Locale
  14 
  15 
  16 def _locale(request):
  17     """
  18     Computes a babel.core:Locale() object for this request.
  19     """
  20     return Locale.parse(request.locale_name)
  21 
  22 
  23 def includeme(config):
  24     # Add the request attributes
  25     config.add_request_method(_locale, name="locale", reify=True)
  26 
  27     # Register our i18n/l10n filters for Jinja2
  28     filters = config.get_settings().setdefault("jinja2.filters", {})
  29     filters.setdefault("format_date", "warehouse.i18n.filters:format_date")
  30     filters.setdefault(
  31         "format_datetime",
  32         "warehouse.i18n.filters:format_datetime",
  33     )
  34     filters.setdefault(
  35         "format_rfc822_datetime",
  36         "warehouse.i18n.filters:format_rfc822_datetime",
  37     )
  38 
  39     # Register our utility functions with Jinja2
  40     jglobals = config.get_settings().setdefault("jinja2.globals", {})
  41     jglobals.setdefault("l20n", "warehouse.i18n.l20n:l20n")
  42
  ```
  --- 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/warehouse/i18n/__init__.py b/warehouse/i18n/__init__.py
  --- a/warehouse/i18n/__init__.py
  +++ b/warehouse/i18n/__init__.py
  @@ -35,7 +35,3 @@
           "format_rfc822_datetime",
           "warehouse.i18n.filters:format_rfc822_datetime",
       )
  -
  -    # Register our utility functions with Jinja2
  -    jglobals = config.get_settings().setdefault("jinja2.globals", {})
  -    jglobals.setdefault("l20n", "warehouse.i18n.l20n:l20n")
  diff --git a/warehouse/i18n/l20n.py b/warehouse/i18n/l20n.py
  deleted file mode 100644
  --- a/warehouse/i18n/l20n.py
  +++ /dev/null
  @@ -1,29 +0,0 @@
  -# Licensed under the Apache License, Version 2.0 (the "License");
  -# you may not use this file except in compliance with the License.
  -# You may obtain a copy of the License at
  -#
  -# http://www.apache.org/licenses/LICENSE-2.0
  -#
  -# Unless required by applicable law or agreed to in writing, software
  -# distributed under the License is distributed on an "AS IS" BASIS,
  -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  -# See the License for the specific language governing permissions and
  -# limitations under the License.
  -
  -import jinja2
  -
  -from markupsafe import Markup as M  # noqa
  -
  -from warehouse.filters import tojson
  -
  -
  -_L20N_TEMPLATE = jinja2.Template(
  -    'data-l10n-id="{{ tid }}"'
  -    '{% if data %} data-l10n-args="{{ data }}"{% endif %}',
  -    autoescape=True,
  -)
  -
  -
  -def l20n(tid, **kwargs):
  -    data = tojson(kwargs) if kwargs else None
  -    return M(_L20N_TEMPLATE.render(tid=tid, data=data))
  
verification_info: {"golden_diff": "diff --git a/warehouse/i18n/__init__.py b/warehouse/i18n/__init__.py\n--- a/warehouse/i18n/__init__.py\n+++ b/warehouse/i18n/__init__.py\n@@ -35,7 +35,3 @@\n         \"format_rfc822_datetime\",\n         \"warehouse.i18n.filters:format_rfc822_datetime\",\n     )\n-\n-    # Register our utility functions with Jinja2\n-    jglobals = config.get_settings().setdefault(\"jinja2.globals\", {})\n-    jglobals.setdefault(\"l20n\", \"warehouse.i18n.l20n:l20n\")\ndiff --git a/warehouse/i18n/l20n.py b/warehouse/i18n/l20n.py\ndeleted file mode 100644\n--- a/warehouse/i18n/l20n.py\n+++ /dev/null\n@@ -1,29 +0,0 @@\n-# Licensed under the Apache License, Version 2.0 (the \"License\");\n-# you may not use this file except in compliance with the License.\n-# You may obtain a copy of the License at\n-#\n-# http://www.apache.org/licenses/LICENSE-2.0\n-#\n-# Unless required by applicable law or agreed to in writing, software\n-# distributed under the License is distributed on an \"AS IS\" BASIS,\n-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n-# See the License for the specific language governing permissions and\n-# limitations under the License.\n-\n-import jinja2\n-\n-from markupsafe import Markup as M  # noqa\n-\n-from warehouse.filters import tojson\n-\n-\n-_L20N_TEMPLATE = jinja2.Template(\n-    'data-l10n-id=\"{{ tid }}\"'\n-    '{% if data %} data-l10n-args=\"{{ data }}\"{% endif %}',\n-    autoescape=True,\n-)\n-\n-\n-def l20n(tid, **kwargs):\n-    data = tojson(kwargs) if kwargs else None\n-    return M(_L20N_TEMPLATE.render(tid=tid, data=data))\n", "issue": "Handle Translation of the <title> tag\nCurrently we can't really translate the `<title>` tag because our block doesn't allow a template to add a l20n ID to it.\n\n", "before_files": [{"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport jinja2\n\nfrom markupsafe import Markup as M  # noqa\n\nfrom warehouse.filters import tojson\n\n\n_L20N_TEMPLATE = jinja2.Template(\n    'data-l10n-id=\"{{ tid }}\"'\n    '{% if data %} data-l10n-args=\"{{ data }}\"{% endif %}',\n    autoescape=True,\n)\n\n\ndef l20n(tid, **kwargs):\n    data = tojson(kwargs) if kwargs else None\n    return M(_L20N_TEMPLATE.render(tid=tid, data=data))\n", "path": "warehouse/i18n/l20n.py"}, {"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom babel.core import Locale\n\n\ndef _locale(request):\n    \"\"\"\n    Computes a babel.core:Locale() object for this request.\n    \"\"\"\n    return Locale.parse(request.locale_name)\n\n\ndef includeme(config):\n    # Add the request attributes\n    config.add_request_method(_locale, name=\"locale\", reify=True)\n\n    # Register our i18n/l10n filters for Jinja2\n    filters = config.get_settings().setdefault(\"jinja2.filters\", {})\n    filters.setdefault(\"format_date\", \"warehouse.i18n.filters:format_date\")\n    filters.setdefault(\n        \"format_datetime\",\n        \"warehouse.i18n.filters:format_datetime\",\n    )\n    filters.setdefault(\n        \"format_rfc822_datetime\",\n        \"warehouse.i18n.filters:format_rfc822_datetime\",\n    )\n\n    # Register our utility functions with Jinja2\n    jglobals = config.get_settings().setdefault(\"jinja2.globals\", {})\n    jglobals.setdefault(\"l20n\", \"warehouse.i18n.l20n:l20n\")\n", "path": "warehouse/i18n/__init__.py"}], "after_files": [{"content": null, "path": "warehouse/i18n/l20n.py"}, {"content": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom babel.core import Locale\n\n\ndef _locale(request):\n    \"\"\"\n    Computes a babel.core:Locale() object for this request.\n    \"\"\"\n    return Locale.parse(request.locale_name)\n\n\ndef includeme(config):\n    # Add the request attributes\n    config.add_request_method(_locale, name=\"locale\", reify=True)\n\n    # Register our i18n/l10n filters for Jinja2\n    filters = config.get_settings().setdefault(\"jinja2.filters\", {})\n    filters.setdefault(\"format_date\", \"warehouse.i18n.filters:format_date\")\n    filters.setdefault(\n        \"format_datetime\",\n        \"warehouse.i18n.filters:format_datetime\",\n    )\n    filters.setdefault(\n        \"format_rfc822_datetime\",\n        \"warehouse.i18n.filters:format_rfc822_datetime\",\n    )\n", "path": "warehouse/i18n/__init__.py"}]}