sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Show source of translated content

Open StanFromIreland opened this issue 1 year ago • 2 comments

From a discussion in python-docs-pl

Suggestion by m-aciek

I envision this as a second link next to "Show source" titled "Show translation source".

Suggestion by rffrontelle

The best would be to show a translated reST file combining both documents, but last time I checked, this is not possible.

Suggestion by StanFromIreland

Would it be better to redirect to translation .po files [when a user in a /lang/ click on "Show Source"]?

StanFromIreland avatar Feb 05 '25 15:02 StanFromIreland

Current “Show source” with a link to GitHub in CPython docs is a customisation. Following this pattern “Show translation source” could also be a customisation.

Default Sphinx behaviour for the “Show source” is displaying a copy of the source document (see Page source at the bottom of Alabaster's docs).

For what it's worth the config toggles for “Show source” are html_copy_source and html_show_sourcelink.

m-aciek avatar Feb 07 '25 22:02 m-aciek

Sphinx doesn't require PO files to build a translation, it's enough to serve it with MO files. Therefore it's not guaranteed that PO files (files to include or link to) are available.

m-aciek avatar Nov 17 '25 12:11 m-aciek