-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Milestone
Description
Describe the bug
My sphinx build complains:
xxx.rst:: WARNING: rST localisation for language "zh" not found.
There is no way to suppress this, because the type and subtype here are both none:
def is_suppressed_warning(type: str, subtype: str, suppress_warnings: List[str]) -> bool:The warning comes from RstLanguageImporter in docutils (v0.17.1). There is a warning-suppresser in sphinx for LanguageImporter:
@contextmanager
def patched_get_language() -> Generator[None, None, None]:but the suppresser doesn't work for RstLanguageImporter.
I believe this is a bug. A simple fix can be patching RstLanguageImporter in patched_get_language as well.
How to Reproduce
$ git clone https://github.com/microsoft/nni
$ cd nni
$ git checkout 04781745b9986076591f43b9b7a47dc8e5b6f3de
$ pip install -r dependencies/develop.txt
$ pip install -r dependencies/required.txt
$ pip install -r dependencies/required_extra.txt
$ pip install -r dependencies/recommended.txt
$ cd docs
$ make -e SPHINXOPTS="-W --keep-going -T -D language='zh'" html
Expected behavior
The build should complete with no warning.
Your project
https://github.com/microsoft/nni/tree/04781745b9986076591f43b9b7a47dc8e5b6f3de/docs
Screenshots
OS
Ubuntu
Python version
3.8
Sphinx version
4.4.0
Sphinx extensions
No response
Extra tools
No response
Additional context
Note that I have custom extensions to handle i18n.
electric-coder
