Skip to content

Commit 4fdad1c

Browse files
[po] auto sync
1 parent a27eedb commit 4fdad1c

File tree

13 files changed

+1175
-432
lines changed

13 files changed

+1175
-432
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "81.13%", "updated_at": "2025-01-17T15:46:37Z"}
1+
{"translation": "81.22%", "updated_at": "2025-01-22T01:06:23Z"}

c-api/arg.po

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
7+
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
88
#
99
#, fuzzy
1010
msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2025-01-10 14:49+0000\n"
14+
"POT-Creation-Date: 2025-01-17 14:51+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16-
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
16+
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=UTF-8\n"
@@ -500,6 +500,9 @@ msgid ""
500500
":meth:`~object.__complex__` to convert the Python object to the required "
501501
"type."
502502
msgstr ""
503+
"这些格式允许将 Python 数字或单个字符表示为 C 数字。 需要 :class:`int`, :class:`float` 或 "
504+
":class:`complex` 的格式还可以使用相应的特殊方法 :meth:`~object.__index__`, "
505+
":meth:`~object.__float__` 或 :meth:`~object.__complex__` 将 Python 对象转换为所需的类型。"
503506

504507
#: ../../c-api/arg.rst:238
505508
msgid ""
@@ -508,6 +511,8 @@ msgid ""
508511
" is done --- the most significant bits are silently truncated when the "
509512
"receiving field is too small to receive the value."
510513
msgstr ""
514+
"对于有符号整数格式,如果值超出了 C 类型的范围则会引发 :exc:`OverflowError`。 对于无符号整数格式,则不会进行取值范围检查 ---"
515+
" 当接受字段太小而无法接受值时将静默地截断最高有效位。"
511516

512517
#: ../../c-api/arg.rst:244
513518
msgid "``b`` (:class:`int`) [unsigned char]"
@@ -517,7 +522,7 @@ msgstr "``b`` (:class:`int`) [unsigned char]"
517522
msgid ""
518523
"Convert a nonnegative Python integer to an unsigned tiny integer, stored in "
519524
"a C :c:expr:`unsigned char`."
520-
msgstr ""
525+
msgstr "将一个非负的 Python 整数转换为无符号微整数,存储于 C :c:expr:`unsigned char` 中。"
521526

522527
#: ../../c-api/arg.rst:248 ../../c-api/arg.rst:592
523528
msgid "``B`` (:class:`int`) [unsigned char]"
@@ -527,7 +532,7 @@ msgstr "``B`` (:class:`int`) [unsigned char]"
527532
msgid ""
528533
"Convert a Python integer to a tiny integer without overflow checking, stored"
529534
" in a C :c:expr:`unsigned char`."
530-
msgstr ""
535+
msgstr "将一个 Python 整数转换为微整数并且不进行溢出检查,存储于 C :c:expr:`unsigned char` 中。"
531536

532537
#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:586
533538
msgid "``h`` (:class:`int`) [short int]"
@@ -695,7 +700,7 @@ msgstr ""
695700

696701
#: ../../c-api/arg.rst:322
697702
msgid "``O&`` (object) [*converter*, *address*]"
698-
msgstr ""
703+
msgstr "``O&`` (object) [*converter*, *address*]"
699704

700705
#: ../../c-api/arg.rst:323
701706
msgid ""
@@ -732,16 +737,20 @@ msgid ""
732737
"this second call, the *object* parameter will be ``NULL``; *address* will "
733738
"have the same value as in the original call."
734739
msgstr ""
740+
"如果 *converter* 返回 "
741+
":c:macro:`!Py_CLEANUP_SUPPORTED`,则如果参数解析最终失败它可能会再次被调用,以使转换器有机会释放已分配的任何内存。 "
742+
"在第二次调用中,*object* 形参将为 ``NULL``; *address* 将具有与原始调用相同的值。"
735743

736744
#: ../../c-api/arg.rst:345
737745
msgid ""
738746
"Examples of converters: :c:func:`PyUnicode_FSConverter` and "
739747
":c:func:`PyUnicode_FSDecoder`."
740748
msgstr ""
749+
"转换器的例子: :c:func:`PyUnicode_FSConverter` 和 :c:func:`PyUnicode_FSDecoder`。"
741750

742751
#: ../../c-api/arg.rst:348
743752
msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added."
744-
msgstr ""
753+
msgstr "增加了 :c:macro:`!Py_CLEANUP_SUPPORTED`。"
745754

746755
#: ../../c-api/arg.rst:351
747756
msgid "``p`` (:class:`bool`) [int]"

c-api/intro.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2024, Python Software Foundation
2+
# Copyright (C) 2001-2025, Python Software Foundation
33
# This file is distributed under the same license as the Python package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
7+
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
88
#
99
#, fuzzy
1010
msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-09-27 14:50+0000\n"
14+
"POT-Creation-Date: 2025-01-17 14:51+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16-
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
16+
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1081,7 +1081,7 @@ msgstr ""
10811081

10821082
#: ../../c-api/intro.rst:664
10831083
msgid "Here is the corresponding C code, in all its glory::"
1084-
msgstr "下面是对应的闪耀荣光的 C 代码:"
1084+
msgstr "对应的 C 代码如下:"
10851085

10861086
#: ../../c-api/intro.rst:666
10871087
msgid ""

c-api/unicode.po

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
7+
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
88
#
99
#, fuzzy
1010
msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2025-01-10 14:49+0000\n"
14+
"POT-Creation-Date: 2025-01-17 14:51+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16-
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
16+
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1074,6 +1074,8 @@ msgid ""
10741074
"``\"O&\"`` converter should be used, passing "
10751075
":c:func:`!PyUnicode_FSConverter` as the conversion function:"
10761076
msgstr ""
1077+
"要在参数解析期间将文件名编码为 :class:`bytes`,应当使用 ``\"O&\"`` 转换器,传入 "
1078+
":c:func:`!PyUnicode_FSConverter` 作为转换函数:"
10771079

10781080
#: ../../c-api/unicode.rst:778
10791081
msgid ""
@@ -1087,12 +1089,19 @@ msgid ""
10871089
"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are "
10881090
"not allowed in the result. On failure, return ``0`` with an exception set."
10891091
msgstr ""
1092+
":ref:`PyArg_Parse\\* 转换器 <arg-parsing>`: 使用 "
1093+
":c:func:`PyUnicode_EncodeFSDefault` 编码 :class:`str` 对象 -- 直接获取或通过 "
1094+
":class:`os.PathLike` 接口 -- 为 :class:`bytes`; :class:`bytes` 对象将被原样输出。 "
1095+
"*result* 必须是一个类型为 :c:expr:`PyObject*` (或 :c:expr:`PyBytesObject*`) 的 C "
1096+
"变量的地址。 执行成功时,将把该变量设为指向一个 :ref:`字节串对象 <bytesobjects>` 的新的 :term:`strong "
1097+
"reference`,它必须在其不再使用时被释放并返回一个非零值 (:c:macro:`Py_CLEANUP_SUPPORTED`)。 "
1098+
"结果中不允许嵌入空字节。 执行失败时,将返回 ``0`` 并设置一个异常。"
10901099

10911100
#: ../../c-api/unicode.rst:790
10921101
msgid ""
10931102
"If *obj* is ``NULL``, the function releases a strong reference stored in the"
10941103
" variable referred by *result* and returns ``1``."
1095-
msgstr ""
1104+
msgstr "如果 *obj* 为 ``NULL``,该函数将释放存放在 *result* 所引用的变量中的强引用并返回 ``1``。"
10961105

10971106
#: ../../c-api/unicode.rst:795 ../../c-api/unicode.rst:822
10981107
msgid "Accepts a :term:`path-like object`."
@@ -1104,6 +1113,8 @@ msgid ""
11041113
" converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the "
11051114
"conversion function:"
11061115
msgstr ""
1116+
"要在参数解析期间将文件名解码为 :class:`str`,应当使用 ``\"O&\"`` 转换器,传入 "
1117+
":c:func:`!PyUnicode_FSDecoder` 作为转换函数:"
11071118

11081119
#: ../../c-api/unicode.rst:804
11091120
msgid ""
@@ -1119,12 +1130,19 @@ msgid ""
11191130
"characters are not allowed in the result. On failure, return ``0`` with an "
11201131
"exception set."
11211132
msgstr ""
1133+
":ref:`PyArg_Parse\\* 转换器 <arg-parsing>`: 使用 "
1134+
":c:func:`PyUnicode_DecodeFSDefaultAndSize` 解码 :class:`bytes` 对象 -- 直接获取或通过 "
1135+
":class:`os.PathLike` 接口 -- 为 :class:`str`; :class:`str` 对象将被原样输出。 *result* "
1136+
"必须是一个类型为 :c:expr:`PyObject*` (或 :c:expr:`PyUnicodeObject*`) 的 C 变量的地址。 "
1137+
"执行成功时,将把该变量设为指向一个 :ref:`Unicode 对象 <unicodeobjects>` 的新的 :term:`strong "
1138+
"reference`,它必须在其不再使用时被释放并返回一个非零值 (:c:macro:`Py_CLEANUP_SUPPORTED`)。 "
1139+
"结果中不允许嵌入空字节。 执行失败时,将返回 ``0`` 并设置一个异常。"
11221140

11231141
#: ../../c-api/unicode.rst:817
11241142
msgid ""
11251143
"If *obj* is ``NULL``, release the strong reference to the object referred to"
11261144
" by *result* and return ``1``."
1127-
msgstr ""
1145+
msgstr "如果 *obj* 为 ``NULL``,则释放指向 *result* 所引用的对象的强引用并返回 ``1``。"
11281146

11291147
#: ../../c-api/unicode.rst:828
11301148
msgid ""

howto/descriptor.po

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2024, Python Software Foundation
2+
# Copyright (C) 2001-2025, Python Software Foundation
33
# This file is distributed under the same license as the Python package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
# Translators:
7-
# Rafael Fontenelle <rffontenelle@gmail.com>, 2024
7+
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
88
#
99
#, fuzzy
1010
msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-12-27 14:52+0000\n"
14+
"POT-Creation-Date: 2025-01-17 14:51+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16-
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
16+
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=UTF-8\n"
@@ -256,6 +256,9 @@ msgid ""
256256
" parameter that lets the :meth:`~object.__get__` method learn the target "
257257
"directory. The *objtype* parameter is the class *Directory*."
258258
msgstr ""
259+
"除了说明描述器如何运行计算,这个例子也揭示了传给 :meth:`~object.__get__` 的形参的目的。 *self* 形参为 "
260+
"*size*,即一个 *DirectorySize* 的实例。 *obj* 形参为 *g* 或 *s*,即一个 *Directory* 的实例。 "
261+
"*obj* 形参让 :meth:`~object.__get__` 方法获知目标目录。 *objtype* 形参为 *Directory* 类。"
259262

260263
#: ../../howto/descriptor.rst:131
261264
msgid "Managed attributes"
@@ -269,6 +272,8 @@ msgid ""
269272
" The descriptor's :meth:`~object.__get__` and :meth:`~object.__set__` "
270273
"methods are triggered when the public attribute is accessed."
271274
msgstr ""
275+
"描述器的一种流行用法是管理对实例数据的访问。 描述器被分配给类字典中的公有属性,而实际数据则作为私有属性存储在实例字典中。 描述器的 "
276+
":meth:`~object.__get__` 和 :meth:`~object.__set__` 方法会在公有属性被访问时被触发。"
272277

273278
#: ../../howto/descriptor.rst:139
274279
msgid ""
@@ -362,6 +367,28 @@ msgid ""
362367
"INFO:root:Accessing 'age' giving 40\n"
363368
"40"
364369
msgstr ""
370+
">>> mary = Person('Mary M', 30) # 初始年龄更新会被记录\n"
371+
"INFO:root:Updating 'age' to 30\n"
372+
">>> dave = Person('David D', 40)\n"
373+
"INFO:root:Updating 'age' to 40\n"
374+
"\n"
375+
">>> vars(mary) # 私有属性中的实际数据\n"
376+
"{'name': 'Mary M', '_age': 30}\n"
377+
">>> vars(dave)\n"
378+
"{'name': 'David D', '_age': 40}\n"
379+
"\n"
380+
">>> mary.age # 访问数据并记录查找操作\n"
381+
"INFO:root:Accessing 'age' giving 30\n"
382+
"30\n"
383+
">>> mary.birthday() # 更新也会被记录\n"
384+
"INFO:root:Accessing 'age' giving 30\n"
385+
"INFO:root:Updating 'age' to 31\n"
386+
"\n"
387+
">>> dave.name # 常规属性查找不会被记录\n"
388+
"'David D'\n"
389+
">>> dave.age # 只有被管理的属性会被记录\n"
390+
"INFO:root:Accessing 'age' giving 40\n"
391+
"40"
365392

366393
#: ../../howto/descriptor.rst:206
367394
msgid ""
@@ -391,6 +418,9 @@ msgid ""
391418
" names can be recorded, giving each descriptor its own *public_name* and "
392419
"*private_name*:"
393420
msgstr ""
421+
"在此示例中,:class:`!Person` 类具有两个描述器实例 *name* 和 *age*。 当 :class:`!Person` "
422+
"类被定义时,它将在 *LoggedAccess* 中执行对 :meth:`~object.__set_name__` "
423+
"的回调以便记录字段名称,给予每个描述器自己的 *public_name* 和 *private_name*:"
394424

395425
#: ../../howto/descriptor.rst:223
396426
msgid ""
@@ -1035,6 +1065,30 @@ msgid ""
10351065
" return cls_var # class variable\n"
10361066
" raise AttributeError(name)"
10371067
msgstr ""
1068+
"def find_name_in_mro(cls, name, default):\n"
1069+
" \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n"
1070+
" for base in cls.__mro__:\n"
1071+
" if name in vars(base):\n"
1072+
" return vars(base)[name]\n"
1073+
" return default\n"
1074+
"\n"
1075+
"def object_getattribute(obj, name):\n"
1076+
" \"Emulate PyObject_GenericGetAttr() in Objects/object.c\"\n"
1077+
" null = object()\n"
1078+
" objtype = type(obj)\n"
1079+
" cls_var = find_name_in_mro(objtype, name, null)\n"
1080+
" descr_get = getattr(type(cls_var), '__get__', null)\n"
1081+
" if descr_get is not null:\n"
1082+
" if (hasattr(type(cls_var), '__set__')\n"
1083+
" or hasattr(type(cls_var), '__delete__')):\n"
1084+
" return descr_get(cls_var, obj, objtype) # 数据描述器\n"
1085+
" if hasattr(obj, '__dict__') and name in vars(obj):\n"
1086+
" return vars(obj)[name] # 实例变量\n"
1087+
" if descr_get is not null:\n"
1088+
" return descr_get(cls_var, obj, objtype) # 非数据描述器\n"
1089+
" if cls_var is not null:\n"
1090+
" return cls_var # 类变量\n"
1091+
" raise AttributeError(name)"
10381092

10391093
#: ../../howto/descriptor.rst:719
10401094
msgid ""
@@ -1573,6 +1627,14 @@ msgid ""
15731627
" return self\n"
15741628
" return MethodType(self, obj)"
15751629
msgstr ""
1630+
"class Function:\n"
1631+
" ...\n"
1632+
"\n"
1633+
" def __get__(self, obj, objtype=None):\n"
1634+
" \"Simulate func_descr_get() in Objects/funcobject.c\"\n"
1635+
" if obj is None:\n"
1636+
" return self\n"
1637+
" return MethodType(self, obj)"
15761638

15771639
#: ../../howto/descriptor.rst:1201
15781640
msgid ""
@@ -1613,6 +1675,8 @@ msgid ""
16131675
">>> D.__dict__['f']\n"
16141676
"<function D.f at 0x00C45070>"
16151677
msgstr ""
1678+
">>> D.__dict__['f']\n"
1679+
"<function D.f at 0x00C45070>"
16161680

16171681
#: ../../howto/descriptor.rst:1223
16181682
msgid ""
@@ -1625,6 +1689,8 @@ msgid ""
16251689
">>> D.f\n"
16261690
"<function D.f at 0x00C45070>"
16271691
msgstr ""
1692+
">>> D.f\n"
1693+
"<function D.f at 0x00C45070>"
16281694

16291695
#: ../../howto/descriptor.rst:1229
16301696
msgid ""
@@ -1639,6 +1705,9 @@ msgid ""
16391705
">>> d.f\n"
16401706
"<bound method D.f of <__main__.D object at 0x00B18C90>>"
16411707
msgstr ""
1708+
">>> d = D()\n"
1709+
">>> d.f\n"
1710+
"<bound method D.f of <__main__.D object at 0x00B18C90>>"
16421711

16431712
#: ../../howto/descriptor.rst:1236
16441713
msgid ""

0 commit comments

Comments
 (0)