Repository navigation
bug: Sphinx button disappears in translated content #664
Description
Activity
@sneakers-the-rat do you have any guesses as to why a translated page would drop the
<a>and css and it converts the button to a<p>? It's a fairly odd bug.- addedbugSomething isn't working or is wrong in our content or buildSomething isn't working or is wrong in our content or buildtranslationsTranslation and localization of contentTranslation and localization of content
on May 19, 2026 no, that's weird, let me take a look
reported in 2022 executablebooks/sphinx-design#6 (comment)
still open: executablebooks/sphinx-design#96
there is allegedly some fix here, but it doesn't work for me - executablebooks/sphinx-design#175
but what i can confirm works is that if you just do the HTML manually and then update the .po files that it works fine.
i.e. instead of
```{button-link} https://github.com/pyOpenSci/python-package-guide#contributors- :color: primary :class: sd-rounded-pill float-left View guidebook contributors ```
you do
<a class="sd-sphinx-override sd-btn sd-text-wrap sd-btn-primary sd-rounded-pill float-left reference external" href="https://github.com/pyOpenSci/python-package-guide#contributors-"> View guidebook contributors </a>
then it works with the translations (but you need to update the .po files because the line numbers change slightly)
I think the longerterm fix is to ping the executablebooks folks on that open issue, monkeying around with docutils internals is above my paygrade/too frustrating for me to consider lol
Reacted by Felipe Moreno and Leah WasserAlright I am distractable today and I was curious why this would happen so I started reading how the sphinx gettext builder works so I'll work on a patch for this since I'd like to learn how to make sphinx things localizable
Reacted by Felipe Moreno and Leah Wassergot it!!! i think!!! executablebooks/sphinx-design#264

When you create a button in Sphinx, it renders well. However, if you try to translate the content and vie wthe translated content, the button disappears - see images below
packaging guide in english:
packaging guide translated into japanese

this seems to be an issue with buttons specifically.