8000 [po] auto sync · python/python-docs-zh-cn@89c7139 · GitHub
[go: up one dir, main page]

Skip to content

Commit 89c7139

Browse files
[po] auto sync
1 parent 810ae0e commit 89c7139

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "81.12%", "updated_at": "2025-03-23T06:55:31Z"}
1+
{"translation": "81.13%", "updated_at": "2025-03-23T15:55:55Z"}

library/argparse.po

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,6 +2991,12 @@ msgid ""
29912991
" and returns an :class:`!ArgumentParser` object that can be modified as "
29922992
"usual."
29932993
msgstr ""
2994+
"许多程序都将其功能拆分为一系列子命令,例如,``svn`` 程序可唤起像 ``svn checkout``, ``svn update`` 和 "
2995+
"``svn commit`` 等子命令。 当一个程序执行需要多组不同各类命令行参数时这种拆分功能的方式是一个非常好的主意。 "
2996+
":class:`ArgumentParser` 通过 :meth:`!add_subparsers` 方法支持创建这样的子命令。 "
2997+
":meth:`!add_subparsers` 方法通常不带参数地调用并返回一个特殊的动作对象。 该对象只有一个方法 "
2998+
":meth:`~_SubParsersAction.add_parser`,它接受一个命令名称和任意多个 "
2999+
":class:`!ArgumentParser` 构造器参数,并返回一个可以通常方式进行修改的 :class:`!ArgumentParser` 对象。"
29943000

29953001
#: ../../library/argparse.rst:1582
29963002
msgid "Description of parameters:"
@@ -3014,13 +3020,14 @@ msgid ""
30143020
"*prog* - usage information that will be displayed with sub-command help, by "
30153021
"default the name of the program and any positional arguments before the "
30163022
"subparser argument"
3017-
msgstr ""
3023+
msgstr "*prog* - 将与子命令帮助一同显示的用法信息,默认为程序名称和子解析器参数之前的任何位置参数"
30183024

30193025
#: ../../library/argparse.rst:1595
30203026
msgid ""
30213027
"*parser_class* - class which will be used to create sub-parser instances, by"
30223028
" default the class of the current parser (e.g. :class:`ArgumentParser`)"
30233029
msgstr ""
3030+
"*parser_class* - 将被用于创建子解析器实例的类,默认为当前解析器类 (例如 :class:`ArgumentParser`)"
30243031

30253032
#: ../../library/argparse.rst:1598
30263033
msgid ""
@@ -3048,7 +3055,7 @@ msgstr "help_ - 在输出帮助中的子解析器分组帮助信息,默认为
30483055
msgid ""
30493056
"metavar_ - string presenting available subcommands in help; by default it is"
30503057
" ``None`` and presents subcommands in form {cmd1, cmd2, ..}"
3051-
msgstr ""
3058+
msgstr "metavar_ - 帮助信息中表示可用子命令的字符串;默认为 ``None`` 并以 {cmd1, cmd2, ..} 的形式表示子命令"
30523059

30533060
#: ../../library/argparse.rst:1612
30543061
msgid "Some example usage::"
@@ -3262,6 +3269,8 @@ msgid ""
32623269
"that each subparser knows which Python function it should execute. For "
32633270
"example::"
32643271
msgstr ""
3272+
"一个特别有效的处理子命令的方式是将 :meth:`add_subparsers` 方法与对 :meth:`set_defaults` "
3273+
"的调用结合起来使用以便每个子解析器能知道应当执行哪个 Python 函数。 例如::"
32653274

32663275
#: ../../library/argparse.rst:1728
32673276
msgid ""
@@ -3433,6 +3442,8 @@ msgid ""
34333442
"appropriate groups can be created using the :meth:`!add_argument_group` "
34343443
"method::"
34353444
msgstr ""
3445+
"在默认情况下,:class:`ArgumentParser` 会在显示帮助消息时将命令行参数分为“位置参数”和“选项”两组。 "
3446+
"当存在比默认更好的分组概念时,可以使用 :meth:`!add_argument_group` 方法来创建适当的分组::"
34363447

34373448
#: ../../library/argparse.rst:1822
34383449
msgid ""
@@ -3980,6 +3991,8 @@ msgid ""
39803991
"``action``, ``type``), *value*, which is the key under which the object will"
39813992
" be registered, and object, the callable to be registered."
39823993
msgstr ""
3994+
":meth:`!register` 方法接受三个参数 —— *registry_name*,指定将要存储对象的内部注册表 (例如 ``action``,"
3995+
" ``type``),*value*,将要注册对象对应的键,以及 object,将要注册的可调用对象。"
39833996

39843997
#: ../../library/argparse.rst:2135
39853998
msgid ""

0 commit comments

Comments
 (0)
0