Skip to content

Commit 4f401c5

Browse files
authored
Translate library/cmd.po rst: 13-99 (#1045)
* translate 13-99 * fix reST * fix * fix
1 parent 28c15ae commit 4f401c5

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

library/cmd.po

+46-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Dr-XYZ <dr.xyz.tw@gmail.com>, 2025
67
msgid ""
78
msgstr ""
89
"Project-Id-Version: Python 3.13\n"
910
"Report-Msgid-Bugs-To: \n"
1011
"POT-Creation-Date: 2024-09-23 07:52+0800\n"
11-
"PO-Revision-Date: 2018-05-23 14:40+0000\n"
12-
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
12+
"PO-Revision-Date: 2025-05-14 14:32+0800\n"
13+
"Last-Translator: Dr-XYZ <dr.xyz.tw@gmail.com>\n"
1314
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1415
"tw)\n"
1516
"Language: zh_TW\n"
@@ -33,6 +34,8 @@ msgid ""
3334
"administrative tools, and prototypes that will later be wrapped in a more "
3435
"sophisticated interface."
3536
msgstr ""
37+
":class:`Cmd` 類別提供了一個簡單的架構,用於撰寫行導向的命令直譯器。這類直譯器"
38+
"常用於測試控制工具、管理工具以及日後將包裝於更高階介面的原型中。"
3639

3740
#: ../../library/cmd.rst:20
3841
msgid ""
@@ -42,6 +45,9 @@ msgid ""
4245
"yourself in order to inherit :class:`Cmd`'s methods and encapsulate action "
4346
"methods."
4447
msgstr ""
48+
":class:`Cmd` 實例或其子類別實例是一種行導向的直譯器架構。通常沒有必要直接實例"
49+
"化 :class:`Cmd` 本身;它更適合作為你自定義的直譯器類別的父類別,讓你能繼承 :"
50+
"class:`Cmd` 的方法,並封裝動作方法。"
4551

4652
#: ../../library/cmd.rst:25
4753
msgid ""
@@ -50,6 +56,9 @@ msgid ""
5056
"`None` and :mod:`readline` is available, command completion is done "
5157
"automatically."
5258
msgstr ""
59+
"可選引數 *completekey* 是 :mod:`readline` 模組中用於自動完成的按鍵名稱;預設"
60+
"為 :kbd:`Tab`。若 *completekey* 不為 :const:`None` 且 :mod:`readline` 可用,"
61+
"則會自動啟用命令自動完成功能。"
5362

5463
#: ../../library/cmd.rst:29
5564
msgid ""
@@ -59,6 +68,10 @@ msgid ""
5968
"``'tab'``. Note that other values are not treated this way, and might only "
6069
"work with a specific backend."
6170
msgstr ""
71+
"預設值 ``'tab'`` 會被特殊處理,使其在所有的 :data:`readline.backend` 中皆代"
72+
"表 :kbd:`Tab` 鍵。具體來說,若 :data:`readline.backend` 為 ``editline``,則 "
73+
"``Cmd`` 會改用 ``'^I'`` 取代 ``'tab'``。請注意,其他值不會有此處理方式,且可"
74+
"能僅能在特定的後端中適用。"
6275

6376
#: ../../library/cmd.rst:36
6477
msgid ""
@@ -67,38 +80,46 @@ msgid ""
6780
"and output. If not specified, they will default to :data:`sys.stdin` and :"
6881
"data:`sys.stdout`."
6982
msgstr ""
83+
"可選引數 *stdin* 與 *stdout* 用來指定 Cmd 實例或其子類別實例所使用的輸入與輸"
84+
"出檔案物件。若未指定,預設為 :data:`sys.stdin` 與 :data:`sys.stdout`。"
7085

7186
#: ../../library/cmd.rst:41
7287
msgid ""
7388
"If you want a given *stdin* to be used, make sure to set the instance's :"
7489
"attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be "
7590
"ignored."
7691
msgstr ""
92+
"若你希望使用指定的 *stdin*,請務必將該實例的 :attr:`use_rawinput` 屬性設為 "
93+
"``False``,否則 *stdin* 會被忽略。"
7794

7895
#: ../../library/cmd.rst:45
7996
msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``."
80-
msgstr ""
97+
msgstr "對於 ``editline``,``completekey='tab'`` 會被替換為 ``'^I'``。"
8198

8299
#: ../../library/cmd.rst:52
83100
msgid "Cmd Objects"
84101
msgstr "Cmd 物件"
85102

86103
#: ../../library/cmd.rst:54
87104
msgid "A :class:`Cmd` instance has the following methods:"
88-
msgstr ""
105+
msgstr ":class:`Cmd` 實例具有以下方法:"
89106

90107
#: ../../library/cmd.rst:59
91108
msgid ""
92109
"Repeatedly issue a prompt, accept input, parse an initial prefix off the "
93110
"received input, and dispatch to action methods, passing them the remainder "
94111
"of the line as argument."
95112
msgstr ""
113+
"重複顯示提示字元、接收輸入、剖析接收到的輸入字串前綴,並派發給動作方法,將其"
114+
"餘部分作為引數傳遞給它們"
96115

97116
#: ../../library/cmd.rst:63
98117
msgid ""
99118
"The optional argument is a banner or intro string to be issued before the "
100119
"first prompt (this overrides the :attr:`intro` class attribute)."
101120
msgstr ""
121+
"此可選引數為橫幅或導言字串,會在首次顯示提示字元前輸出(此值會覆寫 :attr:"
122+
"`intro` 類別屬性)。"
102123

103124
#: ../../library/cmd.rst:66
104125
msgid ""
@@ -108,10 +129,14 @@ msgid ""
108129
"`Control-F` moves the cursor to the right non-destructively, :kbd:`Control-"
109130
"B` moves the cursor to the left non-destructively, etc.)."
110131
msgstr ""
132+
"如果已載入 :mod:`readline` 模組,輸入行將自動繼承類似 :program:`bash` 的歷史"
133+
"紀錄編輯功能(例如 :kbd:`Control-P` 可向上捲動至上一個指令,:kbd:`Control-N` "
134+
"向下捲動至下一個指令,:kbd:`Control-F` 非破壞性地將游標向右移動,:kbd:"
135+
"`Control-B` 非破壞性地將游標向左移動等)。"
111136

112137
#: ../../library/cmd.rst:72
113138
msgid "An end-of-file on input is passed back as the string ``'EOF'``."
114-
msgstr ""
139+
msgstr "當輸入為檔案結尾(EOF)時,會傳回字串 ``'EOF'``。"
115140

116141
#: ../../library/cmd.rst:78
117142
msgid ""
@@ -121,13 +146,19 @@ msgid ""
121146
"another special case, a line beginning with the character ``'!'`` is "
122147
"dispatched to the method :meth:`!do_shell` (if such a method is defined)."
123148
msgstr ""
149+
"直譯器實例僅當存在 :meth:`!do_foo` 方法時,才會識別命令名稱 ``foo``。作為特殊"
150+
"情況,以字元 ``'?'`` 開頭的行會被派發至 :meth:`do_help` 方法;另一個特殊情況"
151+
"是,以字元 ``'!'`` 開頭的行會被派發至 :meth:`!do_shell` 方法(若該方法已定"
152+
"義)。"
124153

125154
#: ../../library/cmd.rst:84
126155
msgid ""
127156
"This method will return when the :meth:`postcmd` method returns a true "
128157
"value. The *stop* argument to :meth:`postcmd` is the return value from the "
129158
"command's corresponding :meth:`!do_\\*` method."
130159
msgstr ""
160+
"當 :meth:`postcmd` 方法回傳真值時,此方法將會結束。傳遞給 :meth:`postcmd` 的 "
161+
"*stop* 引數是該命令對應的 :meth:`!do_\\*` 方法的回傳值。"
131162

132163
#: ../../library/cmd.rst:88
133164
msgid ""
@@ -140,6 +171,11 @@ msgid ""
140171
"could be used to provide different completion depending upon which position "
141172
"the argument is in."
142173
msgstr ""
174+
"如果啟用了自動完成,命令的自動完成將會自動執行,而命令引數的自動完成則是透過"
175+
"呼叫 :meth:`!complete_foo` 方法並傳入 *text*、*line*、*begidx* 和 *endidx* 引"
176+
"數來處理。*text* 是要比對的字串前綴:所有回傳的符合項都必須以此字串開頭。"
177+
"*line* 是目前的輸入行(前置空白會被移除),*begidx* 和 *endidx* 則分別是前綴"
178+
"字串的起始與結束索引,可用來根據引數所在的位置提供不同的自動完成結果。"
143179

144180
#: ../../library/cmd.rst:99
145181
msgid ""
@@ -151,6 +187,11 @@ msgid ""
151187
"help_\\*` methods or commands that have docstrings), and also lists any "
152188
"undocumented commands."
153189
msgstr ""
190+
"所有 :class:`Cmd` 的子類別都會繼承預先定義的 :meth:`!do_help` 方法。當此方法"
191+
"接收到引數 ``'bar'`` 時,會呼叫對應的 :meth:`!help_bar` 方法;若該方法不存"
192+
"在,則會列印 :meth:`!do_bar` 的說明字串(若有的話)。若未提供任何引數,:meth:"
193+
"`!do_help` 會列出所有可用的說明主題(也就是所有具有對應 :meth:`!help_\\*` 方"
194+
"法或有說明字串的命令),並且也會列出所有尚未記錄的命令。"
154195

155196
#: ../../library/cmd.rst:110
156197
msgid ""

0 commit comments

Comments
 (0)