Many thanks. This works wonderfully!

As a side note, I think that Python is not "every language". This is
the default language in Sphinx. Anyway, I understand that this is not
implemented, and this can be solved manually.
I'll add this answer to my question on stackoverflow (with the
reference to you and to this mailing list).

Cheers,
Yaroslav

2020-05-03 16:02 GMT+03:00, Matt from Documatt <[email protected]>:
> It's impossible. Sphinx will have to understand comments in every language.
>
> If you want to translate comments in code-block (and literal blocks after
> ::), you must translate them all. Add gettext_additional_targets =
> ["literal-block"] to your conf.py and re-run POT/PO update.
>
> Matt
>
> On Sun, May 3, 2020 at 2:25 PM Yaroslav Nikitenko <[email protected]>
> wrote:
>
>> Hello,
>>
>> I have code examples in the documentation (defined as code-blocks,
>> both literally included and just typed inline). In these code examples
>> there are comments, but when I produce documentation translation, they
>> are not extracted into .po files, and obviously are not translated.
>>
>> How can I translate these comments in code examples?
>>
>> I asked this on stackoverflow, there is an example of a code block if
>> really needed (
>> https://stackoverflow.com/questions/61248191/how-to-translate-comments-in-code-blocks-using-sphinx
>> ).
>>
>> Many thanks.
>>
>> Best regards,
>> Yaroslav Nikitenko
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sphinx-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sphinx-users/CA%2BRLzGAzko4FA2VJ6qHioU-uV%3D4kxisgRYhOPCUapqJX8cZ8ww%40mail.gmail.com
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sphinx-users/CAOGNDW_CwLjTh-LC9mAh5a3M6Cf-QXRkE-7aJKtuu%3D%2B7%2B%3DyMQg%40mail.gmail.com.
>


-- 
С уважением,
Ярослав Никитенко
http://twitter.com/ynikitenko
http://vk.com/yaroslav.nikitenko
http://facebook.com/ynikitenko
+7 916 743 3759

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CA%2BRLzGCkuW9pEFu6HMo5ekGwXxmTocJcg16fQqdUF8vLALxh6A%40mail.gmail.com.

Reply via email to