Skip to content

Commit

Permalink
Merge branch '5.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed May 29, 2022
2 parents 8d4a749 + 99f008b commit 60f69a6
Show file tree
Hide file tree
Showing 140 changed files with 5,883 additions and 5,538 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Dependencies
Incompatible changes
--------------------

* #10474: :confval:`language` does not accept ``None`` as it value. The default
value of ``language`` becomes to ``'en'`` now.

Deprecated
----------

Expand Down
6 changes: 4 additions & 2 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -725,14 +725,16 @@ documentation on :ref:`intl` for details.
(e.g. the German version of ``myfigure.png`` will be ``myfigure.de.png``
by default setting) and substitute them for original figures. In the LaTeX
builder, a suitable language will be selected as an option for the *Babel*
package. Default is ``None``, which means that no translation will be done.
package. Default is ``'en'``.

.. versionadded:: 0.5

.. versionchanged:: 1.4

Support figure substitution

.. versionchanged:: 5.0

Currently supported languages by Sphinx are:

* ``ar`` -- Arabic
Expand All @@ -745,7 +747,7 @@ documentation on :ref:`intl` for details.
* ``da`` -- Danish
* ``de`` -- German
* ``el`` -- Greek
* ``en`` -- English
* ``en`` -- English (default)
* ``eo`` -- Esperanto
* ``es`` -- Spanish
* ``et`` -- Estonian
Expand Down
11 changes: 11 additions & 0 deletions sphinx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ def read(cls, confdir: str, overrides: Dict = None, tags: Tags = None) -> "Confi
raise ConfigError(__("config directory doesn't contain a conf.py file (%s)") %
confdir)
namespace = eval_config_file(filename, tags)

# Note: Old sphinx projects have been configured as "langugae = None" because
# sphinx-quickstart previously generated this by default.
# To keep compatibility, they should be fallback to 'en' for a while
# (This conversion should not be removed before 2025-01-01).
if namespace.get("language", ...) is None:
logger.warning(__("Invalid configuration value found: 'language = None'. "
"Update your configuration to a valid langauge code. "
"Falling back to 'en' (English)."))
namespace["language"] = "en"

return cls(namespace, overrides or {})

def convert_overrides(self, name: str, value: Any) -> Any:
Expand Down
6 changes: 3 additions & 3 deletions sphinx/ext/imgconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def is_available(self) -> bool:
return True
except OSError as exc:
logger.warning(__(
f"Unable to run the image conversion command {self.config.image_converter!r}. "
"Unable to run the image conversion command %r. "
"'sphinx.ext.imgconverter' requires ImageMagick by default. "
"Ensure it is installed, or set the 'image_converter' option "
"to a custom conversion command.\n\n"
f'Traceback: {exc}'
))
"Traceback: %s"
), self.config.image_converter, exc)
return False
except CalledProcessError as exc:
logger.warning(__('convert exited with error:\n'
Expand Down
Binary file modified sphinx/locale/ar/LC_MESSAGES/sphinx.mo
Binary file not shown.
Loading

0 comments on commit 60f69a6

Please sign in to comment.