8000 gh-77956: Add the words 'default' and 'version' help text localizabl… · diegorusso/cpython@a92f7d6 · GitHub
  • [go: up one dir, main page]

    Skip to content

    Commit a92f7d6

    Browse files
    eamanujdetrey
    authored andcommitted
    pythongh-77956: Add the words 'default' and 'version' help text localizable (pythonGH-12711)
    Co-authored-by: paul.j3 Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
    1 parent d07dd37 commit a92f7d6

    File tree

    2 files changed

    +5
    -2
    lines changed

    2 files changed

    +5
    -2
    lines changed

    Lib/argparse.py

    Lines changed: 4 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -708,7 +708,7 @@ def _get_help_string(self, action):
    708708
    if action.default is not SUPPRESS:
    709709
    defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
    710710
    if action.option_strings or action.nargs in defaulting_nargs:
    711-
    help += ' (default: %(default)s)'
    711+
    help += _(' (default: %(default)s)')
    712712
    return help
    713713

    714714

    @@ -1159,8 +1159,10 @@ def __init__(self,
    11591159
    version=None,
    11601160
    dest=SUPPRESS,
    11611161
    default=SUPPRESS,
    1162-
    help="show program's version number and exit",
    1162+
    help=None,
    11631163
    deprecated=False):
    1164+
    if help is None:
    1165+
    help = _("show program's version number and exit")
    11641166
    super(_VersionAction, self).__init__(
    11651167
    option_strings=option_strings,
    11661168
    dest=dest,
    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1 @@
    1+
    Add 'default' and 'version' help text for localization in argparse.

    0 commit comments

    Comments
     (0)
    0