Skip to content

Commit

Permalink
Merge branch '5.x' into 10280_return_typehints_in_docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Apr 3, 2022
2 parents 5953791 + 3361020 commit 59ff18f
Show file tree
Hide file tree
Showing 130 changed files with 6,726 additions and 6,412 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/transifex.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: 4.x
ref: 5.x
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: 4.x
ref: 5.x
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -69,6 +69,8 @@ Bugs fixed
functions are rendered as a string literal
* #10280: autodoc: :confval:`autodoc_docstring_signature` unexpectedly generates
return value typehint for constructors if docstring has multiple signatures
* #10214: html: invalid language tag was generated if :confval:`language`
contains a country code (ex. zh_CN)
* #10236: html search: objects are duplicated in search result
* #9962: texinfo: Deprecation message for ``@definfoenclose`` command on
bulding texinfo document
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions sphinx/builders/html/__init__.py
Expand Up @@ -7,7 +7,7 @@
import sys
from datetime import datetime
from os import path
from typing import IO, Any, Dict, Iterable, Iterator, List, Set, Tuple, Type
from typing import IO, Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Type
from urllib.parse import quote

from docutils import nodes
Expand Down Expand Up @@ -68,6 +68,17 @@ def get_stable_hash(obj: Any) -> str:
return md5(str(obj).encode()).hexdigest()


def convert_locale_to_language_tag(locale: Optional[str]) -> Optional[str]:
"""Convert a locale string to a language tag (ex. en_US -> en-US).
refs: BCP 47 (:rfc:`5646`)
"""
if locale:
return locale.replace('_', '-')
else:
return None


class Stylesheet(str):
"""A metadata of stylesheet.
Expand Down Expand Up @@ -510,7 +521,7 @@ def prepare_writing(self, docnames: Set[str]) -> None:
'file_suffix': self.out_suffix,
'link_suffix': self.link_suffix,
'script_files': self.script_files,
'language': self.config.language,
'language': convert_locale_to_language_tag(self.config.language),
'css_files': self.css_files,
'sphinx_version': __display_version__,
'sphinx_version_tuple': sphinx_version,
Expand Down
Binary file modified sphinx/locale/ar/LC_MESSAGES/sphinx.mo
Binary file not shown.
22 changes: 11 additions & 11 deletions sphinx/locale/ar/LC_MESSAGES/sphinx.po
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Sphinx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-03-20 00:16+0000\n"
"POT-Creation-Date: 2022-03-27 00:18+0000\n"
"PO-Revision-Date: 2013-04-02 08:44+0000\n"
"Last-Translator: Abdullah ahmed <Alhadab@hotmail.co.uk>, 2020\n"
"Language-Team: Arabic (http://www.transifex.com/sphinx-doc/sphinx-1/language/ar/)\n"
Expand Down Expand Up @@ -808,21 +808,21 @@ msgstr ""
msgid "Failed to compile regex in linkcheck_allowed_redirects: %r %s"
msgstr ""

#: sphinx/builders/manpage.py:30
#: sphinx/builders/manpage.py:29
#, python-format
msgid "The manual pages are in %(outdir)s."
msgstr ""

#: sphinx/builders/manpage.py:37
#: sphinx/builders/manpage.py:36
msgid "no \"man_pages\" config value found; no manual pages will be written"
msgstr ""

#: sphinx/builders/latex/__init__.py:291 sphinx/builders/manpage.py:48
#: sphinx/builders/latex/__init__.py:291 sphinx/builders/manpage.py:45
#: sphinx/builders/singlehtml.py:153 sphinx/builders/texinfo.py:101
msgid "writing"
msgstr ""

#: sphinx/builders/manpage.py:59
#: sphinx/builders/manpage.py:56
#, python-format
msgid "\"man_pages\" config value references unknown document %s"
msgstr ""
Expand Down Expand Up @@ -3360,12 +3360,12 @@ msgid "search"
msgstr "بحث"

#: sphinx/themes/basic/search.html:48
#: sphinx/themes/basic/static/searchtools.js:306
#: sphinx/themes/basic/static/searchtools.js:302
msgid "Search Results"
msgstr "نتائج البحث"

#: sphinx/themes/basic/search.html:50
#: sphinx/themes/basic/static/searchtools.js:308
#: sphinx/themes/basic/static/searchtools.js:304
msgid ""
"Your search did not match any documents. Please make sure that all words are"
" spelled correctly and that you've selected enough categories."
Expand Down Expand Up @@ -3431,12 +3431,12 @@ msgstr ""
msgid "Preparing search..."
msgstr ""

#: sphinx/themes/basic/static/searchtools.js:310
#: sphinx/themes/basic/static/searchtools.js:306
#, python-format
msgid "Search finished, found %s page(s) matching the search query."
msgstr ""

#: sphinx/themes/basic/static/searchtools.js:365
#: sphinx/themes/basic/static/searchtools.js:361
msgid ", in "
msgstr ""

Expand Down Expand Up @@ -3548,12 +3548,12 @@ msgid ""
"not in the domain."
msgstr ""

#: sphinx/util/docutils.py:225
#: sphinx/util/docutils.py:249
#, python-format
msgid "unknown directive or role name: %s:%s"
msgstr ""

#: sphinx/util/docutils.py:515
#: sphinx/util/docutils.py:539
#, python-format
msgid "unknown node type: %r"
msgstr ""
Expand Down
4 changes: 1 addition & 3 deletions sphinx/locale/bg/LC_MESSAGES/sphinx.js
Expand Up @@ -30,16 +30,14 @@ Documentation.addTranslations({
"Next topic": "",
"Other changes": "",
"Overview": "",
"Permalink to this definition": "",
"Permalink to this headline": "",
"Please activate JavaScript to enable the search\n functionality.": "",
"Preparing search...": "",
"Previous topic": "",
"Quick search": "",
"Search": "",
"Search Page": "",
"Search Results": "",
"Search finished, found %s page(s) matching the search query.": "",
"Search finished, found ${resultCount} page(s) matching the search query.": "",
"Search within %(docstitle)s": "",
"Searching": "",
"Searching for multiple words only shows matches that contain\n all words.": "",
Expand Down
Binary file modified sphinx/locale/bg/LC_MESSAGES/sphinx.mo
Binary file not shown.

0 comments on commit 59ff18f

Please sign in to comment.