diff --git a/Lib/argparse.py b/Lib/argparse.py index f86658baf7f2bac..c16f538ae1535a1 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -708,7 +708,7 @@ def _get_help_string(self, action): 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 @@ def __init__(self, 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, diff --git a/Misc/NEWS.d/next/Library/2019-04-06-23-50-59.bpo-33775.0yhMDc.rst b/Misc/NEWS.d/next/Library/2019-04-06-23-50-59.bpo-33775.0yhMDc.rst new file mode 100644 index 000000000000000..2a663ac7940dcb2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-04-06-23-50-59.bpo-33775.0yhMDc.rst @@ -0,0 +1 @@ +Add 'default' and 'version' help text for localization in argparse.