@@ -166,6 +166,9 @@ msgid ""
166166":attr:`~email.policy.EmailPolicy.content_manager` provided by "
167167":attr:`~email.policy.EmailPolicy` and its derivatives."
168168msgstr ""
169+ "目前 email 包只提供了一个实体内容管理器 :data:`raw_data_manager`,不过在未来可能会添加更多。 "
170+ ":data:`raw_data_manager` 是由 :attr:`~email.policy.EmailPolicy` 及其衍生工具所提供的 "
171+ ":attr:`~email.policy.EmailPolicy.content_manager`。"
169172
170173#: ../../library/email.contentmanager.rst:99
171174msgid ""
@@ -179,6 +182,10 @@ msgid ""
179182" encoding, and it enables the use of the various ``add_`` methods, thereby "
180183"simplifying the creation of multipart messages."
181184msgstr ""
185+ "这个内容管理器仅提供了超出 :class:`~email.message.Message` 本身提供内容的最小接口:它只处理文本、原始字节串和 "
186+ ":class:`~email.message.Message` 对象。 不过相比基础 API,它具有显著的优势:在文本部分上执行 "
187+ "``get_content`` 将返回一个 unicode 字符串而无需由应用程序来手动解码,``set_content`` "
188+ "为控制添加到一个部分的标头和控制内容传输编码格式提供了丰富的选项集合,并且它还启用了多种 ``add_`` 方法,从而简化了多部分消息的创建过程。"
182189
183190#: ../../library/email.contentmanager.rst:111
184191msgid ""
@@ -189,27 +196,34 @@ msgid ""
189196"part and *errors* is specified, use it as the error handler when decoding "
190197"the payload to unicode. The default error handler is ``replace``."
191198msgstr ""
199+ "将指定部分的有效载荷作为字符串(对于 ``text`` 部分), :class:`~email.message.EmailMessage` 对象(对于 "
200+ "``message/rfc822`` 部分)或 ``bytes`` 对象(对于所有其他非多部分类型)返回。 如果是在 ``multipart`` "
201+ "上调用则会引发 :exc:`KeyError`。 如果指定部分是一个 ``text`` 部分并且指明了 *errors*,则会在将载荷解码为 "
202+ "unicode 时将其用作错误处理程序。 默认的错误处理程序是 ``replace``。"
192203
193204#: ../../library/email.contentmanager.rst:130
194205msgid "Add headers and payload to *msg*:"
195- msgstr ""
206+ msgstr "向 *msg* 添加标头和有效载荷: "
196207
197208#: ../../library/email.contentmanager.rst:132
198209msgid ""
199210"Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value."
200- msgstr ""
211+ msgstr "添加一个带有 ``maintype/subtype`` 值的 :mailheader:`Content-Type` 标头。 "
201212
202213#: ../../library/email.contentmanager.rst:135
203214msgid ""
204215"For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to "
205216"*subtype* if it is specified, or ``plain`` if it is not."
206217msgstr ""
218+ "对于 ``str``,将 MIME ``maintype`` 设为 ``text``,如果指定了子类型 *subtype* 则设为指定值,否则设为 "
219+ "``plain``。"
207220
208221#: ../../library/email.contentmanager.rst:137
209222msgid ""
210223"For ``bytes``, use the specified *maintype* and *subtype*, or raise a "
211224":exc:`TypeError` if they are not specified."
212225msgstr ""
226+ "对于 ``bytes``,将使用指定的 *maintype* 和 *subtype*,如果未指定则会引发 :exc:`TypeError`。"
213227
214228#: ../../library/email.contentmanager.rst:139
215229msgid ""
@@ -218,6 +232,9 @@ msgid ""
218232"``rfc822`` if it is not. If *subtype* is ``partial``, raise an error "
219233"(``bytes`` objects must be used to construct ``message/partial`` parts)."
220234msgstr ""
235+ "对于 :class:`~email.message.EmailMessage` 对象,将 maintype 设为 ``message``,并将指定的 "
236+ "subtype 设为 *subtype*,如果未指定则设为 ``rfc822``。 如果 *subtype* 为 "
237+ "``partial``,则引发一个错误(必须使用 ``bytes`` 对象来构造 ``message/partial`` 部分)。"
221238
222239#: ../../library/email.contentmanager.rst:145
223240msgid ""
@@ -226,6 +243,8 @@ msgid ""
226243"``utf-8``. If the specified *charset* is a known alias for a standard MIME "
227244"charset name, use the standard charset instead."
228245msgstr ""
246+ "如果提供了 *charset* (这只对 ``str`` 适用),则使用指定的字符集将字符串编码为字节串。 默认值为 ``utf-8``。 如果指定的 "
247+ "*charset* 是某个标准 MIME 字符集名称的已知别名,则会改用该标准字符集。"
229248
230249#: ../../library/email.contentmanager.rst:150
231250msgid ""
0 commit comments