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

Skip to content

Commit 58d663c

Browse files
authored
Merge pull request python#179 from mattwang44/trans-some-c-api
Translate `c-api/{allocation,cell,gen}.po`
2 parents 6b345e0 + 08a8a6c commit 58d663c

File tree

3 files changed

+72
-14
lines changed

3 files changed

+72
-14
lines changed

c-api/allocation.po

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Liang-Bo Wang <[email protected]>, 2016
7+
# Matt Wang <[email protected]>, 2021
8+
#
69
msgid ""
710
msgstr ""
811
"Project-Id-Version: Python 3.11\n"
912
"Report-Msgid-Bugs-To: \n"
1013
"POT-Creation-Date: 2022-07-06 00:17+0000\n"
11-
"PO-Revision-Date: 2016-01-31 07:06+0000\n"
12-
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
14+
"PO-Revision-Date: 2022-10-16 15:35+0800\n"
15+
"Last-Translator: Matt Wang <[email protected]>\n"
1316
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1417
"tw)\n"
1518
"Language: zh_TW\n"
1619
"MIME-Version: 1.0\n"
1720
"Content-Type: text/plain; charset=UTF-8\n"
1821
"Content-Transfer-Encoding: 8bit\n"
1922
"Plural-Forms: nplurals=1; plural=0;\n"
23+
"X-Generator: Poedit 3.1.1\n"
2024

2125
#: ../../c-api/allocation.rst:6
2226
msgid "Allocating Objects on the Heap"
23-
msgstr ""
27+
msgstr "在 heap 上分配物件"
2428

2529
#: ../../c-api/allocation.rst:17
2630
msgid ""
@@ -30,12 +34,17 @@ msgid ""
3034
"detector's set of observed objects. Other fields of the object are not "
3135
"affected."
3236
msgstr ""
37+
"用它的型別和初始參照來初始化新分配物件 *op*。已初始化的物件會被回傳。如果 "
38+
"*type* 表示了該物件參與迴圈垃圾檢查器,則將其新增到檢查器的觀察物件集合中。物"
39+
"件的其他欄位不受影響。"
3340

3441
#: ../../c-api/allocation.rst:26
3542
msgid ""
3643
"This does everything :c:func:`PyObject_Init` does, and also initializes the "
3744
"length information for a variable-size object."
3845
msgstr ""
46+
"它會做到 :c:func:`PyObject_Init` 的所有功能,並且會初始化一個大小可變物件的長"
47+
"度資訊。"
3948

4049
#: ../../c-api/allocation.rst:32
4150
msgid ""
@@ -45,6 +54,10 @@ msgid ""
4554
"the memory allocation is determined from the :c:member:`~PyTypeObject."
4655
"tp_basicsize` field of the type object."
4756
msgstr ""
57+
"使用 C 結構型別 *TYPE* 和 Python 型別物件 *type* 分配一個新的 Python 物件。未"
58+
"在該 Python 物件標頭 (header) 中定義的欄位不會被初始化;物件的參照計數將為"
59+
"一。記憶體分配大小由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位"
60+
"來指定。"
4861

4962
#: ../../c-api/allocation.rst:41
5063
msgid ""
@@ -57,6 +70,12 @@ msgid ""
5770
"Embedding the array of fields into the same allocation decreases the number "
5871
"of allocations, improving the memory management efficiency."
5972
msgstr ""
73+
"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *type* 分配一個新的 Python 物"
74+
"件。未在該 Python 物件標頭中定義的欄位不會被初始化。記憶體空間預留了 *TYPE* "
75+
"結構大小再加上 *type* 物件中 :c:member:`~PyTypeObject.tp_itemsize` 欄位提供"
76+
"的 *size* 欄位的值。這對於實現如 tuple 這種能夠在建立期間決定自己大小的物件是"
77+
"很實用的。將欄位的陣列嵌入到相同的記憶體分配中可以減少記憶體分配的次數,這提"
78+
"高了記憶體管理的效率。"
6079

6180
#: ../../c-api/allocation.rst:53
6281
msgid ""
@@ -66,18 +85,24 @@ msgid ""
6685
"fields of the object should not be accessed after this call as the memory is "
6786
"no longer a valid Python object."
6887
msgstr ""
88+
"釋放由 :c:func:`PyObject_New` 或者 :c:func:`PyObject_NewVar` 分配給物件的記憶"
89+
"體。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` handler "
90+
"中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的記憶體已"
91+
"不再是一個有效的 Python 物件。"
6992

7093
#: ../../c-api/allocation.rst:62
7194
msgid ""
7295
"Object which is visible in Python as ``None``. This should only be accessed "
7396
"using the :c:macro:`Py_None` macro, which evaluates to a pointer to this "
7497
"object."
7598
msgstr ""
99+
"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存"
100+
"取,該巨集的拿到指向該物件的指標。"
76101

77102
#: ../../c-api/allocation.rst:69
78103
msgid ":c:func:`PyModule_Create`"
79104
msgstr ":c:func:`PyModule_Create`"
80105

81106
#: ../../c-api/allocation.rst:70
82107
msgid "To allocate and create extension modules."
83-
msgstr ""
108+
msgstr "分配記憶體和建立擴充模組。"

c-api/cell.po

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@
55
# Translators:
66
# aminzai <[email protected]>, 2015
77
# Liang-Bo Wang <[email protected]>, 2015
8+
# Matt Wang <[email protected]>, 2021
9+
#
810
msgid ""
911
msgstr ""
1012
"Project-Id-Version: Python 3.11\n"
1113
"Report-Msgid-Bugs-To: \n"
1214
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
13-
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
14-
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
15+
"PO-Revision-Date: 2022-10-16 15:33+0800\n"
16+
"Last-Translator: Matt Wang <[email protected]>\n"
1517
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1618
"tw)\n"
1719
"Language: zh_TW\n"
1820
"MIME-Version: 1.0\n"
1921
"Content-Type: text/plain; charset=UTF-8\n"
2022
"Content-Transfer-Encoding: 8bit\n"
2123
"Plural-Forms: nplurals=1; plural=0;\n"
24+
"X-Generator: Poedit 3.1.1\n"
2225

2326
#: ../../c-api/cell.rst:6
2427
msgid "Cell Objects"
@@ -35,10 +38,16 @@ msgid ""
3538
"support from the generated byte-code; these are not automatically de-"
3639
"referenced when accessed. Cell objects are not likely to be useful elsewhere."
3740
msgstr ""
41+
"\"Cell\" 物件用於實現被多個作用域所參照 (reference) 的變數。對於每個這樣的變"
42+
"數,都會有個 cell 物件為了儲存該值而被建立;參照該值的每個 stack frame 中的區"
43+
"域性變數包含外部作用域的 cell 參照,它同樣使用了該變數。存取該值時,將使用 "
44+
"cell 中包含的值而不是 cell 物件本身。這種對 cell 物件的去除參照 (de-"
45+
"reference) 需要生成的位元組碼 (byte-code) 有支援;存取時不會自動去除參照。"
46+
"cell 物件在其他地方可能不太有用。"
3847

3948
#: ../../c-api/cell.rst:20
4049
msgid "The C structure used for cell objects."
41-
msgstr "C 結構的 cell 物件"
50+
msgstr "Cell 物件所用之 C 結構。"
4251

4352
#: ../../c-api/cell.rst:25
4453
msgid "The type object corresponding to cell objects."
@@ -49,22 +58,26 @@ msgid ""
4958
"Return true if *ob* is a cell object; *ob* must not be ``NULL``. This "
5059
"function always succeeds."
5160
msgstr ""
61+
"如果 *ob* 是一個 cell 物件則回傳真值;*ob* 必須不為 ``NULL``。此函式總是會成"
62+
"功執行。"
5263

5364
#: ../../c-api/cell.rst:36
5465
msgid ""
5566
"Create and return a new cell object containing the value *ob*. The parameter "
5667
"may be ``NULL``."
57-
msgstr ""
68+
msgstr "建立並回傳一個包含 *ob* 的新 cell 物件。參數可以為 ``NULL``。"
5869

5970
#: ../../c-api/cell.rst:42
6071
msgid "Return the contents of the cell *cell*."
61-
msgstr "回傳 cell 內容中的 *cell*\\ 。"
72+
msgstr "回傳 cell 內容中的 *cell*。"
6273

6374
#: ../../c-api/cell.rst:47
6475
msgid ""
6576
"Return the contents of the cell *cell*, but without checking that *cell* is "
6677
"non-``NULL`` and a cell object."
6778
msgstr ""
79+
"回傳 cell 物件 *cell* 的內容,但是不檢查 *cell* 是否非 ``NULL`` 並且為一個 "
80+
"cell 物件。"
6881

6982
#: ../../c-api/cell.rst:53
7083
msgid ""
@@ -73,10 +86,15 @@ msgid ""
7386
"*cell* must be non-``NULL``; if it is not a cell object, ``-1`` will be "
7487
"returned. On success, ``0`` will be returned."
7588
msgstr ""
89+
"將 cell 物件 *cell* 的內容設為 *value*。這將釋放任何對 cell 物件當前內容的參"
90+
"照。*value* 可以為 ``NULL``。*cell* 必須不為 ``NULL``;如果它不是一個 cell 物"
91+
"件則將回傳 ``-1``。如果設定成功則將回傳 ``0``。"
7692

7793
#: ../../c-api/cell.rst:61
7894
msgid ""
7995
"Sets the value of the cell object *cell* to *value*. No reference counts "
8096
"are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` "
8197
"and must be a cell object."
8298
msgstr ""
99+
"將 cell 物件 *cell* 的值設為 *value*。不會調整參照計數,並且不會進行任何安全"
100+
"檢查;*cell* 必須為非 ``NULL`` 並且為一個 cell 物件。"

c-api/gen.po

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@
44
#
55
# Translators:
66
# Leon H., 2017
7+
# Matt Wang <[email protected]>, 2021
8+
#
79
msgid ""
810
msgstr ""
911
"Project-Id-Version: Python 3.11\n"
1012
"Report-Msgid-Bugs-To: \n"
1113
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
12-
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
13-
"Last-Translator: Leon H.\n"
14+
"PO-Revision-Date: 2022-10-16 15:33+0800\n"
15+
"Last-Translator: Matt Wang <[email protected]>\n"
1416
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1517
"tw)\n"
1618
"Language: zh_TW\n"
1719
"MIME-Version: 1.0\n"
1820
"Content-Type: text/plain; charset=UTF-8\n"
1921
"Content-Transfer-Encoding: 8bit\n"
2022
"Plural-Forms: nplurals=1; plural=0;\n"
23+
"X-Generator: Poedit 3.1.1\n"
2124

2225
#: ../../c-api/gen.rst:6
2326
msgid "Generator Objects"
24-
msgstr "產生器物件"
27+
msgstr "產生器 (Generator) 物件"
2528

2629
#: ../../c-api/gen.rst:8
2730
msgid ""
@@ -30,33 +33,42 @@ msgid ""
3033
"rather than explicitly calling :c:func:`PyGen_New` or :c:func:"
3134
"`PyGen_NewWithQualName`."
3235
msgstr ""
36+
"產生器物件是 Python 用來實現產生器疊代器 (generator iterator) 的物件。它們通"
37+
"常透過疊代會產生值的函式來建立,而不是顯式呼叫 :c:func:`PyGen_New` 或 :c:"
38+
"func:`PyGen_NewWithQualName`。"
3339

3440
#: ../../c-api/gen.rst:15
3541
msgid "The C structure used for generator objects."
36-
msgstr ""
42+
msgstr "用於產生器物件的 C 結構。"
3743

3844
#: ../../c-api/gen.rst:20
3945
msgid "The type object corresponding to generator objects."
40-
msgstr ""
46+
msgstr "與產生器物件對應的型別物件。"
4147

4248
#: ../../c-api/gen.rst:25
4349
msgid ""
4450
"Return true if *ob* is a generator object; *ob* must not be ``NULL``. This "
4551
"function always succeeds."
4652
msgstr ""
53+
"如果 *ob* 是一個產生器 (generator) 物件則回傳真值;*ob* 必須不為 ``NULL``。此"
54+
"函式總是會成功執行。"
4755

4856
#: ../../c-api/gen.rst:31
4957
msgid ""
5058
"Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be "
5159
"``NULL``. This function always succeeds."
5260
msgstr ""
61+
"如果 *ob* 的型別是 :c:type:`PyGen_Type` 則回傳真值;*ob* 必須不為 ``NULL``。"
62+
"此函式總是會成功執行。"
5363

5464
#: ../../c-api/gen.rst:37
5565
msgid ""
5666
"Create and return a new generator object based on the *frame* object. A "
5767
"reference to *frame* is stolen by this function. The argument must not be "
5868
"``NULL``."
5969
msgstr ""
70+
"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會取走一個對 *frame* 的"
71+
"參照 (reference)。引數必須不為 ``NULL``。"
6072

6173
#: ../../c-api/gen.rst:43
6274
msgid ""
@@ -65,3 +77,6 @@ msgid ""
6577
"to *frame* is stolen by this function. The *frame* argument must not be "
6678
"``NULL``."
6779
msgstr ""
80+
"基於 *frame* 物件建立並回傳一個新的產生器物件,其中 ``__name__`` 和 "
81+
"``__qualname__`` 設為 *name* 和 *qualname*。此函式會取走一個對 *frame* 的參"
82+
"照。*frame* 引數必須不為 ``NULL``。"

0 commit comments

Comments
 (0)