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

Skip to content

Commit 2014c52

Browse files
[po] auto sync
1 parent a9849d6 commit 2014c52

11 files changed

Lines changed: 182 additions & 71 deletions

File tree

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "92.83%", "updated_at": "2024-03-29T17:42:17Z"}
1+
{"translation": "92.94%", "updated_at": "2024-03-30T03:42:26Z"}

glossary.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ msgid ""
1212
msgstr ""
1313
"Project-Id-Version: Python 3.11\n"
1414
"Report-Msgid-Bugs-To: \n"
15-
"POT-Creation-Date: 2024-03-22 16:49+0000\n"
15+
"POT-Creation-Date: 2024-03-29 16:43+0000\n"
1616
"PO-Revision-Date: 2023-05-24 02:11+0000\n"
1717
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1818
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -1515,7 +1515,7 @@ msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作为语言
15151515

15161516
#: ../../glossary.rst:756
15171517
msgid ":func:`locale.getencoding` can be used to get the locale encoding."
1518-
msgstr ""
1518+
msgstr ":func:`locale.getencoding` 可被用来获取语言区域编码格式。"
15191519

15201520
#: ../../glossary.rst:758
15211521
msgid "See also the :term:`filesystem encoding and error handler`."

howto/annotations.po

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.11\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-03-22 16:49+0000\n"
14+
"POT-Creation-Date: 2024-03-29 16:43+0000\n"
1515
"PO-Revision-Date: 2023-05-24 02:11+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -43,7 +43,7 @@ msgid ""
4343
" annotations dicts. If you write Python code that examines "
4444
"``__annotations__`` on Python objects, we encourage you to follow the "
4545
"guidelines described below."
46-
msgstr "本文档旨在概括与注解字典打交道的最佳实践。查看 Python 对象的 ``__annotations__`` 的代码应遵循下述准则。"
46+
msgstr "本文档旨在概括与注解字典打交道的最佳实践。查看 Python 对象的 ``__annotations__`` 的代码应遵循下面的准则。"
4747

4848
#: ../../howto/annotations.rst:16
4949
msgid ""
@@ -64,8 +64,7 @@ msgid ""
6464
"information on how to use \"type hints\" in your code, please see the "
6565
":mod:`typing` module."
6666
msgstr ""
67-
"本文是 ``__annotations__`` 的文档,不是介绍注解用法的文档。如果要查找关于如何使用“类型提示”的信息,请参阅 "
68-
":mod:`typing` 模块。"
67+
"本文是 ``__annotations__`` 的文档,不是注解的用法。如果在寻找如何使用“类型提示”,请参阅 :mod:`typing` 模块。"
6968

7069
#: ../../howto/annotations.rst:33
7170
msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer"
@@ -108,7 +107,7 @@ msgid ""
108107
msgstr ""
109108
"不过,其它类型的可调用对象可不一定定义了 ``__annotations__`` 属性,就比如说,:func:`functools.partial` "
110109
"创建的可调用对象。当访问某个未知对象的 ``__annotations__`` 时,3.10 及更高版本的 Python 中的最佳实践是用三个参数去调用"
111-
" :func:`getattr`,类似 ``getattr(o, '__annotations__', None)`` 这样。"
110+
" :func:`getattr`, ``getattr(o, '__annotations__', None)`` 这样。"
112111

113112
#: ../../howto/annotations.rst:60
114113
msgid ""
@@ -117,8 +116,8 @@ msgid ""
117116
"parent's ``__annotations__``. In Python 3.10 and newer, the child class's "
118117
"annotations will be an empty dict instead."
119118
msgstr ""
120-
"Python 3.10 之前,在一个没定义注解而父类定义了注解的类上访问 ``__annotations__`` 将返回父类的 "
121-
"``__annotations__``。在 3.10 及更高版本的 Python 中,这样的子类的标注是一个空字典。"
119+
"Python 3.10 之前,在一个没定义注解而其父类定义了注解的类上访问 ``__annotations__`` 将返回父类的 "
120+
"``__annotations__``。在 3.10 及更高版本的 Python 中,这样的子类的注解是个空字典。"
122121

123122
#: ../../howto/annotations.rst:68
124123
msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older"
@@ -151,12 +150,13 @@ msgid ""
151150
"``__annotations__`` attribute of a class may inadvertently return the "
152151
"annotations dict of a *base class.* As an example::"
153152
msgstr ""
154-
"不幸的是,对于类而言,这并不是最佳做法。因为 ```__annotations__`` 是类的可选属性,并且类可以从基类继承属性,访问某个类的 "
155-
"``__annotations__`` 属性可能会无意间返回 *基类* 的注解数据。例如:"
153+
"不幸的是,对类而言,这并不是最佳实践。问题在于,由于 ``__annotations__`` "
154+
"在某个类上是可有可无的,而类又可以从基类继承属性,所以访问某个类的 ``__annotations__`` 属性可能会无意间返回 *基类* "
155+
"的注解字典。如:"
156156

157157
#: ../../howto/annotations.rst:98
158158
msgid "This will print the annotations dict from ``Base``, not ``Derived``."
159-
msgstr "如此会打印出 ``Base`` 的注解字典,而非 ``Derived`` 的。"
159+
msgstr "会打印出 ``Base`` 的注解字典,而非 ``Derived`` 的。"
160160

161161
#: ../../howto/annotations.rst:101
162162
msgid ""
@@ -167,9 +167,9 @@ msgid ""
167167
" Since the class may or may not have annotations defined, best practice is "
168168
"to call the ``get`` method on the class dict."
169169
msgstr ""
170-
"若要查看的对象是个类(``isinstance(o, type)``),代码不得不另辟蹊径。这时的最佳做法依赖于 Python 3.9 "
171-
"及之前版本的一处细节:若某个类定义了注解,则会存放于字典 ``__dict__`` 中。由于类不一定会定义注解,最好的做法是在类的 dict 上调用 "
172-
"``get`` 方法。"
170+
"若待检查的对象是类(即 ``isinstance(o, type)``),代码不得不另辟蹊径。这时的最佳实践依赖于 3.9 及更低版本的 Python "
171+
"中的一处实现细节:若类定义了注解,则注解会被放入类的 ``__dict__`` 字典。类不一定有注解,故最佳实践是在类的字典上调用 ``get`` "
172+
"方法。"
173173

174174
#: ../../howto/annotations.rst:109
175175
msgid ""
@@ -328,7 +328,7 @@ msgstr "应避免删除对象的 ``__annotations__`` 属性。"
328328

329329
#: ../../howto/annotations.rst:198
330330
msgid "``__annotations__`` Quirks"
331-
msgstr "``__annotations__`` 的坑"
331+
msgstr "``__annotations__`` 的一些“坑”"
332332

333333
#: ../../howto/annotations.rst:200
334334
msgid ""

howto/logging-cookbook.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@ msgstr ""
24192419

24202420
#: ../../howto/logging-cookbook.rst:4080
24212421
msgid "Other resources"
2422-
msgstr "其他资源"
2422+
msgstr "其它资源"
24232423

24242424
#: ../../howto/logging-cookbook.rst:4085
24252425
msgid "Module :mod:`logging`"

library/dataclasses.po

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ msgstr ""
2323

2424
#: ../../library/dataclasses.rst:2
2525
msgid ":mod:`!dataclasses` --- Data Classes"
26-
msgstr ""
26+
msgstr ":mod:`!dataclasses` --- 数据类"
2727

2828
#: ../../library/dataclasses.rst:10
2929
msgid "**Source code:** :source:`Lib/dataclasses.py`"
@@ -47,7 +47,7 @@ msgstr "在这些生成的方法中使用的成员变量是使用 :pep:`526` 类
4747

4848
#: ../../library/dataclasses.rst:34
4949
msgid "will add, among other things, a :meth:`!__init__` that looks like::"
50-
msgstr ""
50+
msgstr "将添加多项内容,包括如下所示的 :meth:`!__init__`::"
5151

5252
#: ../../library/dataclasses.rst:41
5353
msgid ""
@@ -64,6 +64,7 @@ msgid ""
6464
"This function is a :term:`decorator` that is used to add generated "
6565
":term:`special methods <special method>` to classes, as described below."
6666
msgstr ""
67+
"此函数是一个 :term:`decorator`,它被用于将生成的 :term:`特殊方法 <special method>` 添加到类中,如下所述。"
6768

6869
#: ../../library/dataclasses.rst:54
6970
msgid ""
@@ -72,6 +73,9 @@ msgid ""
7273
"<variable annotation>`. With two exceptions described below, nothing in "
7374
"``@dataclass`` examines the type specified in the variable annotation."
7475
msgstr ""
76+
"``@dataclass`` 装饰器会检查类以找到其中的 ``field``。 ``field`` 被定义为具有 :term:`类型标注 "
77+
"<variable annotation>` 的类变量。 除了下面所述的两个例外,在 ``@dataclass`` "
78+
"中没有任何东西会去检查变量标注中指定的类型。"
7579

7680
#: ../../library/dataclasses.rst:60
7781
msgid ""
@@ -695,6 +699,8 @@ msgid ""
695699
":meth:`!__post_init__`. Also see the warning about how :func:`replace` "
696700
"handles ``init=False`` fields."
697701
msgstr ""
702+
"请参阅下面有关仅初始化变量的小节来了解如何将形参传递给 :meth:`!__post_init__`。 另请参阅关于 :func:`replace` "
703+
"如何处理 ``init=False`` 字段的警告。"
698704

699705
#: ../../library/dataclasses.rst:558
700706
msgid "Class variables"

library/pprint.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ msgid ""
107107
"Note that *sort_dicts* is ``True`` by default and you might want to use "
108108
":func:`~pprint.pp` instead where it is ``False`` by default."
109109
msgstr ""
110+
"请注意 *sort_dicts* 默认为 ``True``,你可能会考虑改用此参数默认为 ``False`` 的 :func:`~pprint.pp`。"
110111

111112
#: ../../library/pprint.rst:81
112113
msgid ""
@@ -314,10 +315,12 @@ msgid ""
314315
"parameters, let's fetch information about a project from `PyPI "
315316
"<https://pypi.org>`_::"
316317
msgstr ""
318+
"为了演示To demonstrate several uses of the :func:`~pprint.pp` 函数及其形参的几种用法,让我们从 "
319+
"`PyPI <https://pypi.org>`_ 获取关于某个项目的信息::"
317320

318321
#: ../../library/pprint.rst:273
319322
msgid "In its basic form, :func:`~pprint.pp` shows the whole object::"
320-
msgstr ""
323+
msgstr "在其基本形式中,:func:`~pprint.pp` 会显示整个对象::"
321324

322325
#: ../../library/pprint.rst:329
323326
msgid ""

library/unittest.mock.po

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.11\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-03-22 16:49+0000\n"
14+
"POT-Creation-Date: 2024-03-29 16:43+0000\n"
1515
"PO-Revision-Date: 2023-05-24 02:21+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -2790,7 +2790,7 @@ msgstr ":attr:`~Mock.return_value`"
27902790

27912791
#: ../../library/unittest.mock.rst:2792
27922792
msgid "*wraps*"
2793-
msgstr ""
2793+
msgstr "*wraps*"
27942794

27952795
#: ../../library/unittest.mock.rst:2794
27962796
msgid ""
@@ -2800,6 +2800,9 @@ msgid ""
28002800
"precedence will return the value. Regardless of the order of which was set "
28012801
"first, the order of precedence remains unchanged."
28022802
msgstr ""
2803+
"如果三个均已设置,模拟对象将返回来自 :attr:`~Mock.side_effect` 的值,完全忽略 "
2804+
":attr:`~Mock.return_value` 和被包装的对象。 如果设置任意两个,则具有更高优先级的那个将返回值。 "
2805+
"无论设置的顺序是哪个在前,优先级顺序将保持不变。"
28032806

28042807
#: ../../library/unittest.mock.rst:2812
28052808
msgid ""
@@ -2808,49 +2811,56 @@ msgid ""
28082811
" between :attr:`~Mock.return_value` and the wrapped object, ignoring "
28092812
":attr:`~Mock.side_effect`."
28102813
msgstr ""
2814+
"由于 ``None`` 是 :attr:`~Mock.side_effect` 的默认值,如果你将其值重新赋为 ``None``,则优先级顺序将在 "
2815+
":attr:`~Mock.return_value` 和被包装的对象之间进行检查,并忽略 :attr:`~Mock.side_effect`。"
28112816

28122817
#: ../../library/unittest.mock.rst:2821
28132818
msgid ""
28142819
"If the value being returned by :attr:`~Mock.side_effect` is :data:`DEFAULT`,"
28152820
" it is ignored and the order of precedence moves to the successor to obtain "
28162821
"the value to return."
28172822
msgstr ""
2823+
"如果 :attr:`~Mock.side_effect` 所返回的值为 "
2824+
":data:`DEFAULT`,它将被忽略并且优先级顺序将移至后继者来获取要返回的值。"
28182825

28192826
#: ../../library/unittest.mock.rst:2830
28202827
msgid ""
28212828
"When :class:`Mock` wraps an object, the default value of "
28222829
":attr:`~Mock.return_value` will be :data:`DEFAULT`."
28232830
msgstr ""
2831+
"当 :class:`Mock` 包装一个对象时,:attr:`~Mock.return_value` 的默认值将为 :data:`DEFAULT`。"
28242832

28252833
#: ../../library/unittest.mock.rst:2839
28262834
msgid ""
28272835
"The order of precedence will ignore this value and it will move to the last "
28282836
"successor which is the wrapped object."
2829-
msgstr ""
2837+
msgstr "优先级顺序将忽略该值并且它将移至末尾的后继者即被包装的对象。"
28302838

28312839
#: ../../library/unittest.mock.rst:2842
28322840
msgid ""
28332841
"As the real call is being made to the wrapped object, creating an instance "
28342842
"of this mock will return the real instance of the class. The positional "
28352843
"arguments, if any, required by the wrapped object must be passed."
2836-
msgstr ""
2844+
msgstr "由于真正调用的是被包装的对象,创建该模拟对象的实例将返回真正的该类实例。 被包装的对象所需要的任何位置参数都必须被传入。"
28372845

28382846
#: ../../library/unittest.mock.rst:2860
28392847
msgid ""
28402848
"But if you assign ``None`` to it, this will not be ignored as it is an "
28412849
"explicit assignment. So, the order of precedence will not move to the "
28422850
"wrapped object."
2843-
msgstr ""
2851+
msgstr "但是如果你将其赋值为 ``None``,由于它是一个显式赋值所以不会被忽略。 因此,优先级顺序将不会移至被包装的对象。"
28442852

28452853
#: ../../library/unittest.mock.rst:2868
28462854
msgid ""
28472855
"Even if you set all three at once when initializing the mock, the order of "
28482856
"precedence remains the same:"
2849-
msgstr ""
2857+
msgstr "即使你在初始化模拟对象时立即立即全部设置这三者,优先级顺序仍会保持原样:"
28502858

28512859
#: ../../library/unittest.mock.rst:2885
28522860
msgid ""
28532861
"If :attr:`~Mock.side_effect` is exhausted, the order of precedence will not "
28542862
"cause a value to be obtained from the successors. Instead, ``StopIteration``"
28552863
" exception is raised."
28562864
msgstr ""
2865+
"如果 :attr:`~Mock.side_effect` 已耗尽,优先级顺序将不会导致从后续者获取值。 而是会引发 ``StopIteration`` "
2866+
"异常。"

reference/datamodel.po

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ msgid ""
403403
"adding the sequence length. For example, ``a[-2]`` equals ``a[n-2]``, the "
404404
"second to last item of sequence a with length ``n``."
405405
msgstr ""
406+
"这些代表以非负数为索引的有限有序集合。 内置函数 :func:`len` 将返回序列的项数。 当序列 的长度为 *n* 时,索引集合将包含数字 0, "
407+
"1, ..., *n*-1。 ``a[i]`` 是选择序列 *a* 中的第 *i* 项。 某些序列,包括内置的序列,可通过加上序列长度来解读负下标值。 "
408+
"例如,``a[-2]`` 等价于 ``a[n-2]``,即长度为 ``n`` 的 a 序列的倒数第二项。"
406409

407410
#: ../../reference/datamodel.rst:309
408411
msgid ""
@@ -411,6 +414,8 @@ msgid ""
411414
"a sequence of the same type. The comment above about negative indexes also "
412415
"applies to negative slice positions."
413416
msgstr ""
417+
"序列还支持切片: ``a[i:j]`` 是选择索引为 *k* 使得 *i* ``<=`` *k* ``<`` *j* 的所有条目。 "
418+
"当用作表达式时,切片就是一个相同类型的新序列。 以上有关负索引的注释也适用于切片位置的负值。"
414419

415420
#: ../../reference/datamodel.rst:314
416421
msgid ""

0 commit comments

Comments
 (0)