-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations of formulas not working #980
Comments
Heya, you don't need to use
I believe this should work fine |
Hello Chris, I'm afraid that this doesn't provide the correct output either. When the "sphinx.transforms.i18n.Locale" is called and applied, the "apply" method of Sphinx "Locale" class inserts an additional character set Hope I'm on the right side, but this is what the debug trace shows me. If I understand it well, this issue may arise from the fact that Sphinx assumes that only RST parser is going to be used (which, in this case delivers a correct result) but this is not the case here. Thanks anyway to the attention you bring to this case. BRGDS, Bernard |
ok I see cheers, this PR comes to mind then sphinx-doc/sphinx#12238 which I think would fix it, should push that forward at some point |
EDIT:As per here below, I made a quick test and everything seems fine: translations happen correctly. Many thanks Chris ! INITIAL POST:Thanks Chris, I went through the PR comments and indeed believe that you pointed me in the right direction. Anyway, I will give a try testing this PR as I have a test environment at hand and give you a feedback. However, from what I read, it looks like implementation changes are required on both Sphinx & Myst-Parser sides. Right ? In this case, is there a specific PR/commit to apply for the Myst-Parser ? |
What version of
myst-parser
are you using?4.0.0
What version dependencies are you using?
Sphinx == 8.0.2;
docutils == 0.21.2
What operating system are you using?
Linux
Describe the Bug
Content of formulas is not translated, leading to empty formulas
Expected Behavior
Formulas content translated according to i18n language choice.
Note: FINDINGS added in TO REPRODUCE section
To Reproduce
index.md:
Test
index.rst:
Test
In local_root/locales/pt/LC_MESSAGES >
index.po
HTML result in "EN":
HTML result in "PT" (or any other language):
FINDINGS:
In /sphinx/transforms/i18n.py > line 391
Creates a msgstr:
which is then parsed by the Myst-Parser that parse it as a "block" returning the following list of tokens:
which gives a 'doc' variable content (/sphinx/transforms/i18n.py > line 74) with following childrens
and eventually leads doc[0] (in "publish_msgstr" : /sphinx/transforms/i18n.py > line 81) to return
::
which is obviously not in line with what Sphinx purposedly indicates:
" # literalblock need literal block notation to avoid it become
# paragraph."
Assuming that the section of the Sphinx code dealing with the prepending of
::
was added in commit 67dd1c0d from Takayuki SHIMIZUKAWA [email protected]Date: Sun Feb 22 18:30:45 2015 +0900
This might be something that has been kept hidden for some time
The text was updated successfully, but these errors were encountered: