@@ -171,6 +171,10 @@ msgid ""
171171"valid unicode characters as well so that it can parse un-encoded header "
172172"values."
173173msgstr ""
174+ "``kwds`` 是包含了一个预初始化键 ``defects`` 的字典。 ``defects`` 是一个空列表。 parse "
175+ "方法应当将任何已检测到的缺陷添加到此列表中。 在返回时,``kwds`` 字典 *必须* 至少包含 ``decoded`` 和 ``defects`` "
176+ "等键的值。 ``decoded`` 应当是标头的字符串值(即完全解码为 unicode 的标头值)。 parse 方法应当假定 *string* "
177+ "可能包含 content-transfer-encoded 部分,但也应当正确地处理全部有效的 unicode 字符以便它能解析未经编码的标头值。"
174178
175179#: ../../library/email.headerregistry.rst:105
176180msgid ""
@@ -179,13 +183,17 @@ msgid ""
179183"method if it wishes to set additional attributes beyond those provided by "
180184"``BaseHeader`` itself. Such an ``init`` method should look like this::"
181185msgstr ""
186+ "随后 ``BaseHeader`` 的 ``__new__`` 会创建标头实例,并调用其 ``init`` 方法。 专属类如果想要设置 "
187+ "``BaseHeader`` 自身所提供的属性之外的附加属性,只需提供一个 ``init`` 方法。 这样的 ``init`` 看起来应该是这样::"
182188
183189#: ../../library/email.headerregistry.rst:114
184190msgid ""
185191"That is, anything extra that the specialized class puts in to the ``kwds`` "
186192"dictionary should be removed and handled, and the remaining contents of "
187193"``kw`` (and ``args``) passed to the ``BaseHeader`` ``init`` method."
188194msgstr ""
195+ "也就是说,专属类放入 ``kwds`` 字典的任何额外内容都应当被移除和处理,并且 ``kw`` (和 ``args``) 的剩余内容会被传递给 "
196+ "``BaseHeader`` ``init`` 方法。"
189197
190198#: ../../library/email.headerregistry.rst:121
191199msgid ""
@@ -194,6 +202,8 @@ msgid ""
194202"The classic example of an unstructured header is the :mailheader:`Subject` "
195203"header."
196204msgstr ""
205+ "\" 非结构化\" 标头是 :rfc:`5322` 中默认的标头类型。 任何没有指定语法的标头都会被视为是非结构化的。 非结构化标头的经典例子是 "
206+ ":mailheader:`Subject` 标头。"
197207
198208#: ../../library/email.headerregistry.rst:126
199209msgid ""
@@ -207,10 +217,15 @@ msgid ""
207217"words. Defects are registered in such cases, as well as defects for issues "
208218"such as invalid characters within the encoded words or the non-encoded text."
209219msgstr ""
220+ "在 :rfc:`5322` 中,非结构化标头是指一段以 ASCII 字符集表示的任意文本。 但是 :rfc:`2047` 具有一个 "
221+ ":rfc:`5322` 兼容机制用来将标头值中的非 ASCII 文本编码为 ASCII 字符。 当包含已编码字的 *value* "
222+ "被传递给构造器时,``UnstructuredHeader`` 解析器会按照非结构化文本的 :rfc:`2047` 规则将此类已编码字转换为 "
223+ "unicode。 解析器会使用启发式机制来尝试解码一些不合规的已编码字。 "
224+ "在此种情况下各类缺陷,例如已编码字或未编码文本中的无效字符问题等缺陷将会被注册。"
210225
211226#: ../../library/email.headerregistry.rst:136
212227msgid "This header type provides no additional attributes."
213- msgstr ""
228+ msgstr "此标头类型未提供附加属性。 "
214229
215230#: ../../library/email.headerregistry.rst:141
216231msgid ""
0 commit comments