-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathemail.utils.po
313 lines (283 loc) · 17.3 KB
/
email.utils.po
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
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# eric R <trencyclopedia@gmail.com>, 2019
# Larry Wang <larry.wang.801@gmail.com>, 2019
# Sean Chao <seanchao0804@gmail.com>, 2020
# Siyuan Xu, 2020
# Freesand Leo <yuqinju@163.com>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
"PO-Revision-Date: 2019-09-01 03:18+0000\n"
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
"Language-Team: Chinese (China) (https://www.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.utils.rst:2
msgid ":mod:`email.utils`: Miscellaneous utilities"
msgstr ":mod:`email.utils`: 其他工具"
#: ../../library/email.utils.rst:7
msgid "**Source code:** :source:`Lib/email/utils.py`"
msgstr "**源代码:** :source:`Lib/email/utils.py`"
#: ../../library/email.utils.rst:11
msgid ""
"There are a couple of useful utilities provided in the :mod:`email.utils` "
"module:"
msgstr ":mod:`email.utils` 模块提供如下几个工具"
#: ../../library/email.utils.rst:16
msgid ""
"Return local time as an aware datetime object. If called without arguments,"
" return current time. Otherwise *dt* argument should be a "
":class:`~datetime.datetime` instance, and it is converted to the local time "
"zone according to the system time zone database. If *dt* is naive (that is,"
" ``dt.tzinfo`` is ``None``), it is assumed to be in local time. In this "
"case, a positive or zero value for *isdst* causes ``localtime`` to presume "
"initially that summer time (for example, Daylight Saving Time) is or is not "
"(respectively) in effect for the specified time. A negative value for "
"*isdst* causes the ``localtime`` to attempt to divine whether summer time is"
" in effect for the specified time."
msgstr ""
"以感知型 datetime 对象返回当地时间。 如果调用时参数为空,则返回当前时间。 否则 *dt* 参数应该是一个 "
":class:`~datetime.datetime` 实例,并根据系统时区数据库转换为当地时区。 如果 *dt* 是简单型的 (即 "
"``dt.tzinfo`` 是 ``None`` ),则假定为当地时间。 在这种情况下,为正值或零的 *isdst* 会使 ``localtime`` "
"假定夏季时间(例如,夏令时)对指定时间生效或不生效。 负值 *isdst* 会使 ``localtime`` 预测夏季时间对指定时间是否生效。"
#: ../../library/email.utils.rst:32
msgid ""
"Returns a string suitable for an :rfc:`2822`\\ -compliant "
":mailheader:`Message-ID` header. Optional *idstring* if given, is a string "
"used to strengthen the uniqueness of the message id. Optional *domain* if "
"given provides the portion of the msgid after the '@'. The default is the "
"local hostname. It is not normally necessary to override this default, but "
"may be useful certain cases, such as a constructing distributed system that "
"uses a consistent domain name across multiple hosts."
msgstr ""
"返回一个适合作为兼容 :rfc:`2822` 的 :mailheader:`Message-ID` 标头的字符串。可选参数 *idstring* "
"可传入一字符串以增强该消息 ID 的唯一性。可选参数 *domain* 可用于提供消息 ID 中字符 '@' "
"之后的部分,其默认值是本机的主机名。正常情况下无需覆盖此默认值,但在特定情况下覆盖默认值可能会有用,比如构建一个分布式系统,在多台主机上采用一致的域名。"
#: ../../library/email.utils.rst:40
msgid "Added the *domain* keyword."
msgstr "增加了关键字 *domain* "
#: ../../library/email.utils.rst:44
msgid ""
"The remaining functions are part of the legacy (``Compat32``) email API. "
"There is no need to directly use these with the new API, since the parsing "
"and formatting they provide is done automatically by the header parsing "
"machinery of the new API."
msgstr ""
"下列函数是旧(``Compat32``)电子邮件 API 的一部分。新 API 提供的解析和格式化在标头解析机制中已经被自动完成,故在使用新 API "
"时没有必要直接使用它们函数。"
#: ../../library/email.utils.rst:52
msgid ""
"Return a new string with backslashes in *str* replaced by two backslashes, "
"and double quotes replaced by backslash-double quote."
msgstr "返回一个新的字符串, *str* 中的反斜杠被替换为两个反斜杠,并且双引号被替换为反斜杠加双引号。"
#: ../../library/email.utils.rst:58
msgid ""
"Return a new string which is an *unquoted* version of *str*. If *str* ends "
"and begins with double quotes, they are stripped off. Likewise if *str* "
"ends and begins with angle brackets, they are stripped off."
msgstr ""
"返回 *str* 被去除引用后的字符串。如果 *str* 开头和结尾均是双引号,则这对双引号被去除。类似地,如果 *str* "
"开头和结尾都是尖角括号,这对尖角括号会被去除。"
#: ../../library/email.utils.rst:65
msgid ""
"Parse address -- which should be the value of some address-containing field "
"such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent "
"*realname* and *email address* parts. Returns a tuple of that information, "
"unless the parse fails, in which case a 2-tuple of ``('', '')`` is returned."
msgstr ""
"将地址(应为诸如 :mailheader:`To` 或者 :mailheader:`Cc` 之类包含地址的字段值)解析为构成之的 *真实名字* 和 "
"*电子邮件地址* 部分。返回包含这两个信息的一个元组;如若解析失败,则返回一个二元组 ``('', '')`` 。"
#: ../../library/email.utils.rst:73
msgid ""
"The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form "
"``(realname, email_address)`` and returns the string value suitable for a "
":mailheader:`To` or :mailheader:`Cc` header. If the first element of *pair*"
" is false, then the second element is returned unmodified."
msgstr ""
"是 :meth:`parseaddr` 的逆操作,接受一个 ``(真实名字, 电子邮件地址)`` 的二元组,并返回适合于 "
":mailheader:`To` or :mailheader:`Cc` 标头的字符串。如果第一个元素为假性值,则第二个元素将被原样返回。"
#: ../../library/email.utils.rst:78
msgid ""
"Optional *charset* is the character set that will be used in the :rfc:`2047`"
" encoding of the ``realname`` if the ``realname`` contains non-ASCII "
"characters. Can be an instance of :class:`str` or a "
":class:`~email.charset.Charset`. Defaults to ``utf-8``."
msgstr ""
"可选地,如果指定 *charset*,则被视为一符合 :rfc:`2047` 的编码字符集,用于编码 ``真实名字`` 中的非 ASCII "
"字符。可以是一个 :class:`str` 类的实例,或者一个 :class:`~email.charset.Charset` 类。默认为 "
"``utf-8`` 。"
#: ../../library/email.utils.rst:83
msgid "Added the *charset* option."
msgstr "添加了 *charset* 选项。"
#: ../../library/email.utils.rst:89
msgid ""
"This method returns a list of 2-tuples of the form returned by "
"``parseaddr()``. *fieldvalues* is a sequence of header field values as might"
" be returned by :meth:`Message.get_all <email.message.Message.get_all>`. "
"Here's a simple example that gets all the recipients of a message::"
msgstr ""
"该方法返回一个形似 ``parseaddr()`` 返回的二元组的列表。 *fieldvalues* 是一个序列,包含了形似 "
":meth:`Message.get_all <email.message.Message.get_all>` "
"返回值的标头字段值。获取了一消息的所有收件人的简单示例如下:"
#: ../../library/email.utils.rst:105
msgid ""
"Attempts to parse a date according to the rules in :rfc:`2822`. however, "
"some mailers don't follow that format as specified, so :func:`parsedate` "
"tries to guess correctly in such cases. *date* is a string containing an "
":rfc:`2822` date, such as ``\"Mon, 20 Nov 1995 19:12:08 -0500\"``. If it "
"succeeds in parsing the date, :func:`parsedate` returns a 9-tuple that can "
"be passed directly to :func:`time.mktime`; otherwise ``None`` will be "
"returned. Note that indexes 6, 7, and 8 of the result tuple are not usable."
msgstr ""
"尝试根据 :rfc:`2822` 的规则解析一个日期。然而,有些寄信人不严格遵守这一格式,所以这种情况下 :func:`parsedate` "
"会尝试猜测其形式。*date* 是一个字符串包含了一个形如 ``\"Mon, 20 Nov 1995 19:12:08 -0500\"`` 的 "
":rfc:`2822` 格式日期。如果日期解析成功, :func:`parsedate` 将返回一个九元组,可直接传递给 "
":func:`time.mktime`;否则返回 ``None``。注意返回的元组中下标为 6、7、8 的部分是无用的。"
#: ../../library/email.utils.rst:116
msgid ""
"Performs the same function as :func:`parsedate`, but returns either ``None``"
" or a 10-tuple; the first 9 elements make up a tuple that can be passed "
"directly to :func:`time.mktime`, and the tenth is the offset of the date's "
"timezone from UTC (which is the official term for Greenwich Mean Time) [#]_."
" If the input string has no timezone, the last element of the tuple "
"returned is ``0``, which represents UTC. Note that indexes 6, 7, and 8 of "
"the result tuple are not usable."
msgstr ""
"执行与 :func:`parsedate` 相同的功能,但会返回 ``None`` 或是一个 10 元组;前 9 个元素构成一个可以直接传给 "
":func:`time.mktime` 的元组,而第十个元素则是该日期的时区与 UTC (格林威治平均时 GMT 的正式名称) [#]_ 的时差。 "
"如果输入字符串不带时区,则所返回元组的最后一个元素将为 ``0``,这表示 UTC。 请注意结果元组的索引号 6, 7 和 8 是不可用的。"
#: ../../library/email.utils.rst:126
msgid ""
"The inverse of :func:`format_datetime`. Performs the same function as "
":func:`parsedate`, but on success returns a :mod:`~datetime.datetime`. If "
"the input date has a timezone of ``-0000``, the ``datetime`` will be a naive"
" ``datetime``, and if the date is conforming to the RFCs it will represent a"
" time in UTC but with no indication of the actual source timezone of the "
"message the date comes from. If the input date has any other valid timezone"
" offset, the ``datetime`` will be an aware ``datetime`` with the "
"corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`."
msgstr ""
":func:`format_datetime` 的逆操作。 执行与 :func:`parsedate` 相同的功能,但会在成功时返回一个 "
":mod:`~datetime.datetime`。 如果输入日期的时区值为 ``-0000``,则 ``datetime`` 将为一个简单型 "
"``datetime``,而如果日期符合 RFC 标准则它将代表一个 UTC 时间,但是并不指明日期所在消息的实际源时区。 "
"如果输入日期具有任何其他有效的时区差值,则 ``datetime`` 将为一个感知型 ``datetime`` 并与 "
":class:`~datetime.timezone` :class:`~datetime.tzinfo` 相对应。"
#: ../../library/email.utils.rst:140
msgid ""
"Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp "
"(seconds since the Epoch). If the timezone item in the tuple is ``None``, "
"assume local time."
msgstr ""
"将 :func:`parsedate_tz` 所返回的 10 元组转换为一个 UTC 时间戳(相距 Epoch 纪元初始的秒数)。 如果元组中的时区项为"
" ``None``,则视为当地时间。"
#: ../../library/email.utils.rst:147
msgid "Returns a date string as per :rfc:`2822`, e.g.::"
msgstr "返回 :rfc:`2822` 标准的日期字符串,例如::"
#: ../../library/email.utils.rst:151
msgid ""
"Optional *timeval* if given is a floating point time value as accepted by "
":func:`time.gmtime` and :func:`time.localtime`, otherwise the current time "
"is used."
msgstr ""
"可选的 *timeval* 如果给出,则是一个可被 :func:`time.gmtime` 和 :func:`time.localtime` "
"接受的浮点数时间值,否则会使得当前时间。"
#: ../../library/email.utils.rst:155
msgid ""
"Optional *localtime* is a flag that when ``True``, interprets *timeval*, and"
" returns a date relative to the local timezone instead of UTC, properly "
"taking daylight savings time into account. The default is ``False`` meaning "
"UTC is used."
msgstr ""
"可选的 *localtime* 是一个旗标,当为 ``True`` 时,将会解析 *timeval*,并返回一个相对于当地时区而非 UTC "
"的日期值,并会适当地考虑夏令时。 默认值 ``False`` 表示使用 UTC。"
#: ../../library/email.utils.rst:160
msgid ""
"Optional *usegmt* is a flag that when ``True``, outputs a date string with "
"the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. "
"This is needed for some protocols (such as HTTP). This only applies when "
"*localtime* is ``False``. The default is ``False``."
msgstr ""
"可选的 *usegmt* 是一个旗标,当为 ``True`` 时,将会输出一个日期字符串,其中时区表示为 ascii 字符串 ``GMT`` "
"而非数字形式的 ``-0000``。 这对某些协议(例如 HTTP)来说是必要的。 这仅在 *localtime* 为 ``False`` 时应用。 "
"默认值为 ``False``。"
#: ../../library/email.utils.rst:168
msgid ""
"Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is "
"a naive datetime, it is assumed to be \"UTC with no information about the "
"source timezone\", and the conventional ``-0000`` is used for the timezone. "
"If it is an aware ``datetime``, then the numeric timezone offset is used. If"
" it is an aware timezone with offset zero, then *usegmt* may be set to "
"``True``, in which case the string ``GMT`` is used instead of the numeric "
"timezone offset. This provides a way to generate standards conformant HTTP "
"date headers."
msgstr ""
"类似于 ``formatdate``,但输入的是一个 :mod:`datetime` 实例。 如果实例是一个简单型 datetime,它会被视为 "
"\"不带源时区信息的 UTC\",并且使用传统的 ``-0000`` 作为时区。 如果实例是一个感知型 "
"``datetime``,则会使用数字形式的时区时差。 如果实例是感知型且时区时差为零,则 *usegmt* 可能会被设为 "
"``True``,在这种情况下将使用字符串 ``GMT`` 而非数字形式的时区时差。 这提供了一种生成符合标准 HTTP 日期标头的方式。"
#: ../../library/email.utils.rst:182
msgid "Decode the string *s* according to :rfc:`2231`."
msgstr "根据 :rfc:`2231` 解码字符串 *s*。"
#: ../../library/email.utils.rst:187
msgid ""
"Encode the string *s* according to :rfc:`2231`. Optional *charset* and "
"*language*, if given is the character set name and language name to use. If"
" neither is given, *s* is returned as-is. If *charset* is given but "
"*language* is not, the string is encoded using the empty string for "
"*language*."
msgstr ""
"根据 :rfc:`2231` 对字符串 *s* 进行编码。 可选的 *charset* 和 *language* "
"如果给出,则为指明要使用的字符集名称和语言名称。 如果两者均未给出,则会原样返回 *s*。 如果给出 *charset* 但未给出 "
"*language*,则会使用空字符串作为 *language* 值来对字符串进行编码。"
#: ../../library/email.utils.rst:195
msgid ""
"When a header parameter is encoded in :rfc:`2231` format, "
":meth:`Message.get_param <email.message.Message.get_param>` may return a "
"3-tuple containing the character set, language, and value. "
":func:`collapse_rfc2231_value` turns this into a unicode string. Optional "
"*errors* is passed to the *errors* argument of :class:`str`'s "
":func:`~str.encode` method; it defaults to ``'replace'``. Optional "
"*fallback_charset* specifies the character set to use if the one in the "
":rfc:`2231` header is not known by Python; it defaults to ``'us-ascii'``."
msgstr ""
"当以 :rfc:`2231` 格式来编码标头形参时,:meth:`Message.get_param "
"<email.message.Message.get_param>` 可能返回一个包含字符集、语言和值的 3 元组。 "
":func:`collapse_rfc2231_value` 会将此返回为一个 unicode 字符串。 可选的 *errors* 会被传递给 "
":class:`str` 的 :func:`~str.encode` 方法的 *errors* 参数;它的默认值为 ``'replace'``。 可选的"
" *fallback_charset* 指定当 :rfc:`2231` 标头中的字符集无法被 Python 识别时要使用的字符集;它的默认值为 "
"``'us-ascii'``。"
#: ../../library/email.utils.rst:204
msgid ""
"For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is "
"not a tuple, it should be a string and it is returned unquoted."
msgstr ""
"为方便起见,如果传给 :func:`collapse_rfc2231_value` 的 *value* 不是一个元组,则应为一个字符串并会将其原样返回。"
#: ../../library/email.utils.rst:210
msgid ""
"Decode parameters list according to :rfc:`2231`. *params* is a sequence of "
"2-tuples containing elements of the form ``(content-type, string-value)``."
msgstr ""
"根据 :rfc:`2231` 解码参数列表。 *params* 是一个包含 ``(content-type, string-value)`` "
"形式的元素的 2 元组的序列。"
#: ../../library/email.utils.rst:215
msgid "Footnotes"
msgstr "备注"
#: ../../library/email.utils.rst:216
msgid ""
"Note that the sign of the timezone offset is the opposite of the sign of the"
" ``time.timezone`` variable for the same timezone; the latter variable "
"follows the POSIX standard while this module follows :rfc:`2822`."
msgstr ""
"请注意时区时差的符号与同一时区的 ``time.timezone`` 变量的符号相反;后者遵循 POSIX 标准而此模块遵循 :rfc:`2822`。"