Skip to content

gh-142714: Exclude stripped PEG grammar text from translation catalogs - #159305

Merged
StanFromIreland merged 3 commits into
python:mainfrom
Aurora-NICExq:gh-142714-peg-untranslatable
Oct 28, 2026
Merged

StanFromIreland merged 3 commits into
python:mainfrom
Aurora-NICExq:gh-142714-peg-untranslatable

Conversation

@Aurora-NICExq

@Aurora-NICExq Aurora-NICExq commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Apply PEGLexer's stripping to peg literal blocks before the i18n transform,
so the catalogs (and the text builder) only get what the rendered page shows.

This also stops the hidden rules from showing on translated pages, which
happens when the "rules for invalid syntax" comment is translated (as on
zh-tw).

@python-cla-bot

python-cla-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Oct 13, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@StanFromIreland

Copy link
Copy Markdown
Member

I proposed this before in #133868, and people weren’t happy.

Apply PEGLexer's stripping to peg literal blocks before the i18n transform,
so the catalogs (and the text builder) only get what the rendered page shows.

This also stops the hidden rules from showing on translated pages, which
happens when the "rules for invalid syntax" comment is translated (as on
zh-tw).
@Aurora-NICExq
Aurora-NICExq force-pushed the gh-142714-peg-untranslatable branch from c1ca056 to 10bd4a2 Compare October 14, 2026 07:02
@bedevere-app

bedevere-app Bot commented Oct 14, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Aurora-NICExq Aurora-NICExq changed the title gh-142714: Keep the PEG grammar out of the translation catalogs gh-142714: Strip hidden parts of the PEG grammar in all builders Oct 14, 2026
@Aurora-NICExq

Copy link
Copy Markdown
Contributor Author

Thanks. I've reworked the PR: it no longer excludes the grammar from
translation, it only strips the parts the page already hides. The comments are
still translatable, and it works the same for all builders.

@read-the-docs-community

Copy link
Copy Markdown

@StanFromIreland StanFromIreland changed the title gh-142714: Strip hidden parts of the PEG grammar in all builders gh-142714: Exclude stripped PEG grammar text from translation catalogs Oct 28, 2026
@StanFromIreland
StanFromIreland enabled auto-merge (squash) October 28, 2026 15:57
@StanFromIreland StanFromIreland added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 28, 2026
@StanFromIreland
StanFromIreland merged commit 19270d3 into python:main Oct 28, 2026
37 of 38 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @Aurora-NICExq for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 28, 2026

Copy link
Copy Markdown

GH-160833 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 28, 2026
@bedevere-app

bedevere-app Bot commented Oct 28, 2026

Copy link
Copy Markdown

GH-160834 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 28, 2026
StanFromIreland added a commit that referenced this pull request Oct 29, 2026
…catalogs (GH-159305) (#160833)

(cherry picked from commit 19270d3)

Co-authored-by: Aurora-NICExq <239583721+Aurora-NICExq@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland added a commit that referenced this pull request Oct 29, 2026
…catalogs (GH-159305) (#160834)

(cherry picked from commit 19270d3)

Co-authored-by: Aurora-NICExq <239583721+Aurora-NICExq@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants