<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="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. Especially comments and string literals. For example this code block from tutorial:</div><div><pre style="overflow-x:auto;overflow-y:hidden;padding:5px;background-color:rgb(238,255,204);color:rgb(51,51,51);line-height:18.527999877929688px;border:1px solid rgb(170,204,153);font-family:monospace,sans-serif;font-size:15.4399995803833px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><span class="gmail-c1" style="color:rgb(64,128,144);font-style:italic"># this is the first comment</span>
<span class="gmail-n">spam</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-mi" style="color:rgb(32,128,80)">1</span>  <span class="gmail-c1" style="color:rgb(64,128,144);font-style:italic"># and this is the second comment</span>
          <span class="gmail-c1" style="color:rgb(64,128,144);font-style:italic"># ... and now a third!</span>
<span class="gmail-n">text</span> <span class="gmail-o" style="color:rgb(102,102,102)">=</span> <span class="gmail-s2" style="color:rgb(64,112,160)">"# This is not a comment because it's inside quotes."</span></pre></div><div>To enable their translation, it requires slight modification of Sphinx call – <font face="monospace">gettext_additional_targets = ['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 docsbuild-scripts repository.</div><div><br></div><div>Kind regards,</div><div>Maciej</div></div></div></div></div></div></div>