Make code blocks translatable
Maciek Olko <[email protected]> Sat, 25 Jan 2020 23:31:26 +0100
| Newsgroups | gmane.comp.python.documentation |
|---|---|
| Message-ID | <CALYYG831_KAcKC9oE90j79zYTaLmbgzHzDu4y2w4WN5WCbv20g@mail.gmail.com> |
--===============7840953487915995858==
Content-Type: multipart/alternative; boundary="0000000000003e8f3c059cfe7036"
--0000000000003e8f3c059cfe7036
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 =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'] configuration op=
tion 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
--0000000000003e8f3c059cfe7036
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div dir=3D"ltr">Hello,<div><br></div><div>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. Especi=
ally comments and string literals. For example this code block from tutoria=
l:</div><div><pre style=3D"overflow-x:auto;overflow-y:hidden;padding:5px;ba=
ckground-color:rgb(238,255,204);color:rgb(51,51,51);line-height:18.52799987=
7929688px;border:1px solid rgb(170,204,153);font-family:monospace,sans-seri=
f;font-size:15.4399995803833px;border-top-left-radius:3px;border-top-right-=
radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><s=
pan class=3D"gmail-c1" style=3D"color:rgb(64,128,144);font-style:italic"># =
this is the first comment</span>
<span class=3D"gmail-n">spam</span> <span class=3D"gmail-o" style=3D"color:=
rgb(102,102,102)">=3D</span> <span class=3D"gmail-mi" style=3D"color:rgb(32=
,128,80)">1</span> <span class=3D"gmail-c1" style=3D"color:rgb(64,128,144)=
;font-style:italic"># and this is the second comment</span>
<span class=3D"gmail-c1" style=3D"color:rgb(64,128,144);font-styl=
e:italic"># ... and now a third!</span>
<span class=3D"gmail-n">text</span> <span class=3D"gmail-o" style=3D"color:=
rgb(102,102,102)">=3D</span> <span class=3D"gmail-s2" style=3D"color:rgb(64=
,112,160)">"# This is not a comment because it's inside quotes.&qu=
ot;</span></pre></div><div>To enable their translation, it requires slight =
modification of Sphinx call =E2=80=93=C2=A0<font face=3D"monospace">gettext=
_additional_targets =3D=C2=A0['literal-block']</font> configuration=
option value would do this. The option has been introduced in Sphinx 1.3.<=
br></div><div><br></div><div>If there would be consensus about that I'd=
willingly add pull request in=C2=A0docsbuild-scripts repository.</div><div=
><br></div><div>Kind regards,</div><div>Maciej</div></div></div></div></div=
></div></div>
--0000000000003e8f3c059cfe7036--
--===============7840953487915995858==
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
--===============7840953487915995858==--