Repository navigation
Closed
Description
Hi @chrisjsewell I would like to ask if this something which can be fixed in v0.4.0, or do you have any workaround/solution? :)
What I've found problematic for me is that the internationalization is not working for buttons - translated button changes to text (sphinx-panels has the same problem). Maybe I'm missing something to make it work for buttons?
Here I've build an example:
| source page in English | translated page in Polish |
|---|---|
![]() |
![]() |
button
source page with button in English
translation of button from English to Polish
#: ../../index.rst:19 645df2e517a14ebe83fd8f2aa81331dd
msgid "Example button"
msgstr "Przykładowy przycisk"
translated page with button in Polish
badge
source page with badge in English
translation of badge from English to Polish
#: ../../index.rst:34 3651548d5be74a61ac96278b1ec9998d
msgid ":bdg-link-primary-line:`Example badge <https://example.com>`"
msgstr ":bdg-link-primary-line:`Przykładowa odznaka <https://example.com>`"
translated page with badge in Polish
Originally posted by @damian-krawczyk in #6 (comment)
Reacted by Julian Groß
Metadata
Metadata
Assignees
Labels
No labels


Activity
welcome commentedon Aug 23, 2022
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! 🎉
chrisjsewell commentedon Aug 23, 2022
Heya, well I'm happy to take PRs 🙏, but I'm not sure if will get round to figuring it out myself so soon
jpmckinney commentedon Dec 8, 2022
I thought maybe the extra
inlinemight have been causing issues but even with code like (breaks buttons that contain non-plaintext - just for testing):The above code generates what Sphinx references tend to look like, for the source (English) language:
But using @damian-krawczyk's project as an example, the
referenceseems to get entirely eliminated and only the text node is rendered in the translation...jpmckinney commentedon Dec 8, 2022
Also, I don't know why Sphinx extracts
:bdg-link-primary-line:as part of the translatable message for the badge.ferrine commentedon Jul 14, 2023
Is there any progress on this?
sneakers-the-rat commentedon May 19, 2026
as a temporary workaround, just using the generated html directly fixes the problem: pyOpenSci/python-package-guide#664 (comment)
but that's pretty janky. I don't know docutils internals well enough to know what's going wrong with i18n here - the .po files seem to correctly extract the link text, it's just the outer DOM elements that get wreck'd
🐛 FIX: keep buttons intact under gettext translation
🐛 FIX: keep buttons intact under gettext translation
🐛 FIX: keep buttons intact under gettext translation
🐛 Keep buttons intact under gettext translation (#270)