summaryrefslogtreecommitdiffstats
path: root/Lib/argparse.py
diff options
context:
space:
mode:
authorEmmanuel Arias <eamanu@yaerobi.com>2024-02-26 19:20:39 (GMT)
committerGitHub <noreply@github.com>2024-02-26 19:20:39 (GMT)
commitda382aaf52d761a037874bee27bb5db69906df9e (patch)
tree15e8cefdbd1f10e0abe506b8ab1df2104b0bd7b2 /Lib/argparse.py
parent37a13b941394a1337576c67bff35d4a44a1157e2 (diff)
downloadcpython-da382aaf52d761a037874bee27bb5db69906df9e.zip
cpython-da382aaf52d761a037874bee27bb5db69906df9e.tar.gz
cpython-da382aaf52d761a037874bee27bb5db69906df9e.tar.bz2
gh-77956: Add the words 'default' and 'version' help text localizable (GH-12711)
Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r--Lib/argparse.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index f86658b..c16f538 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -708,7 +708,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
@@ -1159,8 +1159,10 @@ class _VersionAction(Action):
version=None,
dest=SUPPRESS,
default=SUPPRESS,
- help="show program's version number and exit",
+ help=None,
deprecated=False):
+ if help is None:
+ help = _("show program's version number and exit")
super(_VersionAction, self).__init__(
option_strings=option_strings,
dest=dest,