Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda382aa

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

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
ifaction.defaultisnotSUPPRESS:
709709
defaulting_nargs= [OPTIONAL,ZERO_OR_MORE]
710710
ifaction.option_stringsoraction.nargsindefaulting_nargs:
711-
help+=' (default: %(default)s)'
711+
help+=_(' (default: %(default)s)')
712712
returnhelp
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+
ifhelpisNone:
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)

[8]ページ先頭

©2009-2025 Movatter.jp