Re: Make code blocks translatable
Maciek Olko <[email protected]> Tue, 28 Jan 2020 01:02:19 +0100
| Newsgroups | gmane.comp.python.documentation |
|---|---|
| Message-ID | <CALYYG80+PnaOmp1x=yMuKiAfdXwQdKVb+M3_KHxor46+OAYOsA@mail.gmail.com> |
--===============2540040581040069551== Content-Type: multipart/alternative; boundary="0000000000000514ee059d27f168" --0000000000000514ee059d27f168 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 <[email protected]> napisa=C5=82= (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 <[email protected]> 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 th= is > code block from tutorial: > > > > # this is the first comment > > spam =3D 1 # and this is the second comment > > # ... and now a third! > > text =3D "# This is not a comment because it's inside quotes." > > > > To enable their translation, it requires slight modification of Sphinx > call =E2=80=93 gettext_additional_targets =3D ['literal-block'] configura= tion 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 i= n > docsbuild-scripts repository. > > > > Kind regards, > > Maciej > > _______________________________________________ > > Doc-SIG maillist - [email protected] > > https://mail.python.org/mailman/listinfo/doc-sig > > > > -- > Inada Naoki <[email protected]> > --0000000000000514ee059d27f168 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Thank you for response.</div><div><br></div><div>I gu= ess the tutorial is my main concern, because it especially (and maybe only = (?)) contains some documentation sentences in comments. Having those transl= ated would make a final step to native translated look and feel of tutorial= .</div><div><br></div><div>Would it be potentially possible to treat tutori= al differently and translate code blocks contained in it only?</div><div><b= r></div><div>Kind regards,</div><div>Maciej<br></div></div><br><div class= =3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">pon., 27 sty 2020 o = 05:15=C2=A0Inada Naoki <<a href=3D"mailto:[email protected]">songof= [email protected]</a>> napisa=C5=82(a):<br></div><blockquote class=3D"gma= il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2= 04,204);padding-left:1ex">I don't have a strong objection, but I think = translating sample code<br> is much less important than translating regular docs.<br> <br> For example, see <a href=3D"https://docs.python.org/3/library/functools.htm= l" rel=3D"noreferrer" target=3D"_blank">https://docs.python.org/3/library/f= unctools.html</a><br> There are many example code blocks.=C2=A0 Translating strings in them<br> doesn't help much.<br> <br> So I think focusing to regular doc is better for effort-benefit ratio.<br> <br> Regards,<br> <br> On Sun, Jan 26, 2020 at 7:31 AM Maciek Olko <<a href=3D"mailto:maciej.ol= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br> ><br> > Hello,<br> ><br> > I'd like to set up discussion about making code blocks in document= ation translatable. From my experience many of code blocks would benefit fr= om being translated. Especially comments and string literals. For example t= his code block from tutorial:<br> ><br> > # this is the first comment<br> > spam =3D 1=C2=A0 # and this is the second comment<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# ... and now a third!<br> > text =3D "# This is not a comment because it's inside quotes.= "<br> ><br> > To enable their translation, it requires slight modification of Sphinx= call =E2=80=93 gettext_additional_targets =3D ['literal-block'] co= nfiguration option value would do this. The option has been introduced in S= phinx 1.3.<br> ><br> > If there would be consensus about that I'd willingly add pull requ= est in docsbuild-scripts repository.<br> ><br> > Kind regards,<br> > Maciej<br> > _______________________________________________<br> > Doc-SIG maillist=C2=A0 -=C2=A0 <a href=3D"mailto:[email protected]" t= arget=3D"_blank">[email protected]</a><br> > <a href=3D"https://mail.python.org/mailman/listinfo/doc-sig" rel=3D"no= referrer" target=3D"_blank">https://mail.python.org/mailman/listinfo/doc-si= g</a><br> <br> <br> <br> -- <br> Inada Naoki=C2=A0 <<a href=3D"mailto:[email protected]" target=3D"_= blank">[email protected]</a>><br> </blockquote></div> --0000000000000514ee059d27f168-- --===============2540040581040069551== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Doc-SIG maillist - [email protected] https://mail.python.org/mailman/listinfo/doc-sig --===============2540040581040069551==--