Closes #587. The issue points to the relevant sphinx source,
where it can be seen sphinx "marks" translated strings with <translated> at the
end of the source_path argument, which is then stored as the current_source attribute of
the docutils.nodes.document class, which is the second argument of Parser.parse.
This adds an extra condition to fall back to myst-parser which allows using myst-nb with translated
content.
It would be nice to add some test for this but I am not familiar enough with the test suite yet,
I'll try to add one in the coming days. It can probably reuse one of the existing notebooks,
but it will be necessary to add a locale folder with the translations, will it be ok to add
it directly in the tests folder?
So far I have only checked it works locally on a couple repos I had
(both executing and not executing notebooks).
I won't include this in the current patch release, as I don't have enough bandwidth to avoid blocking the Jupyter Book release that needs to follow. I'll circle back around to this PR soon :)
Closes #587. The issue points to the relevant sphinx source, where it can be seen sphinx "marks" translated strings with
<translated>
at the end of thesource_path
argument, which is then stored as thecurrent_source
attribute of thedocutils.nodes.document
class, which is the second argument ofParser.parse
.This adds an extra condition to fall back to myst-parser which allows using myst-nb with translated content.
It would be nice to add some test for this but I am not familiar enough with the test suite yet, I'll try to add one in the coming days. It can probably reuse one of the existing notebooks, but it will be necessary to add a
locale
folder with the translations, will it be ok to add it directly in thetests
folder?So far I have only checked it works locally on a couple repos I had (both executing and not executing notebooks).