@@ -290,6 +290,10 @@ msgid ""
290290" is a string (i.e. :meth:`is_multipart` is ``False``) and *i* is given, a "
291291":exc:`TypeError` is raised."
292292msgstr ""
293+ "传入可选参数 *i* 时,如果 :meth:`is_multipart` 为 ``True``,:meth:`get_payload` "
294+ "将返回载荷从零开始计数的第 *i* 个元素。 如果 *i* 小于 0 或大于等于载荷中的条目数则将引发 :exc:`IndexError`。 "
295+ "如果载荷是一个字符串 (即 :meth:`is_multipart` 为 ``False``) 且给出了 *i*,则会引发 "
296+ ":exc:`TypeError`。"
293297
294298#: ../../library/email.compat32-message.rst:202
295299msgid ""
@@ -306,6 +310,13 @@ msgid ""
306310"message's defect property (:class:`~email.errors.InvalidBase64PaddingDefect`"
307311" or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)."
308312msgstr ""
313+ "可选的 *decode* 是一个指明载荷是否应根据 :mailheader:`Content-Transfer-Encoding` 标头被解码的旗标。 "
314+ "当其值为 ``True`` 且消息没有多个部分时,如果此标头值为 ``quoted-printable`` 或 ``base64`` 则载荷将被解码。 "
315+ "如果使用了其他编码格式,或者找不到 :mailheader:`Content-Transfer-Encoding` 标头时,载荷将被原样返回(不编码)。"
316+ " 在所有情况下返回值都是二进制数据。 如果消息有多个部分且 *decode* 旗标为 ``True``,则将返回 ``None``。 如果载荷为 "
317+ "base64 但内容不完全正确(如缺少填充符、存在 base64 字母表以外的字符等),则将在消息的缺陷属性中添加适当的缺陷值 (分别为 "
318+ ":class:`~email.errors.InvalidBase64PaddingDefect` 或 "
319+ ":class:`~email.errors.InvalidBase64CharactersDefect`)。"
309320
310321#: ../../library/email.compat32-message.rst:216
311322msgid ""
@@ -317,6 +328,11 @@ msgid ""
317328"``charset`` is specified, or if the ``charset`` given is not recognized by "
318329"the email package, the body is decoded using the default ASCII charset."
319330msgstr ""
331+ "当 *decode* 为 ``False`` (默认值) 时消息体会作为字符串返回而不解码 :mailheader:`Content-Transfer-"
332+ "Encoding`。 但是,对于 :mailheader:`Content-Transfer-Encoding` 为 8bit 的情况,会尝试使用 "
333+ ":mailheader:`Content-Type` 标头指定的 ``charset`` 来解码原始字节串,并使用 ``replace`` "
334+ "错误处理程序。 如果未指定 ``charset``,或者如果指定的 ``charset`` 未被 email 包所识别,则会使用默认的 ASCII "
335+ "字符集来解码消息体。"
320336
321337#: ../../library/email.compat32-message.rst:225
322338msgid ""
@@ -325,20 +341,27 @@ msgid ""
325341":meth:`~email.message.EmailMessage.get_content` and "
326342":meth:`~email.message.EmailMessage.iter_parts`."
327343msgstr ""
344+ "这是一个过时的方法。 在 :class:`~email.emailmessage.EmailMessage` 类上它的功能已被 "
345+ ":meth:`~email.message.EmailMessage.get_content` 和 "
346+ ":meth:`~email.message.EmailMessage.iter_parts` 方法所替代。"
328347
329348#: ../../library/email.compat32-message.rst:233
330349msgid ""
331350"Set the entire message object's payload to *payload*. It is the client's "
332351"responsibility to ensure the payload invariants. Optional *charset* sets "
333352"the message's default character set; see :meth:`set_charset` for details."
334353msgstr ""
354+ "将整个消息对象的载荷设为 *payload*。 客户端要负责确保载荷的不变性。 可选的 *charset* 用于设置消息的默认字符集;详情请参阅 "
355+ ":meth:`set_charset`。"
335356
336357#: ../../library/email.compat32-message.rst:237
337358msgid ""
338359"This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` "
339360"class its functionality is replaced by "
340361":meth:`~email.message.EmailMessage.set_content`."
341362msgstr ""
363+ "这是一个过时的方法。 在 :class:`~email.emailmessage.EmailMessage` 类上它的功能已被 "
364+ ":meth:`~email.message.EmailMessage.set_content` 方法所替代。"
342365
343366#: ../../library/email.compat32-message.rst:244
344367msgid ""
@@ -493,7 +516,7 @@ msgstr ""
493516
494517#: ../../library/email.compat32-message.rst:373
495518msgid "Here are some additional useful methods:"
496- msgstr ""
519+ msgstr "以下是一些有用的附加方法: "
497520
498521#: ../../library/email.compat32-message.rst:378
499522msgid ""
@@ -531,19 +554,19 @@ msgstr ""
531554
532555#: ../../library/email.compat32-message.rst:404
533556msgid "Here's an example::"
534- msgstr ""
557+ msgstr "以下是为示例代码:: "
535558
536559#: ../../library/email.compat32-message.rst:408
537560msgid "This will add a header that looks like ::"
538561msgstr "会添加一个形如下文的头字段:"
539562
540563#: ../../library/email.compat32-message.rst:412
541564msgid "An example with non-ASCII characters::"
542- msgstr ""
565+ msgstr "使用非 ASCII 字符的示例代码:: "
543566
544567#: ../../library/email.compat32-message.rst:417
545568msgid "Which produces ::"
546- msgstr ""
569+ msgstr "它的输出结果为 :: "
547570
548571#: ../../library/email.compat32-message.rst:424
549572msgid ""
0 commit comments