Overriding admonition titles from conf.py? #13492
              
                Unanswered
              
          
                  
                    
                      jason-sachs
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 3 comments
-
| Why not use the Generic Admonition? | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| 
 Because content (semantics) should be separated from presentation. Our team should be able to use  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| Rather than from   | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
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__.pygets executed before the conf.py loads, and when I runpython -m sphinx.cmd.build source buildunder 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