55#
66# Translators:
778- # walkinrain <[email protected] >, 201998# Shengjing Zhu <[email protected] >, 20199+ # walkinrain <[email protected] >, 20191010#
1111#, fuzzy
1212msgid ""
@@ -15,7 +15,7 @@ msgstr ""
1515"Report-Msgid-Bugs-To : \n "
1616"POT-Creation-Date : 2019-01-01 10:14+0900\n "
1717"PO-Revision-Date : 2017-02-16 23:13+0000\n "
18- "Last-Translator : Shengjing Zhu <zsj950618@gmail .com>, 2019\n "
18+ "Last-Translator : walkinrain <walkinrain2008@163 .com>, 2019\n "
1919"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2020"MIME-Version : 1.0\n "
2121"Content-Type : text/plain; charset=UTF-8\n "
@@ -25,18 +25,18 @@ msgstr ""
2525
2626#: ../../library/html.parser.rst:2
2727msgid ":mod:`html.parser` --- Simple HTML and XHTML parser"
28- msgstr ":mod:`html.parser`---简单的HTML和XHTML解析器 "
28+ msgstr ":mod:`html.parser` --- 简单的 HTML 和 XHTML 解析器 "
2929
3030#: ../../library/html.parser.rst:7
3131msgid "**Source code:** :source:`Lib/html/parser.py`"
32- msgstr "**源代码:**:source:`Lib/html/parser.py`"
32+ msgstr "**源代码:** :source:`Lib/html/parser.py`"
3333
3434#: ../../library/html.parser.rst:15
3535msgid ""
3636"This module defines a class :class:`HTMLParser` which serves as the basis "
3737"for parsing text files formatted in HTML (HyperText Mark-up Language) and "
3838"XHTML."
39- msgstr "这个模块定义了一个 :class:`HTMLParser`类,为HTML(超文本标记语言) 和 XHTML 文本文件解析提供基础。"
39+ msgstr "这个模块定义了一个 :class:`HTMLParser` 类,为 HTML(超文本标记语言) 和 XHTML 文本文件解析提供基础。"
4040
4141#: ../../library/html.parser.rst:20
4242msgid "Create a parser instance able to parse invalid markup."
@@ -48,6 +48,8 @@ msgid ""
4848"(except the ones in ``script``/``style`` elements) are automatically "
4949"converted to the corresponding Unicode characters."
5050msgstr ""
51+ "如果 *convert_charrefs* 为 ``True`` (缺省) ,则所有转义字符(``script``/``style``元素中的除外) "
52+ "都会自动转换为相应的Unicode字符。 "
5153
5254#: ../../library/html.parser.rst:26
5355msgid ""
@@ -56,35 +58,36 @@ msgid ""
5658"encountered. The user should subclass :class:`.HTMLParser` and override its"
5759" methods to implement the desired behavior."
5860msgstr ""
59- "一个:class:`.HTMLParser`实例用来接受HTML数据,并在标记开始,标记结束,文本,注释和其他元素标记的时候调用对应的方法。使用者应子类化"
60- " :class:`.HTMLParser` 并重载其方法用于实现所需的行为。"
61+ "一个 :class:`.HTMLParser` 类的实例用来接受 HTML "
62+ "数据,并在标记开始、标记结束、文本、注释和其他元素标记出现的时候调用对应的方法。要实现具体的行为,请使用 :class:`.HTMLParser` "
63+ "的子类并重载其方法。"
6164
6265#: ../../library/html.parser.rst:31
6366msgid ""
6467"This parser does not check that end tags match start tags or call the end-"
6568"tag handler for elements which are closed implicitly by closing an outer "
6669"element."
67- msgstr ""
70+ msgstr "这个解析器不检查结束标记是否与开始标记匹配,也不会因外层元素完毕而隐式关闭了的元素引发结束标记处理。 "
6871
6972#: ../../library/html.parser.rst:34
7073msgid "*convert_charrefs* keyword argument added."
7174msgstr "*convert_charrefs* 关键字参数被添加。"
7275
7376#: ../../library/html.parser.rst:37
7477msgid "The default value for argument *convert_charrefs* is now ``True``."
75- msgstr ""
78+ msgstr " *convert_charrefs* 参数的缺省值现在为 ``True``。 "
7679
7780#: ../../library/html.parser.rst:42
7881msgid "Example HTML Parser Application"
79- msgstr "HTML解析器应用程序的示例 "
82+ msgstr "HTML 解析器的示例程序 "
8083
8184#: ../../library/html.parser.rst:44
8285msgid ""
8386"As a basic example, below is a simple HTML parser that uses the "
8487":class:`HTMLParser` class to print out start tags, end tags, and data as "
8588"they are encountered::"
8689msgstr ""
87- "下面是简单的HTML解析器的一个基本示例 ,使用:class:`HTMLParser` 类,当遇到开始标记, 结束标记以及数据的时候将内容打印出来。"
90+ "下面是简单的 HTML 解析器的一个基本示例 ,使用 :class:`HTMLParser` 类,当遇到开始标记、 结束标记以及数据的时候将内容打印出来。"
8891
8992#: ../../library/html.parser.rst:64
9093msgid "The output will then be:"
@@ -104,6 +107,8 @@ msgid ""
104107"complete elements; incomplete data is buffered until more data is fed or "
105108":meth:`close` is called. *data* must be :class:`str`."
106109msgstr ""
110+ "填充一些文本到解析器中。如果包含完整的元素,则被处理;如果数据不完整,将被缓冲直到更多的数据被填充,或者 :meth:`close` "
111+ "被调用。*data* 必须为 :class:`str` 类型。"
107112
108113#: ../../library/html.parser.rst:97
109114msgid ""
@@ -112,8 +117,8 @@ msgid ""
112117"additional processing at the end of the input, but the redefined version "
113118"should always call the :class:`HTMLParser` base class method :meth:`close`."
114119msgstr ""
115- "如同后面跟着一个文件结束标记一样,强制处理所有缓冲数据。这个方法能被派生类重新定义,用于在输入的末尾定义附加处理,但是重定义的版本将始终调用基类 "
116- ":class:`HTMLParser` 的 :meth:`close`方法。"
120+ "如同后面跟着一个文件结束标记一样,强制处理所有缓冲数据。这个方法能被派生类重新定义,用于在输入的末尾定义附加处理,但是重定义的版本应当始终调用基类 "
121+ ":class:`HTMLParser` 的 :meth:`close` 方法。"
117122
118123#: ../../library/html.parser.rst:105
119124msgid ""
@@ -123,7 +128,7 @@ msgstr "重置实例。丢失所有未处理的数据。在实例化阶段被隐
123128
124129#: ../../library/html.parser.rst:111
125130msgid "Return current line number and offset."
126- msgstr "返回当前行号和列数 。"
131+ msgstr "返回当前行号和偏移值 。"
127132
128133#: ../../library/html.parser.rst:116
129134msgid ""
@@ -140,13 +145,14 @@ msgid ""
140145"class implementations do nothing (except for "
141146":meth:`~HTMLParser.handle_startendtag`):"
142147msgstr ""
143- "下列方法将在遇到数据或者标记元素的时候被调用。他们需要在子类种重载。基类实现无任何处理(除了:meth:`~HTMLParser.handle_startendtag`):"
148+ "下列方法将在遇到数据或者标记元素的时候被调用。他们需要在子类中重载。基类的实现中没有任何实际操作(除了 "
149+ ":meth:`~HTMLParser.handle_startendtag` ):"
144150
145151#: ../../library/html.parser.rst:129
146152msgid ""
147153"This method is called to handle the start of a tag (e.g. ``<div "
148154"id=\" main\" >``)."
149- msgstr "这个方法在标签开始的时候被调用( 例如:``<div id=\" main\" >``) 。"
155+ msgstr "这个方法在标签开始的时候被调用( 例如: ``<div id=\" main\" >`` ) 。"
150156
151157#: ../../library/html.parser.rst:131
152158msgid ""
@@ -156,8 +162,8 @@ msgid ""
156162"translated to lower case, and quotes in the *value* have been removed, and "
157163"character and entity references have been replaced."
158164msgstr ""
159- "*tag*参数是小写的标记名。*attrs* 参数是一个 ``(name, value)`` 形式的列表,包含了所有在标记的 ``<>`` "
160- "括号中找到的属性。*name*转换为小写,*value*的引号被去除,字符和实体转义都被替换 。"
165+ "*tag* 参数是小写的标记名。*attrs* 参数是一个 ``(name, value)`` 形式的列表,包含了所有在标记的 ``<>`` "
166+ "括号中找到的属性。*name* 转换为小写,*value* 的引号被去除,字符和实体转义都会被替换 。"
161167
162168#: ../../library/html.parser.rst:137
163169msgid ""
@@ -172,16 +178,16 @@ msgstr ""
172178msgid ""
173179"All entity references from :mod:`html.entities` are replaced in the "
174180"attribute values."
175- msgstr ""
181+ msgstr "属性值中的所有实体转义,使用:mod:`html.entities`替换。 "
176182
177183#: ../../library/html.parser.rst:146
178184msgid ""
179185"This method is called to handle the end tag of an element (e.g. ``</div>``)."
180- msgstr "此方法被用来处理元素的结束标记( 例如:``</div>``) 。"
186+ msgstr "此方法被用来处理元素的结束标记( 例如: ``</div>`` ) 。"
181187
182188#: ../../library/html.parser.rst:148
183189msgid "The *tag* argument is the name of the tag converted to lower case."
184- msgstr "*tag*参数是小写的标签名。"
190+ msgstr "*tag* 参数是小写的标签名。"
185191
186192#: ../../library/html.parser.rst:153
187193msgid ""
@@ -191,19 +197,26 @@ msgid ""
191197"implementation simply calls :meth:`handle_starttag` and "
192198":meth:`handle_endtag`."
193199msgstr ""
200+ "类似于 :meth:`handle_starttag`, 只是在解析器遇到XHTML样式的空标记时被调用 (``<img ... />``). "
201+ "这个方法能被需要这种特殊词法信息的子类重载;默认实现仅简单调用 :meth:`handle_starttag` 和 "
202+ ":meth:`handle_endtag` 。"
194203
195204#: ../../library/html.parser.rst:161
196205msgid ""
197206"This method is called to process arbitrary data (e.g. text nodes and the "
198207"content of ``<script>...</script>`` and ``<style>...</style>``)."
199208msgstr ""
209+ "这个方法被用来处理任意数据(例如:文本节点和 ``<script>...</script>`` 以及 ``<style>...</style>`` "
210+ "中的内容)。"
200211
201212#: ../../library/html.parser.rst:167
202213msgid ""
203214"This method is called to process a named character reference of the form "
204215"``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g."
205216" ``'gt'``). This method is never called if *convert_charrefs* is ``True``."
206217msgstr ""
218+ "这个方法被用于处理 ``&name;`` 形式的命名字符转义(例如 ``>``), 其中 *name* 是通用的实体转义 (例如: "
219+ "``'gt'``)。如果 *convert_charrefs* 为 ``True``,该方法永远不会被调用。"
207220
208221#: ../../library/html.parser.rst:175
209222msgid ""
@@ -213,12 +226,15 @@ msgid ""
213226"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. "
214227"This method is never called if *convert_charrefs* is ``True``."
215228msgstr ""
229+ "这个方法被用来处理 ``&#NNN;`` 和 ``&#xNNN;`` 形式的十进制和十六进制转义字符。例如,``>`` "
230+ "等效的十进制形式为``>`` ,而十六进制形式为 ``>`` ; 在这种情况下,方法将收到 ``'62'`` 或 ``'x3E'``"
231+ " 。如果*convert_charrefs* 为 ``True`` ,则该方法永远不会被调用。"
216232
217233#: ../../library/html.parser.rst:184
218234msgid ""
219235"This method is called when a comment is encountered (e.g. ``<!--"
220236"comment-->``)."
221- msgstr "这个方法在遇到注释的时候被调用( 例如:``<!--comment-->``) 。"
237+ msgstr "这个方法在遇到注释的时候被调用( 例如: ``<!--comment-->`` ) 。"
222238
223239#: ../../library/html.parser.rst:186
224240msgid ""
@@ -233,18 +249,21 @@ msgid ""
233249"content<![endif]-->``, this method will receive ``'[if IE 9]>IE9-specific "
234250"content<![endif]'``."
235251msgstr ""
252+ "Internet Explorer 条件注释(condcoms)的内容也被发送到这个方法,因此,对于 ``<!--[if IE "
253+ "9]>IE9-specific content<![endif]-->`` , 这个方法将接受到 ``'[if IE 9]>IE9-specific "
254+ "content<![endif]'`` 。"
236255
237256#: ../../library/html.parser.rst:196
238257msgid ""
239258"This method is called to handle an HTML doctype declaration (e.g. "
240259"``<!DOCTYPE html>``)."
241- msgstr "这个方法用来处理HTML doctype 申明(例如 ``<!DOCTYPE html>``) 。"
260+ msgstr "这个方法用来处理 HTML doctype 申明(例如 ``<!DOCTYPE html>`` ) 。"
242261
243262#: ../../library/html.parser.rst:199
244263msgid ""
245264"The *decl* parameter will be the entire contents of the declaration inside "
246265"the ``<!...>`` markup (e.g. ``'DOCTYPE html'``)."
247- msgstr ""
266+ msgstr "*decl* 形参为 ``<!...>`` 标记中的所有内容(例如: ``'DOCTYPE html'`` )。 "
248267
249268#: ../../library/html.parser.rst:205
250269msgid ""
@@ -254,29 +273,30 @@ msgid ""
254273"called as ``handle_pi(\" proc color='red'\" )``. It is intended to be "
255274"overridden by a derived class; the base class implementation does nothing."
256275msgstr ""
257- "当遇到一个处理指令的时候此方法被调用。*data*形参将包含整个处理指令。例如,对于处理指令``<?proc "
258- "color='red'>``,这个方法将以``handle_pi(\" proc "
259- "color='red'\" )``形式被调用。它旨在被派生类重写;基类实现无任何处理。"
276+ "此方法在遇到处理指令的时候被调用。*data* 形参将包含整个处理指令。例如,对于处理指令 ``<?proc color='red'>`` "
277+ ",这个方法将以 ``handle_pi(\" proc color='red'\" )`` 形式被调用。它旨在被派生类重载;基类实现中无任何实际操作。"
260278
261279#: ../../library/html.parser.rst:213
262280msgid ""
263281"The :class:`HTMLParser` class uses the SGML syntactic rules for processing "
264282"instructions. An XHTML processing instruction using the trailing ``'?'`` "
265283"will cause the ``'?'`` to be included in *data*."
266284msgstr ""
285+ ":class:`HTMLParser`类使用SGML语法规则处理指令。XHTML处理指令使用 ``'?'`` 结尾将导致 ``'?'`` 包含在 "
286+ "*data* 中。"
267287
268288#: ../../library/html.parser.rst:220
269289msgid ""
270290"This method is called when an unrecognized declaration is read by the "
271291"parser."
272- msgstr "当解析器堆到无法识别的声明时 ,此方法被调用。"
292+ msgstr "当解析器读到无法识别的声明时 ,此方法被调用。"
273293
274294#: ../../library/html.parser.rst:222
275295msgid ""
276296"The *data* parameter will be the entire contents of the declaration inside "
277297"the ``<![...]>`` markup. It is sometimes useful to be overridden by a "
278298"derived class. The base class implementation does nothing."
279- msgstr ""
299+ msgstr "*data* 参数是``<![...]>`` 中的所有内容。有时候对派生类的重写有用。仅基类实现。 "
280300
281301#: ../../library/html.parser.rst:230
282302msgid "Examples"
@@ -286,11 +306,11 @@ msgstr "示例"
286306msgid ""
287307"The following class implements a parser that will be used to illustrate more"
288308" examples::"
289- msgstr ""
309+ msgstr "下面的类实现了一个解析器,用于更多示例的演示:: "
290310
291311#: ../../library/html.parser.rst:269
292312msgid "Parsing a doctype::"
293- msgstr ""
313+ msgstr "解析一个文档类型声明:: "
294314
295315#: ../../library/html.parser.rst:275
296316msgid "Parsing an element with a few attributes and a title::"
@@ -300,7 +320,7 @@ msgstr "解析一个具有一些属性和标题的元素::"
300320msgid ""
301321"The content of ``script`` and ``style`` elements is returned as is, without "
302322"further parsing::"
303- msgstr ""
323+ msgstr "``script`` 和 ``style`` 元素中的内容原样返回,无需进一步解析:: "
304324
305325#: ../../library/html.parser.rst:303
306326msgid "Parsing comments::"
@@ -318,7 +338,9 @@ msgid ""
318338":meth:`~HTMLParser.handle_data` might be called more than once (unless "
319339"*convert_charrefs* is set to ``True``)::"
320340msgstr ""
341+ "填充不完整的块给 :meth:`~HTMLParser.feed` 执行,:meth:`~HTMLParser.handle_data` "
342+ "可能会多次调用(除非 *convert_charrefs* 被设置为 ``True`` )::"
321343
322344#: ../../library/html.parser.rst:331
323345msgid "Parsing invalid HTML (e.g. unquoted attributes) also works::"
324- msgstr ""
346+ msgstr "解析无效的HTML(例如:未引用的属性) 也能正常运行:: "
0 commit comments