@@ -59,7 +59,7 @@ msgid ""
5959"having a MIME type such as :mimetype:`multipart/\\ *` or "
6060":mimetype:`message/rfc822`."
6161msgstr ""
62- "一份电子邮件信息由*头*和 *负载*(又被称为*内容*)组成。头遵循 :rfc:`5322` 或者 :rfc:`6532` "
62+ "一份电子邮件信息由 *头* 和 *负载* (又被称为 *内容* )组成。头遵循 :rfc:`5322` 或者 :rfc:`6532` "
6363"风格的字段名和值,字段名和字段值之间由一个冒号隔开。这个冒号既不属于字段名,也不属于字段值。信息的负载可能是一段简单的文字消息,也可能是一个二进制的对象,更可能是由多个拥有各自头和负载的子信息组成的结构化子信息序列。对于后者类型的负载,信息的"
6464" MIME 类型将会被指明为诸如 :mimetype:`multipart/\\ *` 或 :mimetype:`message/rfc822` 的类型。"
6565
@@ -74,6 +74,10 @@ msgid ""
7474"type), for operating on the payload, for generating a serialized version of "
7575"the message, and for recursively walking over the object tree."
7676msgstr ""
77+ ":class:`EmailMessage` 对象所提供的抽象概念模型是一个头字段组成的有序字典加一个代表 :rfc:`5322` 标准的信息体的 "
78+ "*负载* 。负载有可能是一系列子 ``EmailMessage`` "
79+ "对象的列表。你除了可以通过一般的字典方法来访问头字段名和值,还可以使用特制方法来访问头的特定字段(比如说 MIME "
80+ "内容类型字段)、操纵负载、生成信息的序列化版本、递归遍历对象树。"
7781
7882#: ../../library/email.message.rst:40
7983msgid ""
@@ -85,6 +89,8 @@ msgid ""
8589"keys. Additional methods are provided for working with headers that have "
8690"duplicate keys."
8791msgstr ""
92+ ":class:`EmailMessage` "
93+ "的类字典接口的字典索引是头字段名,头字段名必须是ASCII值。字典值是带有一些附加方法的字符串。虽然头字段的存储和获取都是保留其原始大小写的,但是字段名的匹配是大小写不敏感的。与真正的字典不同,键与键之间不但存在顺序关系,还可以重复。我们提供了额外的方法来处理含有重复键的头。"
8894
8995#: ../../library/email.message.rst:47
9096msgid ""
@@ -93,6 +99,8 @@ msgid ""
9399"container documents such as :mimetype:`multipart/\\ *` and "
94100":mimetype:`message/rfc822` message objects."
95101msgstr ""
102+ "*负载* 是多样的。对于简单的信息对象,它是字符串或字节对象;对于诸如 :mimetype:`multipart/\\ *` 和 "
103+ ":mimetype:`message/rfc822` 信息对象的 MIME 容器文档,它是一个 :class:`EmailMessage` 对象列表。"
96104
97105#: ../../library/email.message.rst:55
98106msgid ""
@@ -103,6 +111,9 @@ msgid ""
103111"uses the Python standard ``\\ n`` line endings). For more information see "
104112"the :mod:`~email.policy` documentation."
105113msgstr ""
114+ "如果指定了 *policy* ,消息将由这个 *policy* 所指定的规则来更新和序列化信息的表达。如果没有指定 *policy* ,其将默认使用 "
115+ ":class:`~email.policy.default` 策略。这个策略遵循电子邮件的RFC标准,除了行终止符号(RFC要求使用 "
116+ "``\\ r\\ n`` ,此策略使用Python标准的 ``\\ n`` 行终止符)。请前往 :mod:`~email.policy` 的文档获取更多信息。"
106117
107118#: ../../library/email.message.rst:64
108119msgid ""
@@ -117,13 +128,21 @@ msgid ""
117128" formatting produced by the method, since the specified *policy* will be "
118129"passed to the :class:`~email.generator.Generator`."
119130msgstr ""
131+ "以一段扁平的字符串的形式返回整个信息对象。若可选的 *unixform* 参数为真,返回的字符串会包含信封头。 *unixform* 的默认值是 "
132+ "``False`` 。为了保持与基类 :class:`~email.message.Message` 的兼容性, *maxheaderlen* "
133+ "是被接受的,但是其默认值是 ``None`` 。这个默认值表示行长度由策略的 "
134+ ":attr:`~email.policy.EmailPolicy.max_line_length` 属性所控制。从信息实例所获取到的策略可以通过 "
135+ "*policy* 参数重写。这样可以对该方法所产生的输出进行略微的控制,因为指定的 *policy* 会被传递到 "
136+ ":class:`~email.generator.Generator` 当中。"
120137
121138#: ../../library/email.message.rst:76 ../../library/email.message.rst:114
122139msgid ""
123140"Flattening the message may trigger changes to the :class:`EmailMessage` if "
124141"defaults need to be filled in to complete the transformation to a string "
125142"(for example, MIME boundaries may be generated or modified)."
126143msgstr ""
144+ "扁平化信息可能会对 :class:`EmailMessage` 做出修改。这是因为为了完成向字符串的转换,一些内容需要使用默认值填入(举个例子,MIME"
145+ " 边界字段可能会被生成或被修改)。"
127146
128147#: ../../library/email.message.rst:80
129148msgid ""
@@ -134,27 +153,35 @@ msgid ""
134153" restricted to producing messages serialized as \" 7 bit clean\" when "
135154":attr:`~email.policy.EmailPolicy.utf8` is ``False``, which is the default."
136155msgstr ""
156+ "请注意,这个方法是为了便利而提供,不一定是适合你的应用程序的最理想的序列化信息的方法。这在你处理多封信息的时候尤甚。如果你需要使用更加灵活的API来序列化信息,请参见"
157+ " :class:`email.generator.Generator` 。同时请注意,当 "
158+ ":attr:`~email.policy.EmailPolicy.utf8` 属性为其默认值 ``False`` 的时候,本方法将限制其行为为生成以“7"
159+ " bit clean”方式序列化的信息。"
137160
138161#: ../../library/email.message.rst:88
139162msgid ""
140163"the default behavior when *maxheaderlen* is not specified was changed from "
141164"defaulting to 0 to defaulting to the value of *max_line_length* from the "
142165"policy."
143- msgstr ""
166+ msgstr "*maxheaderlen* 没有被指定时的默认行为从默认为0修改为默认为策略的 *max_line_length* 值。 "
144167
145168#: ../../library/email.message.rst:95
146169msgid ""
147170"Equivalent to ``as_string(policy=self.policy.clone(utf8=True))``. Allows "
148171"``str(msg)`` to produce a string containing the serialized message in a "
149172"readable format."
150173msgstr ""
174+ "与 ``as_string(policy=self.policy.clone(utf8=True))`` 等价。这将让 ``str(msg)`` "
175+ "产生的字符串包含人类可读的的序列化信息内容。"
151176
152177#: ../../library/email.message.rst:99
153178msgid ""
154179"the method was changed to use ``utf8=True``, thus producing an "
155180":rfc:`6531`-like message representation, instead of being a direct alias for"
156181" :meth:`as_string`."
157182msgstr ""
183+ "本方法开始使用 ``utf8=True`` ,而非 :meth:`as_string` 的直接替身。使用 ``utf8=True`` 会产生类似于 "
184+ ":rfc:`6531` 的信息表达。"
158185
159186#: ../../library/email.message.rst:106
160187msgid ""
@@ -166,6 +193,9 @@ msgid ""
166193"specified *policy* will be passed to the "
167194":class:`~email.generator.BytesGenerator`."
168195msgstr ""
196+ "以一段扁平的字节序列对象返回整个信息。若可选的 *unixform* 参数为真,返回的字符串会包含信封头。 *unixform* 的默认值是 "
197+ "``False`` 。从信息实例所获取到的策略可以通过 *policy* 参数重写。这样可以对该方法所产生的输出进行略微的控制,因为指定的 "
198+ "*policy* 会被传递到 :class:`~email.generator.BytesGenerator` 当中。"
169199
170200#: ../../library/email.message.rst:118
171201msgid ""
@@ -174,12 +204,14 @@ msgid ""
174204"dealing with multiple messages. See :class:`email.generator.BytesGenerator`"
175205" for a more flexible API for serializing messages."
176206msgstr ""
207+ "请注意,这个方法是为了便利而提供,不一定是适合你的应用程序的最理想的序列化信息的方法。这在你处理多封信息的时候尤甚。如果你需要使用更加灵活的API来序列化信息,请参见"
208+ " :class:`email.generator.BytesGenerator` 。"
177209
178210#: ../../library/email.message.rst:127
179211msgid ""
180212"Equivalent to :meth:`.as_bytes()`. Allows ``bytes(msg)`` to produce a bytes"
181213" object containing the serialized message."
182- msgstr ""
214+ msgstr "与 :meth:`.as_bytes()` 等价。这将让 ``bytes(msg)`` 产生一个包含序列化信息内容的字节序列对象。 "
183215
184216#: ../../library/email.message.rst:133
185217msgid ""
0 commit comments