1- # SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2022, Python Software Foundation
1+ # Copyright (C) 2001-2023, Python Software Foundation
32# This file is distributed under the same license as the Python package.
43#
54# Translators:
5+ # Matt Wang <mattwang44@gmail.com>, 2023
66msgid ""
77msgstr ""
88"Project-Id-Version :Python 3.11\n "
99"Report-Msgid-Bugs-To :\n "
1010"POT-Creation-Date :2022-02-18 00:10+0000\n "
11- "PO-Revision-Date :2018 -05-23 16:03+0000 \n "
12- "Last-Translator :Adrian Liaw <adrianliaw2000 @gmail.com>\n "
11+ "PO-Revision-Date :2023 -05-04 22:54+0800 \n "
12+ "Last-Translator :Matt Wang <mattwang44 @gmail.com>\n "
1313"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
1414"tw)\n "
1515"Language :zh_TW\n "
1616"MIME-Version :1.0\n "
1717"Content-Type :text/plain; charset=UTF-8\n "
1818"Content-Transfer-Encoding :8bit\n "
1919"Plural-Forms :nplurals=1; plural=0;\n "
20+ "X-Generator :Poedit 3.2.2\n "
2021
2122#: ../../library/html.parser.rst:2
2223msgid ":mod:`html.parser` --- Simple HTML and XHTML parser"
23- msgstr ""
24+ msgstr ":mod:`html.parser` --- 簡單的 HTML 和 XHTML 剖析器 "
2425
2526#: ../../library/html.parser.rst:7
2627msgid "**Source code:** :source:`Lib/html/parser.py`"
@@ -32,17 +33,21 @@ msgid ""
3233"for parsing text files formatted in HTML (HyperText Mark-up Language) and "
3334"XHTML."
3435msgstr ""
36+ "該模組定義了一個類別 :class:`HTMLParser`,是剖析 (parse) HTML(HyperText "
37+ "Mark-up Language、超文本標記語言)和 XHTML 格式文本檔案的基礎。"
3538
3639#: ../../library/html.parser.rst:20
3740msgid "Create a parser instance able to parse invalid markup."
38- msgstr ""
41+ msgstr "建立一個能夠剖析無效標記的剖析器實例。 "
3942
4043#: ../../library/html.parser.rst:22
4144msgid ""
4245"If *convert_charrefs* is ``True`` (the default), all character references "
4346"(except the ones in ``script``/``style`` elements) are automatically "
4447"converted to the corresponding Unicode characters."
4548msgstr ""
49+ "如果 *convert_charrefs* 為 ``True`` (預設值),所有字元參照 (reference)"
50+ "( ``script``/``style`` 元素中的參照除外)將自動轉換為相應的 Unicode 字元。"
4651
4752#: ../../library/html.parser.rst:26
4853msgid ""
@@ -51,51 +56,62 @@ msgid ""
5156"encountered. The user should subclass :class:`.HTMLParser` and override its "
5257"methods to implement the desired behavior."
5358msgstr ""
59+ ":class:`.HTMLParser` 實例被提供 HTML 資料,並在遇到開始標籤、結束標籤、文本、"
60+ "註解和其他標記元素時呼叫處理程式 (handler) 方法。使用者應該繼承 :class:`."
61+ "HTMLParser` 並覆蓋其方法以實作所需的行為。"
5462
5563#: ../../library/html.parser.rst:31
5664msgid ""
5765"This parser does not check that end tags match start tags or call the end-"
5866"tag handler for elements which are closed implicitly by closing an outer "
5967"element."
6068msgstr ""
69+ "此剖析器不檢查結束標籤是否與開始標籤匹配,也不會為透過結束外部元素來隱晦地被"
70+ "結束的元素呼叫結束標籤處理程式。"
6171
6272#: ../../library/html.parser.rst:34
6373msgid "*convert_charrefs* keyword argument added."
64- msgstr ""
74+ msgstr "新增關鍵字引數 *convert_charrefs*。 "
6575
6676#: ../../library/html.parser.rst:37
6777msgid "The default value for argument *convert_charrefs* is now ``True``."
68- msgstr ""
78+ msgstr "引數 *convert_charrefs* 的預設值現在是 ``True``。 "
6979
7080#: ../../library/html.parser.rst:42
7181msgid "Example HTML Parser Application"
72- msgstr ""
82+ msgstr "HTML 剖析器應用程式範例 "
7383
7484#: ../../library/html.parser.rst:44
7585msgid ""
7686"As a basic example, below is a simple HTML parser that uses the :class:"
7787"`HTMLParser` class to print out start tags, end tags, and data as they are "
7888"encountered::"
7989msgstr ""
90+ "以下的基礎範例是一個簡單的 HTML 剖析器,它使用 :class:`HTMLParser` 類別,當遇"
91+ "到開始標籤、結束標籤和資料時將它們印出:\n"
92+ "\n"
93+ "::"
8094
8195#: ../../library/html.parser.rst:64
8296msgid "The output will then be:"
83- msgstr ""
97+ msgstr "輸出將是: "
8498
8599#: ../../library/html.parser.rst:83
86100msgid ":class:`.HTMLParser` Methods"
87- msgstr ""
101+ msgstr ":class:`.HTMLParser` 方法 "
88102
89103#: ../../library/html.parser.rst:85
90104msgid ":class:`HTMLParser` instances have the following methods:"
91- msgstr ""
105+ msgstr ":class:`HTMLParser` 實例具有以下方法: "
92106
93107#: ../../library/html.parser.rst:90
94108msgid ""
95109"Feed some text to the parser. It is processed insofar as it consists of "
96110"complete elements; incomplete data is buffered until more data is fed or :"
97111"meth:`close` is called. *data* must be :class:`str`."
98112msgstr ""
113+ "向剖析器提供一些文本。只要它由完整的元素組成,它就會被處理;不完整的資料會被"
114+ "緩衝,直到輸入更多資料或呼叫 :meth:`close`。 *data* 必須是 :class:`str`。"
99115
100116#: ../../library/html.parser.rst:97
101117msgid ""
@@ -104,16 +120,19 @@ msgid ""
104120"additional processing at the end of the input, but the redefined version "
105121"should always call the :class:`HTMLParser` base class method :meth:`close`."
106122msgstr ""
123+ "強制處理所有緩衝資料,如同它後面跟有文件結束標籤一樣。此方法可能有被衍生類別"
124+ "重新定義,以在輸入末尾定義額外的處理,但重新定義的版本仍應要呼叫 :class:"
125+ "`HTMLParser` 基底類別方法 :meth:`close`。"
107126
108127#: ../../library/html.parser.rst:105
109128msgid ""
110129"Reset the instance. Loses all unprocessed data. This is called implicitly "
111130"at instantiation time."
112- msgstr ""
131+ msgstr "重置實例。丟棄所有未處理的資料。這在實例化時被會隱晦地呼叫。 "
113132
114133#: ../../library/html.parser.rst:111
115134msgid "Return current line number and offset."
116- msgstr ""
135+ msgstr "回傳當前列號 (line number) 和偏移量 (offset)。 "
117136
118137#: ../../library/html.parser.rst:116
119138msgid ""
@@ -122,6 +141,9 @@ msgid ""
122141"with HTML\" as deployed\" or for re-generating input with minimal changes "
123142"(whitespace between attributes can be preserved, etc.)."
124143msgstr ""
144+ "回傳最近開啟 (open) 的開始標籤的文本。這對於結構化處理通常不必要,但在處理"
145+ "「已部署」的 HTML 或以最少的更改重新生成輸入(可以保留屬性之間的空白等)時可"
146+ "能很有用。"
125147
126148#: ../../library/html.parser.rst:122
127149msgid ""
@@ -130,12 +152,14 @@ msgid ""
130152"class implementations do nothing (except for :meth:`~HTMLParser."
131153"handle_startendtag`):"
132154msgstr ""
155+ "當遇到資料或標記元素時將呼叫以下方法,並且它們應在子類別中被覆蓋。基底類別實"
156+ "作什麼都不做(除了 :meth:`~HTMLParser.handle_startendtag`):"
133157
134158#: ../../library/html.parser.rst:129
135159msgid ""
136160"This method is called to handle the start tag of an element (e.g. ``<div id="
137161"\" main\" >``)."
138- msgstr ""
162+ msgstr "呼叫此方法來處理元素的開始標籤(例如 ``<div id= \" main \" >``)。 "
139163
140164#: ../../library/html.parser.rst:131
141165msgid ""
@@ -145,28 +169,33 @@ msgid ""
145169"translated to lower case, and quotes in the *value* have been removed, and "
146170"character and entity references have been replaced."
147171msgstr ""
172+ "*tag* 引數是轉換為小寫的標籤名稱。 *attrs* 引數是一個 ``(name, value)`` 對的"
173+ "列表,包含在標籤的 ``<>`` 括號內找到的屬性。 *name* 將被轉成小寫,*value* 中"
174+ "的引號會被刪除,字元和實體參照也會被替換。"
148175
149176#: ../../library/html.parser.rst:137
150177msgid ""
151178"For instance, for the tag ``<A HREF=\" https://www.cwi.nl/\" >``, this method "
152179"would be called as ``handle_starttag('a', [('href', 'https://www.cwi."
153180"nl/')])``."
154181msgstr ""
182+ "例如,對於標籤 ``<A HREF=\" https://www.cwi.nl/\" >``,這個方法會以 "
183+ "``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` 的形式被呼叫。"
155184
156185#: ../../library/html.parser.rst:140
157186msgid ""
158187"All entity references from :mod:`html.entities` are replaced in the "
159188"attribute values."
160- msgstr ""
189+ msgstr "在屬性值中來自 :mod:`html.entities` 的所有實體參照都會被替換。 "
161190
162191#: ../../library/html.parser.rst:146
163192msgid ""
164193"This method is called to handle the end tag of an element (e.g. ``</div>``)."
165- msgstr ""
194+ msgstr "呼叫此方法來處理元素的結束標籤(例如 ``</div>``)。 "
166195
167196#: ../../library/html.parser.rst:148
168197msgid "The *tag* argument is the name of the tag converted to lower case."
169- msgstr ""
198+ msgstr "*tag* 引數是轉換為小寫的標籤名稱。 "
170199
171200#: ../../library/html.parser.rst:153
172201msgid ""
@@ -176,19 +205,28 @@ msgid ""
176205"implementation simply calls :meth:`handle_starttag` and :meth:"
177206"`handle_endtag`."
178207msgstr ""
208+ "與 :meth:`handle_starttag` 類似,但在剖析器遇到 XHTML 樣式的空標籤 "
209+ "(``<img ... />``) 時呼叫。這個方法可能被需要這個特定詞彙資訊 (lexical "
210+ "information) 的子類別覆蓋;預設實作只是呼叫 :meth:`handle_starttag` 和 :meth:"
211+ "`handle_endtag`。"
179212
180213#: ../../library/html.parser.rst:161
181214msgid ""
182215"This method is called to process arbitrary data (e.g. text nodes and the "
183216"content of ``<script>...</script>`` and ``<style>...</style>``)."
184217msgstr ""
218+ "呼叫此方法來處理任意資料(例如文本節點與 ``<script>...</script>`` 和 "
219+ "``<style>...</style>`` 的內容)。"
185220
186221#: ../../library/html.parser.rst:167
187222msgid ""
188223"This method is called to process a named character reference of the form "
189224"``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. "
190225"``'gt'``). This method is never called if *convert_charrefs* is ``True``."
191226msgstr ""
227+ "呼叫此方法來處理形式為 ``&name;`` (例如 ``>``)的附名字元參照,其中 "
228+ "*name* 是一般實體參照(例如 ``'gt'``)。如果 *convert_charrefs* 為 ``True``,"
229+ "則永遠不會呼叫此方法。"
192230
193231#: ../../library/html.parser.rst:175
194232msgid ""
@@ -198,18 +236,24 @@ msgid ""
198236"in this case the method will receive ``'62'`` or ``'x3E'``. This method is "
199237"never called if *convert_charrefs* is ``True``."
200238msgstr ""
239+ "呼叫此方法來處理 ``#NNN;`` 和 ``&#xNNN;`` 形式的十進位和十六進位數字字元參"
240+ "照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>``;在這種"
241+ "情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 *convert_charrefs* 為 "
242+ "``True``,則永遠不會呼叫此方法。"
201243
202244#: ../../library/html.parser.rst:184
203245msgid ""
204246"This method is called when a comment is encountered (e.g. ``<!--comment--"
205247">``)."
206- msgstr ""
248+ msgstr "當遇到註解時呼叫此方法(例如 ``<!--comment-->``)。 "
207249
208250#: ../../library/html.parser.rst:186
209251msgid ""
210252"For example, the comment ``<!-- comment -->`` will cause this method to be "
211253"called with the argument ``' comment '``."
212254msgstr ""
255+ "舉例來說,註解 ``<!-- comment -->`` 會使得此方法被以引數 ``' comment '`` 來呼"
256+ "叫。"
213257
214258#: ../../library/html.parser.rst:189
215259msgid ""
@@ -218,18 +262,25 @@ msgid ""
218262"[endif]-->``, this method will receive ``'[if IE 9]>IE9-specific content<!"
219263"[endif]'``."
220264msgstr ""
265+ "Internet Explorer 條件式註解(conditional comments, condcoms)的內容也會被發"
266+ "送到這個方法,故以 ``<!--[if IE 9]>IE9-specific content<![endif]-->`` 為例,"
267+ "這個方法將會收到 ``'[if IE 9]>IE9-specific content<![endif]'``。"
221268
222269#: ../../library/html.parser.rst:196
223270msgid ""
224271"This method is called to handle an HTML doctype declaration (e.g. ``<!"
225272"DOCTYPE html>``)."
226273msgstr ""
274+ "呼叫此方法來處理 HTML 文件類型聲明 (doctype declaration)(例如 ``<!DOCTYPE "
275+ "html>``)。"
227276
228277#: ../../library/html.parser.rst:199
229278msgid ""
230279"The *decl* parameter will be the entire contents of the declaration inside "
231280"the ``<!...>`` markup (e.g. ``'DOCTYPE html'``)."
232281msgstr ""
282+ "*decl* 參數將是 ``<!...>`` 標記內聲明部分的全部內容(例如 ``'DOCTYPE "
283+ "html'``)。"
233284
234285#: ../../library/html.parser.rst:205
235286msgid ""
@@ -239,25 +290,33 @@ msgid ""
239290"called as ``handle_pi(\" proc color='red'\" )``. It is intended to be "
240291"overridden by a derived class; the base class implementation does nothing."
241292msgstr ""
293+ "遇到處理指示 (processing instruction) 時會呼叫的方法。 *data* 參數將包含整個"
294+ "處理指示。例如,對於處理指示 ``<?proc color='red'>``,這個方法將以 "
295+ "``handle_pi(\" proc color='red'\" )`` 形式被呼叫。它旨在被衍生類別覆蓋;基底類"
296+ "別實作中什麼都不做。"
242297
243298#: ../../library/html.parser.rst:213
244299msgid ""
245300"The :class:`HTMLParser` class uses the SGML syntactic rules for processing "
246301"instructions. An XHTML processing instruction using the trailing ``'?'`` "
247302"will cause the ``'?'`` to be included in *data*."
248303msgstr ""
304+ ":class:`HTMLParser` 類別使用 SGML 語法規則來處理指示。使用有 ``?`` 跟隨在後面"
305+ "的 XHTML 處理指示將導致 ``?`` 被包含在 *data* 中。"
249306
250307#: ../../library/html.parser.rst:220
251308msgid ""
252309"This method is called when an unrecognized declaration is read by the parser."
253- msgstr ""
310+ msgstr "當剖析器讀取無法識別的聲明時會呼叫此方法。 "
254311
255312#: ../../library/html.parser.rst:222
256313msgid ""
257314"The *data* parameter will be the entire contents of the declaration inside "
258315"the ``<![...]>`` markup. It is sometimes useful to be overridden by a "
259316"derived class. The base class implementation does nothing."
260317msgstr ""
318+ "*data* 參數將是 ``<![...]>`` 標記內聲明的全部內容。有時被衍生類別被覆蓋會是好"
319+ "用的。在基底類別實作中什麼都不做。"
261320
262321#: ../../library/html.parser.rst:230
263322msgid "Examples"
@@ -268,38 +327,65 @@ msgid ""
268327"The following class implements a parser that will be used to illustrate more "
269328"examples::"
270329msgstr ""
330+ "以下類別實作了一個剖析器,將用於解說更多範例:\n"
331+ "\n"
332+ "::"
271333
272334#: ../../library/html.parser.rst:269
273335msgid "Parsing a doctype::"
274336msgstr ""
337+ "剖析文件類型:\n"
338+ "\n"
339+ "::"
275340
276341#: ../../library/html.parser.rst:275
277342msgid "Parsing an element with a few attributes and a title::"
278343msgstr ""
344+ "剖析一個具有一些屬性和標題的元素:\n"
345+ "\n"
346+ "::"
279347
280348#: ../../library/html.parser.rst:287
281349msgid ""
282350"The content of ``script`` and ``style`` elements is returned as is, without "
283351"further parsing::"
284352msgstr ""
353+ "``script`` 和 ``style`` 元素的內容按原樣回傳,無需進一步剖析:\n"
354+ "\n"
355+ "::"
285356
286357#: ../../library/html.parser.rst:303
287358msgid "Parsing comments::"
288359msgstr ""
360+ "剖析註解:\n"
361+ "\n"
362+ "::"
289363
290364#: ../../library/html.parser.rst:310
291365msgid ""
292366"Parsing named and numeric character references and converting them to the "
293367"correct char (note: these 3 references are all equivalent to ``'>'``)::"
294368msgstr ""
369+ "剖析附名 (named) 且為數值的 (numeric) 字元參照,並將它們轉換為正確的字元(注"
370+ "意:這 3 個參照都等同於 ``'>'``):\n"
371+ "\n"
372+ "::"
295373
296374#: ../../library/html.parser.rst:318
297375msgid ""
298376"Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but :meth:"
299377"`~HTMLParser.handle_data` might be called more than once (unless "
300378"*convert_charrefs* is set to ``True``)::"
301379msgstr ""
380+ "將不完整的區塊提供給 :meth:`~HTMLParser.feed` 是可行的,但是 :meth:"
381+ "`~HTMLParser.handle_data` 可能會被多次呼叫(除非 *convert_charrefs* 設定為 "
382+ "``True``):\n"
383+ "\n"
384+ "::"
302385
303386#: ../../library/html.parser.rst:331
304387msgid "Parsing invalid HTML (e.g. unquoted attributes) also works::"
305388msgstr ""
389+ "也能夠剖析無效的 HTML(例如未加引號的屬性):\n"
390+ "\n"
391+ "::"