Skip to content

Commit

Permalink
[3.11] gh-77956: Add the words 'default' and 'version' help text loca…
Browse files Browse the repository at this point in the history
…lizable (GH-12711) (GH-115968)

(cherry picked from commit da382aa)

Co-authored-by: paul.j3
Co-authored-by: Emmanuel Arias <[email protected]>
Co-authored-by: Jérémie Detrey <[email protected]>
  • Loading branch information
3 people authored Feb 26, 2024
1 parent 46f821d commit f8a6a1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,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


Expand Down Expand Up @@ -1129,7 +1129,9 @@ def __init__(self,
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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add 'default' and 'version' help text for localization in argparse.

0 comments on commit f8a6a1c

Please sign in to comment.