1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022, Python Software Foundation
1
+ # Copyright (C) 2001-2023, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
3
#
5
4
# Translators:
5
+ # Matt Wang <[email protected] >, 2023
6
6
msgid ""
7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.11\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2023-05-09 00:15 +0000\n "
11
- "PO-Revision-Date : 2018 -05-23 16:03+0000 \n "
12
- "Last-Translator : Adrian Liaw <adrianliaw2000 @gmail.com>\n "
10
+ "POT-Creation-Date : 2022-02-18 00:10 +0000\n "
11
+ "PO-Revision-Date : 2023 -05-04 22:54+0800 \n "
12
+ "Last-Translator : Matt Wang <mattwang44 @gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
15
15
"Language : zh_TW\n "
16
16
"MIME-Version : 1.0\n "
17
17
"Content-Type : text/plain; charset=UTF-8\n "
18
18
"Content-Transfer-Encoding : 8bit\n "
19
19
"Plural-Forms : nplurals=1; plural=0;\n "
20
+ "X-Generator : Poedit 3.2.2\n "
20
21
21
22
#: ../../library/html.parser.rst:2
22
23
msgid ":mod:`html.parser` --- Simple HTML and XHTML parser"
23
- msgstr ""
24
+ msgstr ":mod:`html.parser` --- 簡單的 HTML 和 XHTML 剖析器 "
24
25
25
26
#: ../../library/html.parser.rst:7
26
27
msgid "**Source code:** :source:`Lib/html/parser.py`"
@@ -32,17 +33,21 @@ msgid ""
32
33
"for parsing text files formatted in HTML (HyperText Mark-up Language) and "
33
34
"XHTML."
34
35
msgstr ""
36
+ "該模組定義了一個類別 :class:`HTMLParser`,是剖析 (parse) HTML(HyperText "
37
+ "Mark-up Language、超文本標記語言)和 XHTML 格式文本檔案的基礎。"
35
38
36
39
#: ../../library/html.parser.rst:20
37
40
msgid "Create a parser instance able to parse invalid markup."
38
- msgstr ""
41
+ msgstr "建立一個能夠剖析無效標記的剖析器實例。 "
39
42
40
43
#: ../../library/html.parser.rst:22
41
44
msgid ""
42
45
"If *convert_charrefs* is ``True`` (the default), all character references "
43
46
"(except the ones in ``script``/``style`` elements) are automatically "
44
47
"converted to the corresponding Unicode characters."
45
48
msgstr ""
49
+ "如果 *convert_charrefs* 為 ``True`` (預設值),所有字元參照 (reference)"
50
+ "( ``script``/``style`` 元素中的參照除外)將自動轉換為相應的 Unicode 字元。"
46
51
47
52
#: ../../library/html.parser.rst:26
48
53
msgid ""
@@ -51,51 +56,62 @@ msgid ""
51
56
"encountered. The user should subclass :class:`.HTMLParser` and override its "
52
57
"methods to implement the desired behavior."
53
58
msgstr ""
59
+ ":class:`.HTMLParser` 實例被提供 HTML 資料,並在遇到開始標籤、結束標籤、文本、"
60
+ "註解和其他標記元素時呼叫處理程式 (handler) 方法。使用者應該繼承 :class:`."
61
+ "HTMLParser` 並覆蓋其方法以實作所需的行為。"
54
62
55
63
#: ../../library/html.parser.rst:31
56
64
msgid ""
57
65
"This parser does not check that end tags match start tags or call the end-"
58
66
"tag handler for elements which are closed implicitly by closing an outer "
59
67
"element."
60
68
msgstr ""
69
+ "此剖析器不檢查結束標籤是否與開始標籤匹配,也不會為透過結束外部元素來隱晦地被"
70
+ "結束的元素呼叫結束標籤處理程式。"
61
71
62
72
#: ../../library/html.parser.rst:34
63
73
msgid "*convert_charrefs* keyword argument added."
64
- msgstr ""
74
+ msgstr "新增關鍵字引數 *convert_charrefs*。 "
65
75
66
76
#: ../../library/html.parser.rst:37
67
77
msgid "The default value for argument *convert_charrefs* is now ``True``."
68
- msgstr ""
78
+ msgstr "引數 *convert_charrefs* 的預設值現在是 ``True``。 "
69
79
70
80
#: ../../library/html.parser.rst:42
71
81
msgid "Example HTML Parser Application"
72
- msgstr ""
82
+ msgstr "HTML 剖析器應用程式範例 "
73
83
74
84
#: ../../library/html.parser.rst:44
75
85
msgid ""
76
86
"As a basic example, below is a simple HTML parser that uses the :class:"
77
87
"`HTMLParser` class to print out start tags, end tags, and data as they are "
78
88
"encountered::"
79
89
msgstr ""
90
+ "以下的基礎範例是一個簡單的 HTML 剖析器,它使用 :class:`HTMLParser` 類別,當遇"
91
+ "到開始標籤、結束標籤和資料時將它們印出:\n"
92
+ "\n"
93
+ "::"
80
94
81
95
#: ../../library/html.parser.rst:64
82
96
msgid "The output will then be:"
83
- msgstr ""
97
+ msgstr "輸出將是: "
84
98
85
99
#: ../../library/html.parser.rst:83
86
100
msgid ":class:`.HTMLParser` Methods"
87
- msgstr ""
101
+ msgstr ":class:`.HTMLParser` 方法 "
88
102
89
103
#: ../../library/html.parser.rst:85
90
104
msgid ":class:`HTMLParser` instances have the following methods:"
91
- msgstr ""
105
+ msgstr ":class:`HTMLParser` 實例具有以下方法: "
92
106
93
107
#: ../../library/html.parser.rst:90
94
108
msgid ""
95
109
"Feed some text to the parser. It is processed insofar as it consists of "
96
110
"complete elements; incomplete data is buffered until more data is fed or :"
97
111
"meth:`close` is called. *data* must be :class:`str`."
98
112
msgstr ""
113
+ "向剖析器提供一些文本。只要它由完整的元素組成,它就會被處理;不完整的資料會被"
114
+ "緩衝,直到輸入更多資料或呼叫 :meth:`close`。 *data* 必須是 :class:`str`。"
99
115
100
116
#: ../../library/html.parser.rst:97
101
117
msgid ""
@@ -104,16 +120,19 @@ msgid ""
104
120
"additional processing at the end of the input, but the redefined version "
105
121
"should always call the :class:`HTMLParser` base class method :meth:`close`."
106
122
msgstr ""
123
+ "強制處理所有緩衝資料,如同它後面跟有文件結束標籤一樣。此方法可能有被衍生類別"
124
+ "重新定義,以在輸入末尾定義額外的處理,但重新定義的版本仍應要呼叫 :class:"
125
+ "`HTMLParser` 基底類別方法 :meth:`close`。"
107
126
108
127
#: ../../library/html.parser.rst:105
109
128
msgid ""
110
129
"Reset the instance. Loses all unprocessed data. This is called implicitly "
111
130
"at instantiation time."
112
- msgstr ""
131
+ msgstr "重置實例。丟棄所有未處理的資料。這在實例化時被會隱晦地呼叫。 "
113
132
114
133
#: ../../library/html.parser.rst:111
115
134
msgid "Return current line number and offset."
116
- msgstr ""
135
+ msgstr "回傳當前列號 (line number) 和偏移量 (offset)。 "
117
136
118
137
#: ../../library/html.parser.rst:116
119
138
msgid ""
@@ -122,6 +141,9 @@ msgid ""
122
141
"with HTML \" as deployed\" or for re-generating input with minimal changes "
123
142
"(whitespace between attributes can be preserved, etc.)."
124
143
msgstr ""
144
+ "回傳最近開啟 (open) 的開始標籤的文本。這對於結構化處理通常不必要,但在處理"
145
+ "「已部署」的 HTML 或以最少的更改重新生成輸入(可以保留屬性之間的空白等)時可"
146
+ "能很有用。"
125
147
126
148
#: ../../library/html.parser.rst:122
127
149
msgid ""
@@ -130,12 +152,14 @@ msgid ""
130
152
"class implementations do nothing (except for :meth:`~HTMLParser."
131
153
"handle_startendtag`):"
132
154
msgstr ""
155
+ "當遇到資料或標記元素時將呼叫以下方法,並且它們應在子類別中被覆蓋。基底類別實"
156
+ "作什麼都不做(除了 :meth:`~HTMLParser.handle_startendtag`):"
133
157
134
158
#: ../../library/html.parser.rst:129
135
159
msgid ""
136
160
"This method is called to handle the start tag of an element (e.g. ``<div "
137
161
"id=\" main\" >``)."
138
- msgstr ""
162
+ msgstr "呼叫此方法來處理元素的開始標籤(例如 ``<div id= \" main \" >``)。 "
139
163
140
164
#: ../../library/html.parser.rst:131
141
165
msgid ""
@@ -145,28 +169,33 @@ msgid ""
145
169
"translated to lower case, and quotes in the *value* have been removed, and "
146
170
"character and entity references have been replaced."
147
171
msgstr ""
172
+ "*tag* 引數是轉換為小寫的標籤名稱。 *attrs* 引數是一個 ``(name, value)`` 對的"
173
+ "列表,包含在標籤的 ``<>`` 括號內找到的屬性。 *name* 將被轉成小寫,*value* 中"
174
+ "的引號會被刪除,字元和實體參照也會被替換。"
148
175
149
176
#: ../../library/html.parser.rst:137
150
177
msgid ""
151
178
"For instance, for the tag ``<A HREF=\" https://www.cwi.nl/\" >``, this method "
152
179
"would be called as ``handle_starttag('a', [('href', 'https://www.cwi."
153
180
"nl/')])``."
154
181
msgstr ""
182
+ "例如,對於標籤 ``<A HREF=\" https://www.cwi.nl/\" >``,這個方法會以 "
183
+ "``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` 的形式被呼叫。"
155
184
156
185
#: ../../library/html.parser.rst:140
157
186
msgid ""
158
187
"All entity references from :mod:`html.entities` are replaced in the "
159
188
"attribute values."
160
- msgstr ""
189
+ msgstr "在屬性值中來自 :mod:`html.entities` 的所有實體參照都會被替換。 "
161
190
162
191
#: ../../library/html.parser.rst:146
163
192
msgid ""
164
193
"This method is called to handle the end tag of an element (e.g. ``</div>``)."
165
- msgstr ""
194
+ msgstr "呼叫此方法來處理元素的結束標籤(例如 ``</div>``)。 "
166
195
167
196
#: ../../library/html.parser.rst:148
168
197
msgid "The *tag* argument is the name of the tag converted to lower case."
169
- msgstr ""
198
+ msgstr "*tag* 引數是轉換為小寫的標籤名稱。 "
170
199
171
200
#: ../../library/html.parser.rst:153
172
201
msgid ""
@@ -176,19 +205,28 @@ msgid ""
176
205
"implementation simply calls :meth:`handle_starttag` and :meth:"
177
206
"`handle_endtag`."
178
207
msgstr ""
208
+ "與 :meth:`handle_starttag` 類似,但在剖析器遇到 XHTML 樣式的空標籤 "
209
+ "(``<img ... />``) 時呼叫。這個方法可能被需要這個特定詞彙資訊 (lexical "
210
+ "information) 的子類別覆蓋;預設實作只是呼叫 :meth:`handle_starttag` 和 :meth:"
211
+ "`handle_endtag`。"
179
212
180
213
#: ../../library/html.parser.rst:161
181
214
msgid ""
182
215
"This method is called to process arbitrary data (e.g. text nodes and the "
183
216
"content of ``<script>...</script>`` and ``<style>...</style>``)."
184
217
msgstr ""
218
+ "呼叫此方法來處理任意資料(例如文本節點與 ``<script>...</script>`` 和 "
219
+ "``<style>...</style>`` 的內容)。"
185
220
186
221
#: ../../library/html.parser.rst:167
187
222
msgid ""
188
223
"This method is called to process a named character reference of the form "
189
224
"``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. "
190
225
"``'gt'``). This method is never called if *convert_charrefs* is ``True``."
191
226
msgstr ""
227
+ "呼叫此方法來處理形式為 ``&name;`` (例如 ``>``)的附名字元參照,其中 "
228
+ "*name* 是一般實體參照(例如 ``'gt'``)。如果 *convert_charrefs* 為 ``True``,"
229
+ "則永遠不會呼叫此方法。"
192
230
193
231
#: ../../library/html.parser.rst:175
194
232
msgid ""
@@ -198,18 +236,24 @@ msgid ""
198
236
"in this case the method will receive ``'62'`` or ``'x3E'``. This method is "
199
237
"never called if *convert_charrefs* is ``True``."
200
238
msgstr ""
239
+ "呼叫此方法來處理 ``#NNN;`` 和 ``&#xNNN;`` 形式的十進位和十六進位數字字元參"
240
+ "照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>``;在這種"
241
+ "情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 *convert_charrefs* 為 "
242
+ "``True``,則永遠不會呼叫此方法。"
201
243
202
244
#: ../../library/html.parser.rst:184
203
245
msgid ""
204
246
"This method is called when a comment is encountered (e.g. ``<!--comment--"
205
247
">``)."
206
- msgstr ""
248
+ msgstr "當遇到註解時呼叫此方法(例如 ``<!--comment-->``)。 "
207
249
208
250
#: ../../library/html.parser.rst:186
209
251
msgid ""
210
252
"For example, the comment ``<!-- comment -->`` will cause this method to be "
211
253
"called with the argument ``' comment '``."
212
254
msgstr ""
255
+ "舉例來說,註解 ``<!-- comment -->`` 會使得此方法被以引數 ``' comment '`` 來呼"
256
+ "叫。"
213
257
214
258
#: ../../library/html.parser.rst:189
215
259
msgid ""
@@ -218,18 +262,25 @@ msgid ""
218
262
"[endif]-->``, this method will receive ``'[if IE 9]>IE9-specific content<!"
219
263
"[endif]'``."
220
264
msgstr ""
265
+ "Internet Explorer 條件式註解(conditional comments, condcoms)的內容也會被發"
266
+ "送到這個方法,故以 ``<!--[if IE 9]>IE9-specific content<![endif]-->`` 為例,"
267
+ "這個方法將會收到 ``'[if IE 9]>IE9-specific content<![endif]'``。"
221
268
222
269
#: ../../library/html.parser.rst:196
223
270
msgid ""
224
271
"This method is called to handle an HTML doctype declaration (e.g. ``<!"
225
272
"DOCTYPE html>``)."
226
273
msgstr ""
274
+ "呼叫此方法來處理 HTML 文件類型聲明 (doctype declaration)(例如 ``<!DOCTYPE "
275
+ "html>``)。"
227
276
228
277
#: ../../library/html.parser.rst:199
229
278
msgid ""
230
279
"The *decl* parameter will be the entire contents of the declaration inside "
231
280
"the ``<!...>`` markup (e.g. ``'DOCTYPE html'``)."
232
281
msgstr ""
282
+ "*decl* 參數將是 ``<!...>`` 標記內聲明部分的全部內容(例如 ``'DOCTYPE "
283
+ "html'``)。"
233
284
234
285
#: ../../library/html.parser.rst:205
235
286
msgid ""
@@ -239,25 +290,33 @@ msgid ""
239
290
"called as ``handle_pi(\" proc color='red'\" )``. It is intended to be "
240
291
"overridden by a derived class; the base class implementation does nothing."
241
292
msgstr ""
293
+ "遇到處理指示 (processing instruction) 時會呼叫的方法。 *data* 參數將包含整個"
294
+ "處理指示。例如,對於處理指示 ``<?proc color='red'>``,這個方法將以 "
295
+ "``handle_pi(\" proc color='red'\" )`` 形式被呼叫。它旨在被衍生類別覆蓋;基底類"
296
+ "別實作中什麼都不做。"
242
297
243
298
#: ../../library/html.parser.rst:213
244
299
msgid ""
245
300
"The :class:`HTMLParser` class uses the SGML syntactic rules for processing "
246
301
"instructions. An XHTML processing instruction using the trailing ``'?'`` "
247
302
"will cause the ``'?'`` to be included in *data*."
248
303
msgstr ""
304
+ ":class:`HTMLParser` 類別使用 SGML 語法規則來處理指示。使用有 ``?`` 跟隨在後面"
305
+ "的 XHTML 處理指示將導致 ``?`` 被包含在 *data* 中。"
249
306
250
307
#: ../../library/html.parser.rst:220
251
308
msgid ""
252
309
"This method is called when an unrecognized declaration is read by the parser."
253
- msgstr ""
310
+ msgstr "當剖析器讀取無法識別的聲明時會呼叫此方法。 "
254
311
255
312
#: ../../library/html.parser.rst:222
256
313
msgid ""
257
314
"The *data* parameter will be the entire contents of the declaration inside "
258
315
"the ``<![...]>`` markup. It is sometimes useful to be overridden by a "
259
316
"derived class. The base class implementation does nothing."
260
317
msgstr ""
318
+ "*data* 參數將是 ``<![...]>`` 標記內聲明的全部內容。有時被衍生類別被覆蓋會是好"
319
+ "用的。在基底類別實作中什麼都不做。"
261
320
262
321
#: ../../library/html.parser.rst:230
263
322
msgid "Examples"
@@ -268,41 +327,68 @@ msgid ""
268
327
"The following class implements a parser that will be used to illustrate more "
269
328
"examples::"
270
329
msgstr ""
330
+ "以下類別實作了一個剖析器,將用於解說更多範例:\n"
331
+ "\n"
332
+ "::"
271
333
272
334
#: ../../library/html.parser.rst:269
273
335
msgid "Parsing a doctype::"
274
336
msgstr ""
337
+ "剖析文件類型:\n"
338
+ "\n"
339
+ "::"
275
340
276
341
#: ../../library/html.parser.rst:275
277
342
msgid "Parsing an element with a few attributes and a title::"
278
343
msgstr ""
344
+ "剖析一個具有一些屬性和標題的元素:\n"
345
+ "\n"
346
+ "::"
279
347
280
348
#: ../../library/html.parser.rst:287
281
349
msgid ""
282
350
"The content of ``script`` and ``style`` elements is returned as is, without "
283
351
"further parsing::"
284
352
msgstr ""
353
+ "``script`` 和 ``style`` 元素的內容按原樣回傳,無需進一步剖析:\n"
354
+ "\n"
355
+ "::"
285
356
286
357
#: ../../library/html.parser.rst:303
287
358
msgid "Parsing comments::"
288
359
msgstr ""
360
+ "剖析註解:\n"
361
+ "\n"
362
+ "::"
289
363
290
364
#: ../../library/html.parser.rst:310
291
365
msgid ""
292
366
"Parsing named and numeric character references and converting them to the "
293
367
"correct char (note: these 3 references are all equivalent to ``'>'``)::"
294
368
msgstr ""
369
+ "剖析附名 (named) 且為數值的 (numeric) 字元參照,並將它們轉換為正確的字元(注"
370
+ "意:這 3 個參照都等同於 ``'>'``):\n"
371
+ "\n"
372
+ "::"
295
373
296
374
#: ../../library/html.parser.rst:318
297
375
msgid ""
298
376
"Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but :meth:"
299
377
"`~HTMLParser.handle_data` might be called more than once (unless "
300
378
"*convert_charrefs* is set to ``True``)::"
301
379
msgstr ""
380
+ "將不完整的區塊提供給 :meth:`~HTMLParser.feed` 是可行的,但是 :meth:"
381
+ "`~HTMLParser.handle_data` 可能會被多次呼叫(除非 *convert_charrefs* 設定為 "
382
+ "``True``):\n"
383
+ "\n"
384
+ "::"
302
385
303
386
#: ../../library/html.parser.rst:331
304
387
msgid "Parsing invalid HTML (e.g. unquoted attributes) also works::"
305
388
msgstr ""
389
+ "也能夠剖析無效的 HTML(例如未加引號的屬性):\n"
390
+ "\n"
391
+ "::"
306
392
307
393
#: ../../library/html.parser.rst:9
308
394
msgid "HTML"
0 commit comments