This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [argparse] Missing translations
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jdetrey, paul.j3, rhettinger, terry.reedy
Priority: normal Keywords: patch

Created on 2021-08-08 14:12 by jdetrey, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 27668 open jdetrey, 2021-08-08 14:40
Messages (3)
msg399216 - (view) Author: Jérémie Detrey (jdetrey) * Date: 2021-08-08 14:12
Dear all,

There are a few strings in the `argparse` module which are not translatable through the `gettext` API.

Some have already been reported:
- the "--version" help text at Lib/argparse.py:1105 (reported in issue 16786, fixed by PR 12711);
- the "default" help text at Lib/argparse.py:697 (reported in 33775, fixed by PR 12711).

However, some others remain:
- the "default" help text for `BooleanOptionalAction` at Lib/argparse.py:878 (which, incidentally, will be duplicated when used with `ArgumentDefaultsHelpFormatter`);
- the "argument %(argument_name)s: %(message)s" error message at Lib/argparse.py:751;
- the formatted section heading at Lib/argparse.py:225: if the heading itself is translatable, the string "%(heading)s:" is not. More precisely, the colon right after the heading might also require localization, as some languages (e.g., French) typeset colons with a preceding non-breaking space (i.e., "%(heading)s :"). (Okay, I'll admit that this is nitpicking!)

I'll submit a pull request with proposed fixes for these strings.

Kind regards,
Jérémie.
msg399569 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-08-13 22:52
Same comment as for #44964, plus note that 3.8 and before only get security patches.  Also, 3.9,3.10 only get bug fixes and I don't know if this qualifies.
msg400227 - (view) Author: Jérémie Detrey (jdetrey) * Date: 2021-08-24 19:08
Hi again!

As for #44864, I've just added a short blurb to the PR.

The fact that a few strings are missing calls to the localization function (whereas most of the other strings in `argparse` are already localized) might push this issue toward the bug-fix side, but, as for #44864, this is very minor and I really don't mind if it only gets merged into future releases.

Thanks!

Kind regards,
Jérémie.
History
Date User Action Args
2022-04-11 14:59:48adminsetgithub: 89028
2021-08-24 19:08:57jdetreysetmessages: + msg400227
2021-08-13 22:52:08terry.reedysetnosy: + terry.reedy

messages: + msg399569
versions: - Python 3.6, Python 3.7, Python 3.8, Python 3.9, Python 3.10
2021-08-09 01:28:44shihai1991setnosy: + rhettinger, paul.j3
2021-08-08 14:40:55jdetreysetkeywords: + patch
stage: patch review
pull_requests: + pull_request26157
2021-08-08 14:12:29jdetreycreate