Skip to content

Replace uses of shorthand codeblock syntax to avoid issues with localization #10969

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented May 27, 2025

Previously, many paragraphs in the documentation used :: at the end of a line as a replacement for a single colon (and :: on the following line). Due to this, the :: was part of the extracted string for localization. Weblate also showed a warning about the trailing ::, as it's not normally expected to be there.

This change requires translators to revalidate all modified strings. However, considering many of those have broken code blocks due to translators replacing :: with :, it can be a good idea.

This also adds documentation writing guidelines for code blocks and admonitions. This commit does not modify existing admonitions in any way (as this would lead to a much larger diff, and require more localizable text to be revalidated by translators).

@dalexeev
Copy link
Member

dalexeev commented May 28, 2025

It would be nice to restrict the usage of this feature at the CI level. I don't know if there is such an option in the reStructuredText linter. But even if not, we could use a simple Python script or Linux utility to search for the sequence ^.+::$ (or something like that, if there are false positives) in .rst files.

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

I may be misunderstanding how this syntax works but from what I do know...

…ization

Previously, many paragraphs in the documentation used `::` at the end of a line
as a replacement for a single colon (and `::` on the following line).
Due to this, the `::` was part of the extracted string for localization.
Weblate also showed a warning about the trailing `::`, as it's not
normally expected to be there.

This change requires translators to revalidate all modified strings.
However, considering many of those have broken code blocks due to translators
replacing `::` with `:`, it can be a good idea.

This also adds documentation writing guidelines for code blocks and admonitions.
This commit does not modify existing admonitions in any way (as this would
lead to a much larger diff, and require more localizable text to be revalidated
by translators).
@Calinou Calinou force-pushed the code-block-avoid-shorthand-syntax branch from d19d020 to 8a6ad4c Compare May 30, 2025 00:02
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.

3 participants