You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The strings are correctly extracted with the gettext builder (make gettext), but when the base language is not English, and the translated language is English, the translation catalog is not used. It works as expected when translating in another language than English (for example from French to German).
The English language was hardcoded to load empty translations for
templates as part of sphinx-doc#10067,
but the rest of the code is already capable of handling missing
translations just fine, so we can simply drop the first if block.
This allows to use translations for English in custom templates, as for
all the other languages.
Fixessphinx-doc#12214
Describe the bug
When using custom template overrides as described in https://www.sphinx-doc.org/en/master/development/templating.html
If the template contains translated strings, for instance:
The strings are correctly extracted with the gettext builder (
make gettext
), but when the base language is not English, and the translated language is English, the translation catalog is not used. It works as expected when translating in another language than English (for example from French to German).How to Reproduce
I made a reproducer in this git repo: https://github.com/n-peugnet/sphinx-template-en-translation-bug or this zip:
sphinx-template-en-translation-bug-main.zip
Then check the content of
_build/html/index.html
Environment Information
Sphinx is latest git version:
v7.2.6-318-gd5baa46d8
Sphinx extensions
No response
Additional context
Notice that running
make html O=-Dlanguage=de
produces the expected result.The text was updated successfully, but these errors were encountered: