Overriding admonition titles from conf.py? #13492
Unanswered
jason-sachs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't want to have any admonition titles by default in my project. I tried looking into the internationalization logic in Sphinx, and added a source/locales/en/LC_MESSAGES/sphinx.po file with content like this:
to see if the Note admonition would get translated, but it doesn't seem to work properly. (somehow I got it to work once through some unknown mechanism)
I looked into the source files (sorry I'm using Sphinx 5.0.2 and for various reasons it is important not to upgrade) and it looks like Sphinx's
locale.__init__.py
gets executed before the conf.py loads, and when I runpython -m sphinx.cmd.build source build
under a debugger, the call toinit_console()
gets the package locale directory and not my project's locale directory.This is all a moot point if there's a better way to override the default admonition titles via something in conf.py. But it seems like a bug.
For now I'm just going to monkeypatch locale.admonitionlabels from conf.py.
Beta Was this translation helpful? Give feedback.
All reactions