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
I'm not quite sure how Sphinx's translation system works, sorry for the naive question.
It's nice to have the togglebutton_hint string configurable, but I'm not sure whether that's enough (or the right way) to make it translatable.
There are other Sphinx features like copyright, which have a conf.py option but also have special markup in the HTML template in order to be translatable. At least that's how I understand it ...
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
This seems to work outside the Sphinx translation mechanism, right?
I would prefer staying compatible with Sphinx's stuff and not reinvent translation.
well it's not using Sphinx's translation mechanism directly, but seems to be piggy-backing on the language that Sphinx sets in the environment. (note: I didn't implement that above, another contributor did, so I am trying to backwards engineer this as much as you are :-) )
Activity
welcome commentedon Oct 20, 2020
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! 🎉
choldgraf commentedon Oct 20, 2020
It should be translateable but is not currently.
I believe we'd need to use this pattern:
https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/topbar.html#L20
here:
https://github.com/executablebooks/sphinx-togglebutton/blob/master/sphinx_togglebutton/__init__.py#L16
(and access the
translatefunction in Python viacontext['translate'])mgeier commentedon Oct 20, 2020
The place I was referring to is https://github.com/sphinx-doc/sphinx/blob/0476e1cea93b587e3c0ab295aa20b2b9f0f81a34/sphinx/themes/basic/layout.html#L206 using the
transthingie.I don't know which is more appropriate here.
choldgraf commentedon Oct 20, 2020
ahh right - perhaps here is another pattern we could follow:
https://github.com/executablebooks/sphinx-copybutton/blob/master/sphinx_copybutton/_static/copybutton.js_t#L25
https://github.com/executablebooks/sphinx-copybutton/blob/master/sphinx_copybutton/_static/copybutton.js_t#L2
mgeier commentedon Oct 20, 2020
This seems to work outside the Sphinx translation mechanism, right?
I would prefer staying compatible with Sphinx's stuff and not reinvent translation.
choldgraf commentedon Oct 20, 2020
well it's not using
Sphinx's translation mechanism directly, but seems to be piggy-backing on the language that Sphinx sets in the environment. (note: I didn't implement that above, another contributor did, so I am trying to backwards engineer this as much as you are :-) )douden commentedon Jul 30, 2025
For a temporary fix, you can use the fork https://github.com/TeachBooks/sphinx-togglebutton by replacing
sphinx-togglebuttonbygit+https://github.com/TeachBooks/sphinx-togglebutton.gitin yourrequirements.txt.