Skip to content

gh-123407: Docs: enable translations of code blocks #123408

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

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

m-aciek
Copy link
Contributor

@m-aciek m-aciek commented Aug 27, 2024

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we confirm that the new text shows up in gettext builds?

A

@m-aciek
Copy link
Contributor Author

m-aciek commented Aug 28, 2024

Yes, I've run it locally and got code blocks put in the POT files, e.g.

#: ../../tutorial/introduction.rst:76
msgid ">>> 17 / 3  # classic division returns a float\n"
"5.666666666666667\n"
">>>\n"
">>> 17 // 3  # floor division discards the fractional part\n"
"5\n"
">>> 17 % 3  # the % operator returns the remainder of the division\n"
"2\n"
">>> 5 * 3 + 2  # floored quotient * divisor + remainder\n"
"17"
msgstr ""

in tutorial/introduction.pot

@AA-Turner
Copy link
Member

If this turns out to be too annoying for translators, we can revert it later. But it's worth a try!

A

@AA-Turner AA-Turner merged commit 5332d98 into python:main Aug 31, 2024
32 checks passed
@miss-islington-app
Copy link

Thanks @m-aciek for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 31, 2024
@bedevere-app
Copy link

bedevere-app bot commented Aug 31, 2024

GH-123530 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 31, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 31, 2024
@bedevere-app
Copy link

bedevere-app bot commented Aug 31, 2024

GH-123531 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Aug 31, 2024
AA-Turner pushed a commit that referenced this pull request Aug 31, 2024
…) (#123531)

gh-123407: Enable translating literal and code blocks (GH-123408)
(cherry picked from commit 5332d98)

Co-authored-by: Maciej Olko <[email protected]>
AA-Turner pushed a commit that referenced this pull request Aug 31, 2024
…) (#123530)

gh-123407: Enable translating literal and code blocks (GH-123408)
(cherry picked from commit 5332d98)

Co-authored-by: Maciej Olko <[email protected]>
@m-aciek m-aciek deleted the docs-translate-literal-blocks branch August 31, 2024 08:18
@m-aciek
Copy link
Contributor Author

m-aciek commented Aug 31, 2024

👍 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: enable translations of code blocks
3 participants