mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Emit a warning if "language = None" setting found (refs: #10474)
This commit is contained in:
parent
a3d0983552
commit
8e353e3103
@ -168,6 +168,9 @@ class Config:
|
|||||||
# Resolve https://github.com/sphinx-doc/sphinx/issues/10474 where conf.py
|
# Resolve https://github.com/sphinx-doc/sphinx/issues/10474 where conf.py
|
||||||
# explicitly sets language to None, by coercing it to English.
|
# explicitly sets language to None, by coercing it to English.
|
||||||
if namespace.get("language", ...) is None:
|
if namespace.get("language", ...) is None:
|
||||||
|
logging.warning(__("Invalid configuration found: 'language = None'. "
|
||||||
|
"Now it takes only a string. Please update your configuration. "
|
||||||
|
"Fallback to 'en' (English)."))
|
||||||
namespace["language"] = "en"
|
namespace["language"] = "en"
|
||||||
warnings.warn("'None' is not a valid value for 'language', coercing to 'en'. "
|
warnings.warn("'None' is not a valid value for 'language', coercing to 'en'. "
|
||||||
"Update 'conf.py' to a valid language code to silence this "
|
"Update 'conf.py' to a valid language code to silence this "
|
||||||
|
Loading…
Reference in New Issue
Block a user