executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
759 stars 196 forks source link

Message "inconsistent footnote references in translated message...." #884

Closed BravoBaldo closed 3 months ago

BravoBaldo commented 8 months ago

What version of myst-parser are you using?

2.0.0

What version dependencies are you using?

Docutils 0.19, Python 3.11.1, on win32 sphinx-7.2.6

What operating system are you using?

Windows

Describe the Bug

In translated documents footnotes does not reprouced and this error appears: WARNING: inconsistent footnote references in translated message. original: ['[^anothernote]'], translated: []

Sample.md

Expected Behavior

footnotes must be displayed in translated documents too!

To Reproduce

Steps:

Setup a fresh document

mkdir test_02 & cd test_02
sphinx-quickstart --sep -p TestBug -a BravoBaldo -r "0" -l "en" --extensions "myst_parser"
echo locale_dirs = ['locale/']            >> source\conf.py
Create and include a simple file called "Sample.md" with some footnotes (see attached Sample.md).

make singlehtml Result: all ok.

Internationalization:

cls & make clean & make gettext
sphinx-intl update -p build/gettext -l en -l it

make clean & sphinx-build -b singlehtml -D language=it ./source build/singlehtml/it

Result: Still ok.

Translate "source\locale\it\LC_MESSAGES\Sample.po" (is enough a little change)

Note: this means to fill a "msgstr" with a translation of matching "msgid" for example: msgid "Here's a simple footnote,[^1] and here's a longer one.[^bignote]" msgstr "XXXHere's a simple footnote,[^1] and here's a longer one.[^bignote]" (simply add "XXX") (Strangely, if the text is the same the bug does not occur!!)

make clean & sphinx-build -b singlehtml -D language=it ./source build/singlehtml/it

This error appears for each note: WARNING: inconsistent footnote references in translated message. original: ['[^anothernote]'], translated: [] and the footnote(s) are not displayed

welcome[bot] commented 8 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada: