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

Skip to content

Commit 8aa3576

Browse files
[po] auto sync
1 parent 0ccd297 commit 8aa3576

20 files changed

+544
-298
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "81.30%", "updated_at": "2025-03-28T15:46:57Z"}
1+
{"translation": "81.45%", "updated_at": "2025-03-28T18:50:46Z"}

c-api/allocation.po

Lines changed: 27 additions & 9 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 <[email protected]>, 2024
7+
# Rafael Fontenelle <[email protected]>, 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-11-12 09:11+0000\n"
14+
"POT-Creation-Date: 2025-03-28 14:58+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16-
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
16+
"Last-Translator: Rafael Fontenelle <[email protected]>, 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"
@@ -51,7 +51,16 @@ msgstr ""
5151
"对象。 f未在该 Python 对象标头中定义的字段不会被初始化。 调用方将拥有对该对象的唯一引用(即引用计数将为 1)。 内存分配的大小由类型对象的 "
5252
":c:member:`~PyTypeObject.tp_basicsize` 字段决定。"
5353

54-
#: ../../c-api/allocation.rst:41
54+
#: ../../c-api/allocation.rst:38
55+
msgid ""
56+
"Note that this function is unsuitable if *typeobj* has "
57+
":c:macro:`Py_TPFLAGS_HAVE_GC` set. For such objects, use "
58+
":c:func:`PyObject_GC_New` instead."
59+
msgstr ""
60+
"请注意如果 *typeobj* 设置了 :c:macro:`Py_TPFLAGS_HAVE_GC` 则此函数将不适用。 对于这样的对象,请改用 "
61+
":c:func:`PyObject_GC_New`。"
62+
63+
#: ../../c-api/allocation.rst:45
5564
msgid ""
5665
"Allocate a new Python object using the C structure type *TYPE* and the "
5766
"Python type object *typeobj* (``PyTypeObject*``). Fields not defined by the "
@@ -68,7 +77,16 @@ msgstr ""
6877
":c:member:`~PyTypeObject.tp_itemsize` 字段所给出的 *size* (``Py_ssize_t``) 个字段。 "
6978
"这对于实现像元组这样能够在构造时确定其大小的对象来说很有用。 将字段数组嵌入到相同的内在分配中可减少内存分配的次数,这提高了内存管理效率。"
7079

71-
#: ../../c-api/allocation.rst:55
80+
#: ../../c-api/allocation.rst:56
81+
msgid ""
82+
"Note that this function is unsuitable if *typeobj* has "
83+
":c:macro:`Py_TPFLAGS_HAVE_GC` set. For such objects, use "
84+
":c:func:`PyObject_GC_NewVar` instead."
85+
msgstr ""
86+
"请注意如果 *typeobj* 设置了 :c:macro:`Py_TPFLAGS_HAVE_GC` 则此函数将不适用。 对于这样的对象,请改用 "
87+
":c:func:`PyObject_GC_NewVar`。"
88+
89+
#: ../../c-api/allocation.rst:63
7290
msgid ""
7391
"Releases memory allocated to an object using :c:macro:`PyObject_New` or "
7492
":c:macro:`PyObject_NewVar`. This is normally called from the "
@@ -80,18 +98,18 @@ msgstr ""
8098
"这通常由在对象的类型中指定的 :c:member:`~PyTypeObject.tp_dealloc` 处理器来调用。 "
8199
"在此调用之后该对象中的字段不应再被访问因为原来的内存已不再是一个有效的 Python 对象。"
82100

83-
#: ../../c-api/allocation.rst:64
101+
#: ../../c-api/allocation.rst:72
84102
msgid ""
85103
"Object which is visible in Python as ``None``. This should only be accessed"
86104
" using the :c:macro:`Py_None` macro, which evaluates to a pointer to this "
87105
"object."
88106
msgstr ""
89107
"这个对象是像 ``None`` 一样的 Python 对象。它可以使用 :c:macro:`Py_None` 宏访问,该宏的拿到指向该对象的指针。"
90108

91-
#: ../../c-api/allocation.rst:71
109+
#: ../../c-api/allocation.rst:79
92110
msgid ":c:func:`PyModule_Create`"
93111
msgstr ":c:func:`PyModule_Create`"
94112

95-
#: ../../c-api/allocation.rst:72
113+
#: ../../c-api/allocation.rst:80
96114
msgid "To allocate and create extension modules."
97115
msgstr "分配内存和创建扩展模块"

c-api/type.po

Lines changed: 6 additions & 3 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 <[email protected]>, 2024
7+
# Rafael Fontenelle <[email protected]>, 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-03-21 14:55+0000\n"
14+
"POT-Creation-Date: 2025-03-28 14:58+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
16-
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
16+
"Last-Translator: Rafael Fontenelle <[email protected]>, 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"
@@ -509,6 +509,9 @@ msgid ""
509509
"padding when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s "
510510
"alignment requirements."
511511
msgstr ""
512+
"如为负数,则以其绝对值指定该类的实例在超类的 *基础之上* 还需要多少空间。 使用 :c:func:`PyObject_GetTypeData` "
513+
"来获取指向通过此方式保留的子类专属内存的指针。 对于负的 :c:member:`!basicsize`,Python 将在需要满足 "
514+
":c:member:`~PyTypeObject.tp_basicsize` 的对齐要求时插入填充字节。"
512515

513516
#: ../../c-api/type.rst:406
514517
msgid "Previously, this field could not be negative."

c-api/typeobj.po

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2025-03-21 14:55+0000\n"
14+
"POT-Creation-Date: 2025-03-28 14:58+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1616
"Last-Translator: Rafael Fontenelle <[email protected]>, 2025\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -1192,6 +1192,8 @@ msgid ""
11921192
":file:`Include/cpython/object.h`. For convenience of reference, this "
11931193
"repeats the definition found there:"
11941194
msgstr ""
1195+
"针对 :c:type:`PyTypeObject` 的结构定义可以在 :file:`Include/cpython/object.h` 中找到。 "
1196+
"为了方便参考,这里复述了其中的定义:"
11951197

11961198
#: ../../c-api/typeobj.rst:481
11971199
msgid ""
@@ -1532,7 +1534,7 @@ msgstr ""
15321534
msgid ""
15331535
"This field should be accessed using the :c:func:`Py_SIZE()` and "
15341536
":c:func:`Py_SET_SIZE()` macros."
1535-
msgstr ""
1537+
msgstr "该字段应当使用 :c:func:`Py_SIZE()` 和 :c:func:`Py_SET_SIZE()` 宏来访问。"
15361538

15371539
#: ../../c-api/typeobj.rst:571
15381540
msgid "PyTypeObject Slots"
@@ -1623,6 +1625,10 @@ msgid ""
16231625
":c:member:`!tp_basicsize`. (Exceptions to this rule can be made using "
16241626
":c:func:`PyUnstable_Object_GC_NewWithExtraData`.)"
16251627
msgstr ""
1628+
"类型可分为两种:实例为固定长度且 :c:member:`!tp_itemsize` 字段值为零的类型;实例为可变长度且 "
1629+
":c:member:`!tp_itemsize` 字段值不为零的类型。 对于实例为固定长度的类型,所有实例都具有相同的由 "
1630+
":c:member:`!tp_basicsize` 给出的大小。 (这条规则的例外情况可通过使用 "
1631+
":c:func:`PyUnstable_Object_GC_NewWithExtraData` 来实现。)"
16261632

16271633
#: ../../c-api/typeobj.rst:626
16281634
msgid ""
@@ -1631,6 +1637,8 @@ msgid ""
16311637
":c:member:`!tp_basicsize` plus N times :c:member:`!tp_itemsize`, where N is "
16321638
"the \"length\" of the object."
16331639
msgstr ""
1640+
"对于实例为可变长度的类型,其实例必须具有 :c:member:`~PyVarObject.ob_size` 字段,且实例大小为 "
1641+
":c:member:`!tp_basicsize` 加 N 乘以 :c:member:`!tp_itemsize`,其中 N 为对象的“长度”。"
16341642

16351643
#: ../../c-api/typeobj.rst:631
16361644
msgid ""
@@ -1642,12 +1650,19 @@ msgid ""
16421650
"underlying storage and its size should be acessed using "
16431651
":c:func:`PyLong_Export`."
16441652
msgstr ""
1653+
":c:func:`PyObject_NewVar` 等函数接受 N 值作为参数,并将其保存在实例的 "
1654+
":c:member:`~PyVarObject.ob_size` 字段中。 请注意在此之后 "
1655+
":c:member:`~PyVarObject.ob_size` 字段可能还有其他用处。 例如,:py:type:`int` "
1656+
"实例会以具体实现所定义的方式来使用 :c:member:`~PyVarObject.ob_size` 的比特位;下层的存储及其大小应当使用 "
1657+
":c:func:`PyLong_Export` 来访问。"
16451658

16461659
#: ../../c-api/typeobj.rst:641
16471660
msgid ""
16481661
"The :c:member:`~PyVarObject.ob_size` field should be accessed using the "
16491662
":c:func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros."
16501663
msgstr ""
1664+
":c:member:`~PyVarObject.ob_size` 字段应当使用 :c:func:`Py_SIZE()` 和 "
1665+
":c:func:`Py_SET_SIZE()` 宏来访问。"
16511666

16521667
#: ../../c-api/typeobj.rst:644
16531668
msgid ""
@@ -1658,13 +1673,19 @@ msgid ""
16581673
":py:type:`int`, avoid reading lists' :c:member:`!ob_size` directly. Call "
16591674
":c:func:`PyList_Size` instead.)"
16601675
msgstr ""
1676+
"此外,实例布局中存在 :c:member:`~PyVarObject.ob_size` 字段并不意味着该实例结构体是可变长度的。 "
1677+
"例如,:py:type:`list` 类型实例即为固定长度,虽然其实例具有 :c:member:`~PyVarObject.ob_size` 字段。 "
1678+
"(和 :py:type:`int` 一样,请避免直接读取 list 的 :c:member:`!ob_size`。 要改为调用 "
1679+
":c:func:`PyList_Size` 函数。)"
16611680

16621681
#: ../../c-api/typeobj.rst:651
16631682
msgid ""
16641683
"The :c:member:`!tp_basicsize` includes size needed for data of the type's "
16651684
":c:member:`~PyTypeObject.tp_base`, plus any extra data needed by each "
16661685
"instance."
16671686
msgstr ""
1687+
":c:member:`!tp_basicsize` 包括类型的 :c:member:`~PyTypeObject.tp_base` "
1688+
"所需数据大小,加上每个实例所需额外数据的大小。"
16681689

16691690
#: ../../c-api/typeobj.rst:655
16701691
msgid ""
@@ -1674,6 +1695,9 @@ msgid ""
16741695
":c:member:`!tp_basicsize` must be greater than or equal to the base's "
16751696
":c:member:`!tp_basicsize`."
16761697
msgstr ""
1698+
"设置 :c:member:`!tp_basicsize` 的正确方式是在被用于声明实例布局的结构体上使用 ``sizeof`` 运算符。 "
1699+
"这个结构体必须包括被用于声明基类型的结构体。 换句话说,:c:member:`!tp_basicsize` 必须大于等于基类型的 "
1700+
":c:member:`!tp_basicsize`。"
16771701

16781702
#: ../../c-api/typeobj.rst:661
16791703
msgid ""
@@ -1683,22 +1707,27 @@ msgid ""
16831707
"defined by the macro :c:macro:`PyObject_HEAD` or "
16841708
":c:macro:`PyObject_VAR_HEAD`, respectively."
16851709
msgstr ""
1710+
"由于任何类型都是 :py:type:`object` 的子类型,这个结构体必须包括 :c:type:`PyObject` 或 "
1711+
":c:type:`PyVarObject` (具体取决于 :c:member:`~PyVarObject.ob_size` 是否应当被包括)。 "
1712+
"它们通常是分别由 :c:macro:`PyObject_HEAD` 或 :c:macro:`PyObject_VAR_HEAD` 宏来定义的。"
16861713

16871714
#: ../../c-api/typeobj.rst:667
16881715
msgid ""
16891716
"The basic size does not include the GC header size, as that header is not "
16901717
"part of :c:macro:`PyObject_HEAD`."
1691-
msgstr ""
1718+
msgstr "基础大小不包括 GC 标头大小,因为该标头不是 :c:macro:`PyObject_HEAD` 的一部分。"
16921719

16931720
#: ../../c-api/typeobj.rst:670
16941721
msgid ""
16951722
"For cases where struct used to declare the base type is unknown, see "
16961723
":c:member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`."
16971724
msgstr ""
1725+
"对于用于声明基类型的结构体位置未知的情况,请参见 :c:member:`PyType_Spec.basicsize` 和 "
1726+
":c:func:`PyType_FromMetaclass`。"
16981727

16991728
#: ../../c-api/typeobj.rst:673
17001729
msgid "Notes about alignment:"
1701-
msgstr ""
1730+
msgstr "有关对齐的说明:"
17021731

17031732
#: ../../c-api/typeobj.rst:675
17041733
msgid ""
@@ -1708,6 +1737,9 @@ msgid ""
17081737
"when using compiler extensions like ``__attribute__((packed))``, it is up to"
17091738
" you."
17101739
msgstr ""
1740+
":c:member:`!tp_basicsize` 必须是 ``_Alignof(PyObject)`` 的位数。 当如建议的那样在包括了 "
1741+
":c:macro:`PyObject_HEAD` 的 ``struct`` 上使用 ``sizeof`` 时,编译器会确保这一点。 当没有使用 C "
1742+
"``struct``,或者当使用像 ``__attribute__((packed))`` 这样的编译器扩展时,这将是你的责任。"
17111743

17121744
#: ../../c-api/typeobj.rst:680
17131745
msgid ""
@@ -1717,13 +1749,18 @@ msgid ""
17171749
"``double``, it is your responsibility that both fields are a multiple of "
17181750
"``_Alignof(double)``."
17191751
msgstr ""
1752+
"如果可变条目需要特定的对齐,则 :c:member:`!tp_basicsize` 和 :c:member:`!tp_itemsize` "
1753+
"必须均为该对齐值的倍数。 举例来说,如果一个类型的可变部分存储了一个 ``double``,你就要负责让这两个字段都是 "
1754+
"``_Alignof(double)`` 的倍数。"
17201755

17211756
#: ../../c-api/typeobj.rst:689
17221757
msgid ""
17231758
"These fields are inherited separately by subtypes. (That is, if the field is"
17241759
" set to zero, :c:func:`PyType_Ready` will copy the value from the base type,"
17251760
" indicating that the instances do not need additional storage.)"
17261761
msgstr ""
1762+
"这些字段是由子类型分别来继承的。 (也就是说,如果字段被设为零,则 :c:func:`PyType_Ready` "
1763+
"将拷贝来自基类型的值,这表示实例不需要额外的存储。)"
17271764

17281765
#: ../../c-api/typeobj.rst:694
17291766
msgid ""
@@ -1732,6 +1769,8 @@ msgid ""
17321769
"different non-zero value in a subtype (though this depends on the "
17331770
"implementation of the base type)."
17341771
msgstr ""
1772+
"如果基类型有一个非零的 :c:member:`~PyTypeObject.tp_itemsize`,那么在子类型中将 "
1773+
":c:member:`~PyTypeObject.tp_itemsize` 设置为不同的非零值通常是不安全的(不过这取决于该基类型的具体实现)。"
17351774

17361775
#: ../../c-api/typeobj.rst:701
17371776
msgid ""

glossary.po

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ msgid ""
1414
msgstr ""
1515
"Project-Id-Version: Python 3.12\n"
1616
"Report-Msgid-Bugs-To: \n"
17-
"POT-Creation-Date: 2025-03-21 14:55+0000\n"
17+
"POT-Creation-Date: 2025-03-28 14:58+0000\n"
1818
"PO-Revision-Date: 2024-05-11 00:32+0000\n"
1919
"Last-Translator: Rafael Fontenelle <[email protected]>, 2025\n"
2020
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -1537,11 +1537,11 @@ msgstr ""
15371537

15381538
#: ../../glossary.rst:736
15391539
msgid "lexical analyzer"
1540-
msgstr ""
1540+
msgstr "lexical analyzer -- 词法分析器"
15411541

15421542
#: ../../glossary.rst:739
15431543
msgid "Formal name for the *tokenizer*; see :term:`token`."
1544-
msgstr ""
1544+
msgstr "*分词器* 的正式名称;参见 :term:`token`。"
15451545

15461546
#: ../../glossary.rst:740
15471547
msgid "list"
@@ -2573,12 +2573,13 @@ msgid ""
25732573
"<lexical>` (also called the *tokenizer*). Names, numbers, strings, "
25742574
"operators, newlines and similar are represented by tokens."
25752575
msgstr ""
2576+
"一个源代码小单元,由 :ref:`词法分析器 <lexical>` (或称 *分词器*) 生成。 名称、数字、字符串、运算符、换行符等均由词元来表示。"
25762577

25772578
#: ../../glossary.rst:1226
25782579
msgid ""
25792580
"The :mod:`tokenize` module exposes Python's lexical analyzer. The "
25802581
":mod:`token` module contains information on the various types of tokens."
2581-
msgstr ""
2582+
msgstr ":mod:`tokenize` 模块对外暴露了 Python 的词法分析器。 :mod:`token` 模块包含了有关各种词元类型的信息。"
25822583

25832584
#: ../../glossary.rst:1229
25842585
msgid "triple-quoted string"

0 commit comments

Comments
 (0)