sphinx-doc / sphinx-doc-translations

translated docs for sphinx official document
Other
21 stars 16 forks source link

Sphinx theme shown in English for translated Sphinx docs #47

Open rffontenelle opened 3 weeks ago

rffontenelle commented 3 weeks ago

Texts from Sphinx themes are not available for translation and are shown in English in every translated Sphinx doc. This impacts the texts Documentation » from upper navigation bar, and On this page and Site navigation (from sidebar).

Their source file is in doc/_themes/sphinx13/layout.html. Note that Documentation is not marked for translation, but On this page and Site navigation are, still it is not extracted for translation in Sphinx UI or docs.

The Sphinx docs' layout.html file extends sphinx/themes/basic/layout.html, which has its strings included for translation in Sphinx UI. The aforementioned strings shown in Sphinx theme are exclusive from doc/_themes/sphinx13/layout.html

image

humitos commented 3 weeks ago

Note that Documentation is not marked for translation,

If it's not marked as translatable, there isn't too much that we can do at build time here. We need to update the Sphinx code and mark that string translatable as the first step. Then, update the .po file with the translated strings.

but On this page and Site navigation are, still it is not extracted for translation in Sphinx UI or docs.

These strings are not translated in any of the Portuguese variations, that's why they are not translated in the built documentation. They don't appear in any of the following files:

The solution for these is to update the translations from the source language and translate those strings after that.

rffontenelle commented 3 weeks ago

The POT and PO files are updated daily, so it means that even strings marked for translation are not actually extracted from source files. I assume the Sphinx docs' string extraction should be adjusted to extract from doc/_themes/sphinx13/layout.html as well, just like Sphinx UI extract from sphinx/themes/basic/layout.html. Homework to do... Thanks!