Skip to content
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

Doc: content of availability directive lost in i18n #101845

Closed
jeanas opened this issue Feb 12, 2023 · 1 comment
Closed

Doc: content of availability directive lost in i18n #101845

jeanas opened this issue Feb 12, 2023 · 1 comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@jeanas
Copy link
Contributor

jeanas commented Feb 12, 2023

Bug report

See https://git.afpy.org/AFPy/python-docs-fr/issues/28

For example, take the os.getgid function. https://docs.python.org/3/library/os.html#os.getgid reads

"""
os.getgid()

Return the real group id of the current process.

Availability: Unix.

The function is a stub on Emscripten and WASI, see WebAssembly platforms for more information.
"""

However, the French translation reads

"""
os.getgid()

Renvoie l'identifiant de groupe réel du processus actuel.

Disponibilité : Unix.
"""

This is unexpected. When a paragraph is not translated yet, the original is normally shown. Here, it is dropped.

Not only does this lose content, but it leads to build failures when warnings are turned into errors because the translation can lose some references.

CC @tiran (commit e3b6ff1)

Linked PRs

@jeanas jeanas added the type-bug An unexpected behavior, bug, or error label Feb 12, 2023
@arhadthedev arhadthedev added the docs Documentation in the Doc dir label Feb 12, 2023
JulienPalard pushed a commit that referenced this issue Feb 12, 2023
pyspecific: Fix i18n for availability directive

If the directive has content, the previous code would nest paragraph
nodes from that content inside a general paragraph node, which confuses
Sphinx and leads it to drop the content when translating. Instead, use a
container node for the body.

Also use set_source_info so that any warnings have location info.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 12, 2023
…honGH-101846)

pyspecific: Fix i18n for availability directive

If the directive has content, the previous code would nest paragraph
nodes from that content inside a general paragraph node, which confuses
Sphinx and leads it to drop the content when translating. Instead, use a
container node for the body.

Also use set_source_info so that any warnings have location info.
(cherry picked from commit 6ef6915)

Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
miss-islington added a commit that referenced this issue Feb 12, 2023
pyspecific: Fix i18n for availability directive

If the directive has content, the previous code would nest paragraph
nodes from that content inside a general paragraph node, which confuses
Sphinx and leads it to drop the content when translating. Instead, use a
container node for the body.

Also use set_source_info so that any warnings have location info.
(cherry picked from commit 6ef6915)

Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
carljm added a commit to carljm/cpython that referenced this issue Feb 13, 2023
* main:
  pythongh-101810: Remove duplicated st_ino calculation (pythonGH-101811)
  pythongh-92547: Purge sqlite3_enable_shared_cache() detection from configure (python#101873)
  pythonGH-100987: Refactor `_PyInterpreterFrame` a bit, to assist generator improvement. (pythonGH-100988)
  pythonGH-87849: Simplify stack effect of SEND and specialize it for generators and coroutines. (pythonGH-101788)
  Correct trivial grammar in reset_mock docs (python#101861)
  pythongh-101845: pyspecific: Fix i18n for availability directive (pythonGH-101846)
  pythongh-89792: Limit test_tools freeze test build parallelism based on the number of cores (python#101841)
  pythongh-85984: Utilize new "winsize" functions from termios in pty tests. (python#101831)
  pythongh-89792: Prevent test_tools from copying 1000M of "source" in freeze test (python#101837)
  Fix typo in test_fstring.py (python#101823)
  pythonGH-101797: allocate `PyExpat_CAPI` capsule on heap (python#101798)
  pythongh-101390: Fix docs for `imporlib.util.LazyLoader.factory` to properly call it a class method (pythonGH-101391)
@hauntsaninja
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants