Fix gettext skipping MyST table cells inside tab-item - #306
Open
BetterAndBetterII wants to merge 1 commit into
Open
Fix gettext skipping MyST table cells inside tab-item#306BetterAndBetterII wants to merge 1 commit into
BetterAndBetterII wants to merge 1 commit into
Conversation
MyST sets source on the table node but not on cell paragraphs. During nested_parse of tab-item content, document.current_source is None, so Sphinx is_translatable skips those cells and they never appear in .pot. Propagate the table's source/line onto descendants after nested_parse. Fixes executablebooks#234
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MyST GFM table cells nested under
tab-itemwere omitted from gettext.potfiles (and therefore never translated), while the same table at document root extracted fine.Root cause: MyST sets
sourceon thetablenode but not on cell paragraphs. At document level those cells inheritdocument.current_source; duringtab-item'snested_parse, that isNone, so Sphinx'sis_translatableskips them.Fix: after
nested_parseof tab content, propagate the table'ssource/lineonto descendants that lack them.Fixes #234
Test plan
test_tab_table_i18n_gettext— UniqueHeader/UniqueCell msgids present in.pottest_tab_table_i18n_translated— German catalog renders translated cell text in HTMLtests/test_misc.py+ button/card suites still pass