-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathemail.header.po
More file actions
373 lines (333 loc) · 18.7 KB
/
email.header.po
File metadata and controls
373 lines (333 loc) · 18.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Rafael Fontenelle <[email protected]>, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-25 16:03+0000\n"
"PO-Revision-Date: 2025-07-18 19:58+0000\n"
"Last-Translator: Rafael Fontenelle <[email protected]>, 2025\n"
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/email.header.rst:2
msgid ":mod:`!email.header`: Internationalized headers"
msgstr ":mod:`!email.header`: 国际化标头"
#: ../../library/email.header.rst:7
msgid "**Source code:** :source:`Lib/email/header.py`"
msgstr "**源代码:** :source:`Lib/email/header.py`"
#: ../../library/email.header.rst:11
msgid ""
"This module is part of the legacy (``Compat32``) email API. In the current "
"API encoding and decoding of headers is handled transparently by the "
"dictionary-like API of the :class:`~email.message.EmailMessage` class. In "
"addition to uses in legacy code, this module can be useful in applications "
"that need to completely control the character sets used when encoding "
"headers."
msgstr ""
"此模块是旧式 (``Compat32``) email API 的一部分。 在当前的 API 中标头的编码和解码是由 "
":class:`~email.message.EmailMessage` 类的字典型 API 来透明地处理的。 "
"除了在旧有代码中使用,此模块在需要完全控制当编码标头时所使用的字符集时也很有用处。"
#: ../../library/email.header.rst:17
msgid ""
"The remaining text in this section is the original documentation of the "
"module."
msgstr "本节中的其余文本是此模块的原始文档。"
#: ../../library/email.header.rst:19
msgid ""
":rfc:`2822` is the base standard that describes the format of email "
"messages. It derives from the older :rfc:`822` standard which came into "
"widespread use at a time when most email was composed of ASCII characters "
"only. :rfc:`2822` is a specification written assuming email contains only "
"7-bit ASCII characters."
msgstr ""
":rfc:`2822` 是描述电子邮件消息格式的基础标准。 它派生自更早的 :rfc:`822` 标准,该标准在大多数电子邮件仅由 ASCII "
"字符组成时已被广泛使用。 :rfc:`2822` 所描述的规范假定电子邮件都只包含 7 位 ASCII 字符。"
#: ../../library/email.header.rst:24
msgid ""
"Of course, as email has been deployed worldwide, it has become "
"internationalized, such that language specific character sets can now be "
"used in email messages. The base standard still requires email messages to "
"be transferred using only 7-bit ASCII characters, so a slew of RFCs have "
"been written describing how to encode email containing non-ASCII characters "
"into :rfc:`2822`\\ -compliant format. These RFCs include :rfc:`2045`, "
":rfc:`2046`, :rfc:`2047`, and :rfc:`2231`. The :mod:`email` package supports"
" these standards in its :mod:`email.header` and :mod:`email.charset` "
"modules."
msgstr ""
"当然,随着电子邮件在全球部署,它已经变得国际化了,例如电子邮件消息中现在可以使用特定语言的专属字符集。 这个基础标准仍然要求电子邮件消息只使用 7 位 "
"ASCII 字符来进行传输,为此编写了大量 RFC 来描述如何将包含非 ASCII 字符的电子邮件编码为符合 :rfc:`2822` 的格式。 这些 "
"RFC 包括 :rfc:`2045`, :rfc:`2046`, :rfc:`2047` 和 :rfc:`2231`。 :mod:`email` 包在其"
" :mod:`email.header` 和 :mod:`email.charset` 模块中支持了这些标准。"
#: ../../library/email.header.rst:33
msgid ""
"If you want to include non-ASCII characters in your email headers, say in "
"the :mailheader:`Subject` or :mailheader:`To` fields, you should use the "
":class:`Header` class and assign the field in the "
":class:`~email.message.Message` object to an instance of :class:`Header` "
"instead of using a string for the header value. Import the :class:`Header` "
"class from the :mod:`email.header` module. For example::"
msgstr ""
"如果你想在你的电子邮件标头中包括非 ASCII 字符,比如说是在 :mailheader:`Subject` 或 :mailheader:`To` "
"字段中,你应当使用 :class:`Header` 类并将 :class:`~email.message.Message` 对象中的字段赋值为 "
":class:`Header` 的实例而不是使用字符串作为字段值。 请从 :mod:`email.header` 模块导入 "
":class:`Header` 类。 例如::"
#: ../../library/email.header.rst:40
msgid ""
">>> from email.message import Message\n"
">>> from email.header import Header\n"
">>> msg = Message()\n"
">>> h = Header('p\\xf6stal', 'iso-8859-1')\n"
">>> msg['Subject'] = h\n"
">>> msg.as_string()\n"
"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'"
msgstr ""
">>> from email.message import Message\n"
">>> from email.header import Header\n"
">>> msg = Message()\n"
">>> h = Header('p\\xf6stal', 'iso-8859-1')\n"
">>> msg['Subject'] = h\n"
">>> msg.as_string()\n"
"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'"
#: ../../library/email.header.rst:50
msgid ""
"Notice here how we wanted the :mailheader:`Subject` field to contain a non-"
"ASCII character? We did this by creating a :class:`Header` instance and "
"passing in the character set that the byte string was encoded in. When the "
"subsequent :class:`~email.message.Message` instance was flattened, the "
":mailheader:`Subject` field was properly :rfc:`2047` encoded. MIME-aware "
"mail readers would show this header using the embedded ISO-8859-1 character."
msgstr ""
"是否注意到这里我们是如何希望 :mailheader:`Subject` 字段包含非 ASCII 字符的? 我们通过创建一个 "
":class:`Header` 实例并传入字节串编码所用的字符集来做到这一点。 当后续的 :class:`~email.message.Message`"
" 实例被展平时,:mailheader:`Subject` 字段会正确地按 :rfc:`2047` 来编码。 可感知 MIME "
"的电子邮件阅读器将会使用嵌入的 ISO-8859-1 字符来显示此标头。"
#: ../../library/email.header.rst:57
msgid "Here is the :class:`Header` class description:"
msgstr "以下是 :class:`Header` 类描述:"
#: ../../library/email.header.rst:62
msgid ""
"Create a MIME-compliant header that can contain strings in different "
"character sets."
msgstr "创建符合 MIME 要求的标头,其中可包含不同字符集的字符串。"
#: ../../library/email.header.rst:65
msgid ""
"Optional *s* is the initial header value. If ``None`` (the default), the "
"initial header value is not set. You can later append to the header with "
":meth:`append` method calls. *s* may be an instance of :class:`bytes` or "
":class:`str`, but see the :meth:`append` documentation for semantics."
msgstr ""
"可选的 *s* 是初始标头值。 如果为 ``None`` (默认值),则表示初始标头值未设置。 你可以在稍后使用 :meth:`append` "
"方法调用向标头添加新值。 *s* 可以是 :class:`bytes` 或 :class:`str` 的实例,注意参阅 :meth:`append` "
"文档了解相关语义。"
#: ../../library/email.header.rst:70
msgid ""
"Optional *charset* serves two purposes: it has the same meaning as the "
"*charset* argument to the :meth:`append` method. It also sets the default "
"character set for all subsequent :meth:`append` calls that omit the "
"*charset* argument. If *charset* is not provided in the constructor (the "
"default), the ``us-ascii`` character set is used both as *s*'s initial "
"charset and as the default for subsequent :meth:`append` calls."
msgstr ""
"可选的 *charset* 用于两种目的:它的含义与 :meth:`append` 方法的 *charset* 参数相同。 它还会为所有省略了 "
"*charset* 参数的后续 :meth:`append` 调用设置默认字符集。 如果 *charset* 在构造器中未提供(默认设置),则会将 "
"``us-ascii`` 字符集用作 *s* 的初始字符集以及后续 :meth:`append` 调用的默认字符集。"
#: ../../library/email.header.rst:77
msgid ""
"The maximum line length can be specified explicitly via *maxlinelen*. For "
"splitting the first line to a shorter value (to account for the field header"
" which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name "
"of the field in *header_name*. The default *maxlinelen* is 78, and the "
"default value for *header_name* is ``None``, meaning it is not taken into "
"account for the first line of a long, split header."
msgstr ""
"通过 maximum line length can be specified explicitly via *maxlinelen* "
"可以显式地指定行长度的最大值。 要将第一行拆分为更短的值(以适应未被包括在 *s* 中的字段标头,例如 :mailheader:`Subject` "
"等)则将字段名称作为 *header_name* 传入。 默认的 *maxlinelen* 为 78,而 *header_name* 的默认值为 "
"``None``,表示不考虑拆分超长标头的第一行。"
#: ../../library/email.header.rst:84
msgid ""
"Optional *continuation_ws* must be :rfc:`2822`\\ -compliant folding "
"whitespace, and is usually either a space or a hard tab character. This "
"character will be prepended to continuation lines. *continuation_ws* "
"defaults to a single space character."
msgstr ""
"可选的 *continuation_ws* 必须为符合 :rfc:`2822` 的折叠用空白符,通常是空格符或硬制表符。 "
"这个字符将被加缀至连续行的开头。 *continuation_ws* 默认为一个空格符。"
#: ../../library/email.header.rst:89
msgid ""
"Optional *errors* is passed straight through to the :meth:`append` method."
msgstr "可选的 *errors* 会被直接传递给 :meth:`append` 方法。"
#: ../../library/email.header.rst:94
msgid "Append the string *s* to the MIME header."
msgstr "将字符串 *s* 添加到 MIME 标头。"
#: ../../library/email.header.rst:96
msgid ""
"Optional *charset*, if given, should be a :class:`~email.charset.Charset` "
"instance (see :mod:`email.charset`) or the name of a character set, which "
"will be converted to a :class:`~email.charset.Charset` instance. A value of"
" ``None`` (the default) means that the *charset* given in the constructor is"
" used."
msgstr ""
"如果给出可选的 *charset*,它应当是一个 :class:`~email.charset.Charset` 实例 (参见 "
":mod:`email.charset`) 或字符集名称,该参数将被转换为一个 :class:`~email.charset.Charset` 实例。"
" 如果为 ``None`` (默认值) 则表示会使用构造器中给出的 *charset*。"
#: ../../library/email.header.rst:102
msgid ""
"*s* may be an instance of :class:`bytes` or :class:`str`. If it is an "
"instance of :class:`bytes`, then *charset* is the encoding of that byte "
"string, and a :exc:`UnicodeError` will be raised if the string cannot be "
"decoded with that character set."
msgstr ""
"*s* 可以是 :class:`bytes` 或 :class:`str` 的实例。 如果它是 :class:`bytes` 的实例,则 "
"*charset* 为该字节串的编码格式,如果字节串无法用该字符集来解码则将引发 :exc:`UnicodeError`。"
#: ../../library/email.header.rst:107
msgid ""
"If *s* is an instance of :class:`str`, then *charset* is a hint specifying "
"the character set of the characters in the string."
msgstr "如果 *s* 是 :class:`str` 的实例,则 *charset* 是用来指定字符串中字符字符集的提示。"
#: ../../library/email.header.rst:110
msgid ""
"In either case, when producing an :rfc:`2822`\\ -compliant header using "
":rfc:`2047` rules, the string will be encoded using the output codec of the "
"charset. If the string cannot be encoded using the output codec, a "
"UnicodeError will be raised."
msgstr ""
"在这两种情况下,当使用 :rfc:`2047` 规则产生符合 :rfc:`2822` 的标头时,将使用指定字符集的输出编解码器来编码字符串。 "
"如果字符串无法使用该输出编解码器来编码,则将引发 UnicodeError。"
#: ../../library/email.header.rst:115
msgid ""
"Optional *errors* is passed as the errors argument to the decode call if *s*"
" is a byte string."
msgstr "可选的 *errors* 会在 *s* 为字节串时被作为 errors 参数传递给 decode 调用。"
#: ../../library/email.header.rst:121
msgid ""
"Encode a message header into an RFC-compliant format, possibly wrapping long"
" lines and encapsulating non-ASCII parts in base64 or quoted-printable "
"encodings."
msgstr ""
"将消息标头编码为符合 RFC 的格式,可能会对过长的行采取折行并将非 ASCII 部分以 base64 或 quoted-printable "
"编码格式进行封装。"
#: ../../library/email.header.rst:125
msgid ""
"Optional *splitchars* is a string containing characters which should be "
"given extra weight by the splitting algorithm during normal header wrapping."
" This is in very rough support of :RFC:`2822`\\'s 'higher level syntactic "
"breaks': split points preceded by a splitchar are preferred during line "
"splitting, with the characters preferred in the order in which they appear "
"in the string. Space and tab may be included in the string to indicate "
"whether preference should be given to one over the other as a split point "
"when other split chars do not appear in the line being split. Splitchars "
"does not affect :RFC:`2047` encoded lines."
msgstr ""
"可选的 *splitchars* 是一个字符串,其中包含应在正常的标头折行处理期间由拆分算法赋予额外权重的字符。 这是对于 :RFC:`2822` 中 "
"'更高层级语法拆分' 的很粗略的支持:在拆分期间会首选在 splitchar 之前的拆分点,字符的优先级是基于它们在字符串中的出现顺序。 "
"字符串中可包含空格和制表符以指明当其他拆分字符未在被拆分行中出现时是否要将某个字符作为优先于另一个字符的首选拆分点。 拆分字符不会影响以 "
":RFC:`2047` 编码的行。"
#: ../../library/email.header.rst:135
msgid ""
"*maxlinelen*, if given, overrides the instance's value for the maximum line "
"length."
msgstr "如果给出 *maxlinelen*,它将覆盖实例的最大行长度值。"
#: ../../library/email.header.rst:138
msgid ""
"*linesep* specifies the characters used to separate the lines of the folded "
"header. It defaults to the most useful value for Python application code "
"(``\\n``), but ``\\r\\n`` can be specified in order to produce headers with "
"RFC-compliant line separators."
msgstr ""
"*linesep* 指定用来分隔已折叠标头行的字符。 它默认为 Python 应用程序代码中最常用的值 (``\\n``),但也可以指定为 "
"``\\r\\n`` 以便产生带有符合 RFC 的行分隔符的标头。"
#: ../../library/email.header.rst:143
msgid "Added the *linesep* argument."
msgstr "增加了 *linesep* 参数。"
#: ../../library/email.header.rst:147
msgid ""
"The :class:`Header` class also provides a number of methods to support "
"standard operators and built-in functions."
msgstr ":class:`Header` 类还提供了一些方法以支持标准运算符和内置函数。"
#: ../../library/email.header.rst:152
msgid ""
"Returns an approximation of the :class:`Header` as a string, using an "
"unlimited line length. All pieces are converted to unicode using the "
"specified encoding and joined together appropriately. Any pieces with a "
"charset of ``'unknown-8bit'`` are decoded as ASCII using the ``'replace'`` "
"error handler."
msgstr ""
"以字符串形式返回 :class:`Header` 的近似表示,使用不受限制的行长度。 所有部分都会使用指定编码格式转换为 unicode "
"并适当地连接起来。 任何带有 ``'unknown-8bit'`` 字符集的部分都会使用 ``'replace'`` 错误处理程序解码为 ASCII。"
#: ../../library/email.header.rst:158
msgid "Added handling for the ``'unknown-8bit'`` charset."
msgstr "增加对 ``'unknown-8bit'`` 字符集的处理。"
#: ../../library/email.header.rst:164
msgid ""
"This method allows you to compare two :class:`Header` instances for "
"equality."
msgstr "这个方法允许你对两个 :class:`Header` 实例进行相等比较。"
#: ../../library/email.header.rst:170
msgid ""
"This method allows you to compare two :class:`Header` instances for "
"inequality."
msgstr "这个方法允许你对两个 :class:`Header` 实例进行不等比较。"
#: ../../library/email.header.rst:173
msgid ""
"The :mod:`email.header` module also provides the following convenient "
"functions."
msgstr ":mod:`email.header` 模块还提供了下列便捷函数。"
#: ../../library/email.header.rst:178
msgid ""
"Decode a message header value without converting the character set. The "
"header value is in *header*."
msgstr "在不转换字符集的情况下对消息标头值进行解码。 *header* 为标头值。"
#: ../../library/email.header.rst:181
msgid ""
"This function returns a list of ``(decoded_string, charset)`` pairs "
"containing each of the decoded parts of the header. *charset* is ``None`` "
"for non-encoded parts of the header, otherwise a lower case string "
"containing the name of the character set specified in the encoded string."
msgstr ""
"这个函数返回一个 ``(decoded_string, charset)`` 对的列表,其中包含标头的每个已解码部分。 对于标头的未编码部分 "
"*charset* 为 ``None``,在其他情况下则为一个包含已编码字符串中所指定字符集名称的小写字符串。"
#: ../../library/email.header.rst:186
msgid "Here's an example::"
msgstr "以下是为示例代码::"
#: ../../library/email.header.rst:188
msgid ""
">>> from email.header import decode_header\n"
">>> decode_header('=?iso-8859-1?q?p=F6stal?=')\n"
"[(b'p\\xf6stal', 'iso-8859-1')]"
msgstr ""
">>> from email.header import decode_header\n"
">>> decode_header('=?iso-8859-1?q?p=F6stal?=')\n"
"[(b'p\\xf6stal', 'iso-8859-1')]"
#: ../../library/email.header.rst:195
msgid ""
"Create a :class:`Header` instance from a sequence of pairs as returned by "
":func:`decode_header`."
msgstr "基于 :func:`decode_header` 所返回的数据对序列创建一个 :class:`Header` 实例。"
#: ../../library/email.header.rst:198
msgid ""
":func:`decode_header` takes a header value string and returns a sequence of "
"pairs of the format ``(decoded_string, charset)`` where *charset* is the "
"name of the character set."
msgstr ""
":func:`decode_header` 接受一个标头值字符串并返回格式为 ``(decoded_string, charset)`` "
"的数据对序列,其中 *charset* 是字符集名称。"
#: ../../library/email.header.rst:202
msgid ""
"This function takes one of those sequence of pairs and returns a "
":class:`Header` instance. Optional *maxlinelen*, *header_name*, and "
"*continuation_ws* are as in the :class:`Header` constructor."
msgstr ""
"这个函数接受这样的数据对序列并返回一个 :class:`Header` 实例。 可选的 *maxlinelen*, *header_name* 和 "
"*continuation_ws* 与 :class:`Header` 构造器中的含义相同。"