-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Docs: enable translations of code blocks #123407
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
Comments
Makes sense to me. Would you like to submit a PR? |
Sure! Here it is: #123408. |
…-123408) (cherry picked from commit 5332d98) Co-authored-by: Maciej Olko <[email protected]>
…-123408) (cherry picked from commit 5332d98) Co-authored-by: Maciej Olko <[email protected]>
Damned, I just noticed that, it broke the po syntax checker, the orthograph checker, the grammar checker, and sphinx-lint in python-docs-fr CI :D I'll have to find a way to disable it :D |
Sorry for that! Please see my comment in sphinx-lint. |
@JulienPalard My workaround for this issue is basically disabling 'literal-block', generating POT, updating PO, running all desired checkers, and then undoing this change in po files. Obviously, this workaround cannot be run before committing the changes. In shell script, this means something like: cd cpython/Doc
# comment (removing would work too)
sed -i "/^\s*'literal-block',/s/ '/ #'/" conf.py
# generate new po template files
make gettext
# update PO files from POT
sphinx-intl update --locale-dir path/to/pofiles --pot-dir build/gettext
# run the desired checkers
# finally, undo the changes
git -C path/to/pofiles checkout . p.s.: make gettext is available as of Python 3.12. |
Documentation
Code blocks, e.g. in the tutorial, include comments that are complement to the regular content of tutorial articles. An example in tutorial's introduction in section “Numbers”:
I'd like to propose changing gettext builder configuration by allowing
'literal-block'
element types translation.The topic previously was brought up on doc-sig mailing list without a conclusion.
Linked PRs
The text was updated successfully, but these errors were encountered: