mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-77956: Add the words 'default' and 'version' help text localizable (GH-12711) (GH-115968)
(cherry picked from commit da382aaf52
)
Co-authored-by: paul.j3
Co-authored-by: Emmanuel Arias <eamanu@yaerobi.com>
Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
This commit is contained in:
parent
46f821d62b
commit
f8a6a1c5c3
2 changed files with 5 additions and 2 deletions
|
@ -721,7 +721,7 @@ class ArgumentDefaultsHelpFormatter(HelpFormatter):
|
|||
if action.default is not SUPPRESS:
|
||||
defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
|
||||
if action.option_strings or action.nargs in defaulting_nargs:
|
||||
help += ' (default: %(default)s)'
|
||||
help += _(' (default: %(default)s)')
|
||||
return help
|
||||
|
||||
|
||||
|
@ -1129,7 +1129,9 @@ class _VersionAction(Action):
|
|||
version=None,
|
||||
dest=SUPPRESS,
|
||||
default=SUPPRESS,
|
||||
help="show program's version number and exit"):
|
||||
help=None):
|
||||
if help is None:
|
||||
help = _("show program's version number and exit")
|
||||
super(_VersionAction, self).__init__(
|
||||
option_strings=option_strings,
|
||||
dest=dest,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Add 'default' and 'version' help text for localization in argparse.
|
Loading…
Add table
Add a link
Reference in a new issue