[Doc-SIG] Make code blocks translatable

Maciek Olko maciej.olko at gmail.com
Mon Jan 27 19:02:19 EST 2020


Thank you for response.

I guess the tutorial is my main concern, because it especially (and maybe
only (?)) contains some documentation sentences in comments. Having those
translated would make a final step to native translated look and feel of
tutorial.

Would it be potentially possible to treat tutorial differently and
translate code blocks contained in it only?

Kind regards,
Maciej

pon., 27 sty 2020 o 05:15 Inada Naoki <songofacandy at gmail.com> napisał(a):

> I don't have a strong objection, but I think translating sample code
> is much less important than translating regular docs.
>
> For example, see https://docs.python.org/3/library/functools.html
> There are many example code blocks.  Translating strings in them
> doesn't help much.
>
> So I think focusing to regular doc is better for effort-benefit ratio.
>
> Regards,
>
> On Sun, Jan 26, 2020 at 7:31 AM Maciek Olko <maciej.olko at gmail.com> wrote:
> >
> > 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 comment
> > spam = 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
> > _______________________________________________
> > Doc-SIG maillist  -  Doc-SIG at python.org
> > https://mail.python.org/mailman/listinfo/doc-sig
>
>
>
> --
> Inada Naoki  <songofacandy at gmail.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/doc-sig/attachments/20200128/7d908c42/attachment.html>


More information about the Doc-SIG mailing list