Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95a964d

Browse files
[po] auto sync
1 parent 170761d commit 95a964d

4 files changed

Lines changed: 481 additions & 455 deletions

File tree

howto/descriptor.po

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
# Yinuo Huang <[email protected]>, 2018
99
# Fei Yin <[email protected]>, 2018
1010
# Junkai Shao <[email protected]>, 2018
11-
# Freesand Leo <[email protected]>, 2018
1211
# banxi <[email protected]>, 2019
1312
# Siyuan Xu <[email protected]>, 2019
1413
# ppcfish <[email protected]>, 2019
14+
# WH-2099 <[email protected]>, 2020
15+
# Freesand Leo <[email protected]>, 2020
1516
#
1617
#, fuzzy
1718
msgid ""
@@ -20,7 +21,7 @@ msgstr ""
2021
"Report-Msgid-Bugs-To: \n"
2122
"POT-Creation-Date: 2020-02-09 12:40+0000\n"
2223
"PO-Revision-Date: 2017-02-16 17:44+0000\n"
23-
"Last-Translator: ppcfish <ppcfish@gmail.com>, 2019\n"
24+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
2425
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2526
"MIME-Version: 1.0\n"
2627
"Content-Type: text/plain; charset=UTF-8\n"
@@ -30,7 +31,7 @@ msgstr ""
3031

3132
#: ../../howto/descriptor.rst:3
3233
msgid "Descriptor HowTo Guide"
33-
msgstr "实现描述器"
34+
msgstr "描述器使用指南"
3435

3536
#: ../../howto/descriptor.rst:0
3637
msgid "Author"
@@ -64,6 +65,8 @@ msgid ""
6465
"methods. Shows how each works by giving a pure Python equivalent and a "
6566
"sample application."
6667
msgstr ""
68+
"定义描述器,总结描述器协议,展示描述器被如何使用。测试一个自定义的描述器和若干 Python "
69+
"内置的描述器,包括函数、属性、静态方法和类方法。通过给出一个纯 Python 的等价实现和例程,展示每个描述器如何工作。"
6770

6871
#: ../../howto/descriptor.rst:18
6972
msgid ""
@@ -113,6 +116,8 @@ msgid ""
113116
"underlying C-code and offer a flexible set of new tools for everyday Python "
114117
"programs."
115118
msgstr ""
119+
"描述器是一个强大而通用的协议。 它们是特征属性、方法静态方法、类方法和 :func:`super()` 背后的实现机制。 它们在 Python "
120+
"内部被广泛使用来实现自 2.2 版中引入的新式类。 描述器简化了底层的 C 代码并为 Python 的日常程序提供了一组灵活的新工具。"
116121

117122
#: ../../howto/descriptor.rst:49
118123
msgid "Descriptor Protocol"
@@ -135,7 +140,7 @@ msgid ""
135140
"That is all there is to it. Define any of these methods and an object is "
136141
"considered a descriptor and can override default behavior upon being looked "
137142
"up as an attribute."
138-
msgstr ""
143+
msgstr "以上就是全部。定义这些方法中的任何一个的对象被视为描述器,并在被作为属性时覆盖其默认行为。"
139144

140145
#: ../../howto/descriptor.rst:61
141146
msgid ""
@@ -144,6 +149,8 @@ msgid ""
144149
" non-data descriptors (they are typically used for methods but other uses "
145150
"are possible)."
146151
msgstr ""
152+
"如果一个对象定义了 :meth:`__set__` 或 :meth:`__delete__`,则它会被视为数据描述器。 仅定义了 "
153+
":meth:`__get__` 的描述器称为非数据描述器(它们通常被用于方法,但也可以有其他用途)。"
147154

148155
#: ../../howto/descriptor.rst:66
149156
msgid ""
@@ -153,6 +160,7 @@ msgid ""
153160
"takes precedence. If an instance's dictionary has an entry with the same "
154161
"name as a non-data descriptor, the dictionary entry takes precedence."
155162
msgstr ""
163+
"数据和非数据描述器的不同之处在于,如何计算实例字典中条目的替代值。如果实例的字典具有与数据描述器同名的条目,则数据描述器优先。如果实例的字典具有与非数据描述器同名的条目,则该字典条目优先。"
156164

157165
#: ../../howto/descriptor.rst:72
158166
msgid ""
@@ -161,16 +169,18 @@ msgid ""
161169
"when called. Defining the :meth:`__set__` method with an exception raising "
162170
"placeholder is enough to make it a data descriptor."
163171
msgstr ""
172+
"为了使只读数据描述符,同时定义 :meth:`__get__` 和 :meth:`__set__` ,并在 :meth:`__set__` 中引发 "
173+
":exc:`AttributeError` 。用引发异常的占位符定义 :meth:`__set__` 方法能够使其成为数据描述符。"
164174

165175
#: ../../howto/descriptor.rst:79
166176
msgid "Invoking Descriptors"
167-
msgstr "发起调用描述符"
177+
msgstr "发起调用描述器"
168178

169179
#: ../../howto/descriptor.rst:81
170180
msgid ""
171181
"A descriptor can be called directly by its method name. For example, "
172182
"``d.__get__(obj)``."
173-
msgstr ""
183+
msgstr "描述器可以通过其方法名称直接调用。例如, ``d.__get__(obj)`` 。"
174184

175185
#: ../../howto/descriptor.rst:84
176186
msgid ""
@@ -180,11 +190,13 @@ msgid ""
180190
"then ``d.__get__(obj)`` is invoked according to the precedence rules listed "
181191
"below."
182192
msgstr ""
193+
"或者,更常见的是在属性访问时自动调用描述符。例如,在中 ``obj.d`` 会在 ``d`` 的字典中查找 ``obj`` 。如果 ``d`` "
194+
"定义了方法 :meth:`__get__` ,则 ``d.__get__(obj)`` 根据下面列出的优先级规则进行调用。"
183195

184196
#: ../../howto/descriptor.rst:89
185197
msgid ""
186198
"The details of invocation depend on whether ``obj`` is an object or a class."
187-
msgstr ""
199+
msgstr "调用的细节取决于 ``obj`` 是对象还是类。"
188200

189201
#: ../../howto/descriptor.rst:91
190202
msgid ""
@@ -196,40 +208,49 @@ msgid ""
196208
" The full C implementation can be found in "
197209
":c:func:`PyObject_GenericGetAttr()` in :source:`Objects/object.c`."
198210
msgstr ""
211+
"对于对象来说,机制是 :meth:`object.__getattribute__` 中将 ``b.x`` 转换为 "
212+
"``type(b).__dict__['x'].__get__(b, type(b))`` 。 "
213+
"这个实现通过一个优先级链完成,该优先级链赋予数据描述器优先于实例变量的优先级,实例变量优先于非数据描述器的优先级,并如果 "
214+
":meth:`__getattr__` 方法存在,为其分配最低的优先级。 完整的C实现可在 :source:`Objects/object.c` 中的 "
215+
":c:func:`PyObject_GenericGetAttr()` 找到。"
199216

200217
#: ../../howto/descriptor.rst:99
201218
msgid ""
202219
"For classes, the machinery is in :meth:`type.__getattribute__` which "
203220
"transforms ``B.x`` into ``B.__dict__['x'].__get__(None, B)``. In pure "
204221
"Python, it looks like::"
205222
msgstr ""
223+
"对于类来说,机制是 :meth:`type.__getattribute__` 中将 ``B.x`` 转换为 "
224+
"``B.__dict__['x'].__get__(None, B)`` 。在纯Python中,它就像::"
206225

207226
#: ../../howto/descriptor.rst:110
208227
msgid "The important points to remember are:"
209-
msgstr ""
228+
msgstr "要记住的重要点是:"
210229

211230
#: ../../howto/descriptor.rst:112
212231
msgid "descriptors are invoked by the :meth:`__getattribute__` method"
213-
msgstr ""
232+
msgstr "描述器由 :meth:`__getattribute__` 方法调用"
214233

215234
#: ../../howto/descriptor.rst:113
216235
msgid ""
217236
"overriding :meth:`__getattribute__` prevents automatic descriptor calls"
218-
msgstr ""
237+
msgstr "重写 :meth:`__getattribute__` 会阻止描述器的自动调用"
219238

220239
#: ../../howto/descriptor.rst:114
221240
msgid ""
222241
":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make "
223242
"different calls to :meth:`__get__`."
224243
msgstr ""
244+
":meth:`object.__getattribute__` 和 :meth:`type.__getattribute__` 会用不同的方式调用 "
245+
":meth:`__get__`."
225246

226247
#: ../../howto/descriptor.rst:116
227248
msgid "data descriptors always override instance dictionaries."
228-
msgstr ""
249+
msgstr "数据描述器始终会覆盖实例字典。"
229250

230251
#: ../../howto/descriptor.rst:117
231252
msgid "non-data descriptors may be overridden by instance dictionaries."
232-
msgstr ""
253+
msgstr "非数据描述器会被实例字典覆盖。"
233254

234255
#: ../../howto/descriptor.rst:119
235256
msgid ""
@@ -354,7 +375,7 @@ msgstr ""
354375

355376
#: ../../howto/descriptor.rst:326
356377
msgid "Static Methods and Class Methods"
357-
msgstr ""
378+
msgstr "静态方法和类方法"
358379

359380
#: ../../howto/descriptor.rst:328
360381
msgid ""
@@ -446,13 +467,13 @@ msgstr ""
446467
msgid ""
447468
"Since staticmethods return the underlying function with no changes, the "
448469
"example calls are unexciting::"
449-
msgstr ""
470+
msgstr "由于静态方法直接返回了底层的函数,因此示例调用是平淡的:"
450471

451472
#: ../../howto/descriptor.rst:380
452473
msgid ""
453474
"Using the non-data descriptor protocol, a pure Python version of "
454475
":func:`staticmethod` would look like this::"
455-
msgstr ""
476+
msgstr "使用非数据描述器,纯Python的版本 :func:`staticmethod` 如下所示:"
456477

457478
#: ../../howto/descriptor.rst:392
458479
msgid ""

library/plistlib.po

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,33 @@ msgid ""
4444
"supporting basic object types, like dictionaries, lists, numbers and "
4545
"strings. Usually the top level object is a dictionary."
4646
msgstr ""
47+
"property list (``.plist``) 文件格式是一种简单的序列化格式,它支持一些基本对象类型,例如字典、列表、数字和字符串等。 "
48+
"通常使用一个字典作为最高层级对象。"
4749

4850
#: ../../library/plistlib.rst:26
4951
msgid ""
5052
"To write out and to parse a plist file, use the :func:`dump` and "
5153
":func:`load` functions."
52-
msgstr ""
54+
msgstr "要写入和解析 plist 文件,请使用 :func:`dump` 和 :func:`load` 函数。"
5355

5456
#: ../../library/plistlib.rst:29
5557
msgid ""
5658
"To work with plist data in bytes objects, use :func:`dumps` and "
5759
":func:`loads`."
58-
msgstr ""
60+
msgstr "要以字节串对象形式操作 plist 数据,请使用 :func:`dumps` 和 :func:`loads`。"
5961

6062
#: ../../library/plistlib.rst:32
6163
msgid ""
6264
"Values can be strings, integers, floats, booleans, tuples, lists, "
6365
"dictionaries (but only with string keys), :class:`Data`, :class:`bytes`, "
6466
":class:`bytesarray` or :class:`datetime.datetime` objects."
6567
msgstr ""
68+
"值可以为字符串、整数、浮点数、布尔值、元组、列表、字典(但只允许用字符串作为键)、:class:`Data`、:class:`bytes`、:class:`bytesarray`"
69+
" 或 :class:`datetime.datetime` 对象。"
6670

6771
#: ../../library/plistlib.rst:36
6872
msgid "New API, old API deprecated. Support for binary format plists added."
69-
msgstr ""
73+
msgstr "新版 API,旧版 API 已被弃用。 添加了对二进制 plist 格式的支持。"
7074

7175
#: ../../library/plistlib.rst:39
7276
msgid ""

reference/lexical_analysis.po

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: Python 3.8\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2020-02-14 12:42+0000\n"
16+
"POT-Creation-Date: 2020-03-28 13:17+0000\n"
1717
"PO-Revision-Date: 2017-02-16 23:39+0000\n"
1818
"Last-Translator: Freesand Leo <[email protected]>, 2020\n"
1919
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -505,15 +505,16 @@ msgstr "``__*__``"
505505

506506
#: ../../reference/lexical_analysis.rst:379
507507
msgid ""
508-
"System-defined names. These names are defined by the interpreter and its "
509-
"implementation (including the standard library). Current system names are "
510-
"discussed in the :ref:`specialnames` section and elsewhere. More will "
511-
"likely be defined in future versions of Python. *Any* use of ``__*__`` "
512-
"names, in any context, that does not follow explicitly documented use, is "
513-
"subject to breakage without warning."
508+
"System-defined names, informally known as \"dunder\" names. These names are "
509+
"defined by the interpreter and its implementation (including the standard "
510+
"library). Current system names are discussed in the :ref:`specialnames` "
511+
"section and elsewhere. More will likely be defined in future versions of "
512+
"Python. *Any* use of ``__*__`` names, in any context, that does not follow "
513+
"explicitly documented use, is subject to breakage without warning."
514514
msgstr ""
515-
"系统定义的名称。这些名称由解释器及其实现 (包括标准库) 所定义。现有系统定义名称相关讨论参见 :ref:`specialnames` 等章节。未来的 "
516-
"Python 版本中还将定义更多此类名称。*任何* 不遵循文档指定方式使用 ``__*__`` 名称的行为都可能导致无警告的出错。"
515+
"系统定义的名称,在非正式场合下被叫做 \"dunder\" 名称。 这些名称是由解释器及其实现(包括标准库)定义的。 现有系统定义名称相关的讨论请参见 "
516+
":ref:`specialnames` 等章节。 未来的 Python 版本中还将定义更多此类名称。 任何情况下 *任何* 不遵循文档所显式指明的 "
517+
"``__*__`` 名称使用方式都可能导致无警告的错误。"
517518

518519
#: ../../reference/lexical_analysis.rst:391
519520
msgid "``__*``"

0 commit comments

Comments
 (0)