Skip to content

Commit 963e30f

Browse files
committed
docs(library/argparse.po): up to line 166
1 parent af4187d commit 963e30f

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

library/argparse.po

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# SkyLull
67
msgid ""
78
msgstr ""
89
"Project-Id-Version: Python 3.13\n"
@@ -22,7 +23,7 @@ msgstr ""
2223
msgid ""
2324
":mod:`!argparse` --- Parser for command-line options, arguments and "
2425
"subcommands"
25-
msgstr ""
26+
msgstr ":mod:`!argparse` --- 命令列界面選項、參數與子命令的剖析器"
2627

2728
#: ../../library/argparse.rst:12
2829
msgid "**Source code:** :source:`Lib/argparse.py`"
@@ -37,7 +38,7 @@ msgid ""
3738
"This page contains the API reference information. For a more gentle "
3839
"introduction to Python command-line parsing, have a look at the :ref:"
3940
"`argparse tutorial <argparse-tutorial>`."
40-
msgstr ""
41+
msgstr "這個頁面含有很多 API 參考資訊。`argparse tutorial <argparse-tutorial>` 有更簡單易懂的 Python 命令剖析教學。"
4142

4243
#: ../../library/argparse.rst:22
4344
msgid ""
@@ -47,15 +48,17 @@ msgid ""
4748
"mod:`!argparse` module also automatically generates help and usage "
4849
"messages. The module will also issue errors when users give the program "
4950
"invalid arguments."
50-
msgstr ""
51+
msgstr "使用 :mod:`!argparse` 模組可輕易地寫出一個對使用者友善的命命列界面。你只要告訴 :mod:`!argparse` 你的程式需要什麼參數,它會自動幫你做好如何剖析 :data:`sys.argv` 的設定。"
52+
":data:`sys.argv` 還會自動幫你生成幫助和使用說明,以及自動檢查使用者的輸入是否合規。"
5153

5254
#: ../../library/argparse.rst:28
5355
msgid ""
5456
"The :mod:`!argparse` module's support for command-line interfaces is built "
5557
"around an instance of :class:`argparse.ArgumentParser`. It is a container "
5658
"for argument specifications and has options that apply to the parser as "
5759
"whole::"
58-
msgstr ""
60+
msgstr ":class:`argparse.ArgumentParser` 是一個供你客製化參數規則和控制剖析器(parser)的容器。"
61+
"控制 :mod:`!argparse` 如何應對命令列界面的核心,都圍繞在控制一個 argparse.ArgumentParser 的實例之上:::"
5962

6063
#: ../../library/argparse.rst:32
6164
msgid ""
@@ -64,13 +67,19 @@ msgid ""
6467
" description='What the program does',\n"
6568
" epilog='Text at the bottom of help')"
6669
msgstr ""
70+
"parser = argparse.ArgumentParser(\n"
71+
" prog='程式名稱',\n"
72+
" description='程式的用途說明',\n"
73+
" epilog='幫助訊息底下的文字')"
6774

6875
#: ../../library/argparse.rst:37
6976
msgid ""
7077
"The :meth:`ArgumentParser.add_argument` method attaches individual argument "
7178
"specifications to the parser. It supports positional arguments, options "
7279
"that accept values, and on/off flags::"
7380
msgstr ""
81+
":meth:`ArgumentParser.add_argument` 方法可以將你設定好的每個參數與其規則各自附加進剖析器裡。"
82+
"它支援位置參數(positional arguments)、接受值的選項以及開關旗標(on/off flags):::"
7483

7584
#: ../../library/argparse.rst:41
7685
msgid ""
@@ -79,25 +88,35 @@ msgid ""
7988
"parser.add_argument('-v', '--verbose',\n"
8089
" action='store_true') # on/off flag"
8190
msgstr ""
91+
"parser.add_argument('filename') # 位置參數\n"
92+
"parser.add_argument('-c', '--count') # 接受值的選項\n"
93+
"parser.add_argument('-v', '--verbose',\n"
94+
" action='store_true') # 開關旗標"
8295

8396
#: ../../library/argparse.rst:46
8497
msgid ""
8598
"The :meth:`ArgumentParser.parse_args` method runs the parser and places the "
8699
"extracted data in a :class:`argparse.Namespace` object::"
87100
msgstr ""
101+
":meth:`ArgumentParser.parse_args` 方法執行剖析並將結果資料存放在一個 :class:`argparse.Namespace` 物件裡:::"
88102

89103
#: ../../library/argparse.rst:49
90104
msgid ""
91105
"args = parser.parse_args()\n"
92106
"print(args.filename, args.count, args.verbose)"
93107
msgstr ""
108+
"args = parser.parse_args()\n"
109+
"print(args.filename, args.count, args.verbose)"
94110

95111
#: ../../library/argparse.rst:53
96112
msgid ""
97113
"If you're looking for a guide about how to upgrade :mod:`optparse` code to :"
98114
"mod:`!argparse`, see :ref:`Upgrading Optparse Code <upgrading-optparse-"
99115
"code>`."
100116
msgstr ""
117+
"如果你在尋找的是如何把使用 :mod:`optparse` 的程式升級成使用 :mod:`!argparse` 的指引的話,"
118+
"請參看 :ref:`Upgrading Optparse Code <upgrading-optparse-"
119+
"code>`."
101120

102121
#: ../../library/argparse.rst:57
103122
msgid "ArgumentParser objects"
@@ -109,36 +128,42 @@ msgid ""
109128
"as keyword arguments. Each parameter has its own more detailed description "
110129
"below, but in short they are:"
111130
msgstr ""
131+
"建立一個新的 :class:`ArgumentParser` 物件。所有給予它的參數都應使用關鍵字引數來指定。"
132+
"下方會有每個參數各自的詳細說明,不過簡單來說他們的功用分別是:"
112133

113134
#: ../../library/argparse.rst:70
114135
msgid ""
115136
"prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)"
116137
msgstr ""
138+
"prog_ - 程式的名字。(預設是: ``os.path.basename(sys.argv[0])``)。"
117139

118140
#: ../../library/argparse.rst:73
119141
msgid ""
120142
"usage_ - The string describing the program usage (default: generated from "
121143
"arguments added to parser)"
122144
msgstr ""
145+
"usage_ - 描述程式用途的字串。(預設值: 從附加到剖析器的參數中生成。)"
123146

124147
#: ../../library/argparse.rst:76
125148
msgid ""
126149
"description_ - Text to display before the argument help (by default, no text)"
127150
msgstr ""
151+
"description_ - 顯示在參數幫助說明前的文字。(預設沒有)"
128152

129153
#: ../../library/argparse.rst:79
130154
msgid "epilog_ - Text to display after the argument help (by default, no text)"
131-
msgstr ""
155+
msgstr "epilog_ - 顯示在參數幫助說明後的文字。(預設沒有)"
132156

133157
#: ../../library/argparse.rst:81
134158
msgid ""
135159
"parents_ - A list of :class:`ArgumentParser` objects whose arguments should "
136160
"also be included"
137161
msgstr ""
162+
"parents_ - 一個所有應該被一併列入考量的 :class:`ArgumentParser` 形成的串列。"
138163

139164
#: ../../library/argparse.rst:84
140165
msgid "formatter_class_ - A class for customizing the help output"
141-
msgstr ""
166+
msgstr "formatter_class_ - 能自訂幫助說明文字的類別"
142167

143168
#: ../../library/argparse.rst:86
144169
msgid ""

0 commit comments

Comments
 (0)