[Doc-SIG] Make code blocks translatable

Maciek Olko maciej.olko at gmail.com
Sat Jan 25 17:31:26 EST 2020


Hello,

I'd like to set up discussion about making code blocks in documentation
translatable. From my experience many of code blocks would benefit from
being translated. Especially comments and string literals. For example this
code block from tutorial:

# this is the first commentspam = 1  # and this is the second comment
          # ... and now a third!text = "# This is not a comment
because it's inside quotes."

To enable their translation, it requires slight modification of Sphinx call
– gettext_additional_targets = ['literal-block'] configuration option value
would do this. The option has been introduced in Sphinx 1.3.

If there would be consensus about that I'd willingly add pull request
in docsbuild-scripts repository.

Kind regards,
Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/doc-sig/attachments/20200125/2bd8f868/attachment.html>


More information about the Doc-SIG mailing list