diff --git a/c-api/allocation.po b/c-api/allocation.po index 5a4e73f4fb..bd495ced73 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -3,13 +3,16 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Liang-Bo Wang , 2016 +# Matt Wang , 2021 +# msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-07-06 00:17+0000\n" -"PO-Revision-Date: 2016-01-31 07:06+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2022-10-16 15:35+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,10 +20,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1.1\n" #: ../../c-api/allocation.rst:6 msgid "Allocating Objects on the Heap" -msgstr "" +msgstr "在 heap 上分配物件" #: ../../c-api/allocation.rst:17 msgid "" @@ -30,12 +34,17 @@ msgid "" "detector's set of observed objects. Other fields of the object are not " "affected." msgstr "" +"用它的型別和初始參照來初始化新分配物件 *op*。已初始化的物件會被回傳。如果 " +"*type* 表示了該物件參與迴圈垃圾檢查器,則將其新增到檢查器的觀察物件集合中。物" +"件的其他欄位不受影響。" #: ../../c-api/allocation.rst:26 msgid "" "This does everything :c:func:`PyObject_Init` does, and also initializes the " "length information for a variable-size object." msgstr "" +"它會做到 :c:func:`PyObject_Init` 的所有功能,並且會初始化一個大小可變物件的長" +"度資訊。" #: ../../c-api/allocation.rst:32 msgid "" @@ -45,6 +54,10 @@ msgid "" "the memory allocation is determined from the :c:member:`~PyTypeObject." "tp_basicsize` field of the type object." msgstr "" +"使用 C 結構型別 *TYPE* 和 Python 型別物件 *type* 分配一個新的 Python 物件。未" +"在該 Python 物件標頭 (header) 中定義的欄位不會被初始化;物件的參照計數將為" +"一。記憶體分配大小由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位" +"來指定。" #: ../../c-api/allocation.rst:41 msgid "" @@ -57,6 +70,12 @@ msgid "" "Embedding the array of fields into the same allocation decreases the number " "of allocations, improving the memory management efficiency." msgstr "" +"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *type* 分配一個新的 Python 物" +"件。未在該 Python 物件標頭中定義的欄位不會被初始化。記憶體空間預留了 *TYPE* " +"結構大小再加上 *type* 物件中 :c:member:`~PyTypeObject.tp_itemsize` 欄位提供" +"的 *size* 欄位的值。這對於實現如 tuple 這種能夠在建立期間決定自己大小的物件是" +"很實用的。將欄位的陣列嵌入到相同的記憶體分配中可以減少記憶體分配的次數,這提" +"高了記憶體管理的效率。" #: ../../c-api/allocation.rst:53 msgid "" @@ -66,6 +85,10 @@ msgid "" "fields of the object should not be accessed after this call as the memory is " "no longer a valid Python object." msgstr "" +"釋放由 :c:func:`PyObject_New` 或者 :c:func:`PyObject_NewVar` 分配給物件的記憶" +"體。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` handler " +"中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的記憶體已" +"不再是一個有效的 Python 物件。" #: ../../c-api/allocation.rst:62 msgid "" @@ -73,6 +96,8 @@ msgid "" "using the :c:macro:`Py_None` macro, which evaluates to a pointer to this " "object." msgstr "" +"這個物件像是 Python 中的 ``None``。它只應該透過 :c:macro:`Py_None` 巨集來存" +"取,該巨集的拿到指向該物件的指標。" #: ../../c-api/allocation.rst:69 msgid ":c:func:`PyModule_Create`" @@ -80,4 +105,4 @@ msgstr ":c:func:`PyModule_Create`" #: ../../c-api/allocation.rst:70 msgid "To allocate and create extension modules." -msgstr "" +msgstr "分配記憶體和建立擴充模組。" diff --git a/c-api/cell.po b/c-api/cell.po index 3a4a0ab354..9a9614a074 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -5,13 +5,15 @@ # Translators: # aminzai , 2015 # Liang-Bo Wang , 2015 +# Matt Wang , 2021 +# msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2022-10-16 15:33+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -19,6 +21,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1.1\n" #: ../../c-api/cell.rst:6 msgid "Cell Objects" @@ -35,10 +38,16 @@ msgid "" "support from the generated byte-code; these are not automatically de-" "referenced when accessed. Cell objects are not likely to be useful elsewhere." msgstr "" +"\"Cell\" 物件用於實現被多個作用域所參照 (reference) 的變數。對於每個這樣的變" +"數,都會有個 cell 物件為了儲存該值而被建立;參照該值的每個 stack frame 中的區" +"域性變數包含外部作用域的 cell 參照,它同樣使用了該變數。存取該值時,將使用 " +"cell 中包含的值而不是 cell 物件本身。這種對 cell 物件的去除參照 (de-" +"reference) 需要生成的位元組碼 (byte-code) 有支援;存取時不會自動去除參照。" +"cell 物件在其他地方可能不太有用。" #: ../../c-api/cell.rst:20 msgid "The C structure used for cell objects." -msgstr "C 結構的 cell 物件" +msgstr "Cell 物件所用之 C 結構。" #: ../../c-api/cell.rst:25 msgid "The type object corresponding to cell objects." @@ -49,22 +58,26 @@ msgid "" "Return true if *ob* is a cell object; *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" +"如果 *ob* 是一個 cell 物件則回傳真值;*ob* 必須不為 ``NULL``。此函式總是會成" +"功執行。" #: ../../c-api/cell.rst:36 msgid "" "Create and return a new cell object containing the value *ob*. The parameter " "may be ``NULL``." -msgstr "" +msgstr "建立並回傳一個包含 *ob* 的新 cell 物件。參數可以為 ``NULL``。" #: ../../c-api/cell.rst:42 msgid "Return the contents of the cell *cell*." -msgstr "回傳 cell 內容中的 *cell*\\ 。" +msgstr "回傳 cell 內容中的 *cell*。" #: ../../c-api/cell.rst:47 msgid "" "Return the contents of the cell *cell*, but without checking that *cell* is " "non-``NULL`` and a cell object." msgstr "" +"回傳 cell 物件 *cell* 的內容,但是不檢查 *cell* 是否非 ``NULL`` 並且為一個 " +"cell 物件。" #: ../../c-api/cell.rst:53 msgid "" @@ -73,6 +86,9 @@ msgid "" "*cell* must be non-``NULL``; if it is not a cell object, ``-1`` will be " "returned. On success, ``0`` will be returned." msgstr "" +"將 cell 物件 *cell* 的內容設為 *value*。這將釋放任何對 cell 物件當前內容的參" +"照。*value* 可以為 ``NULL``。*cell* 必須不為 ``NULL``;如果它不是一個 cell 物" +"件則將回傳 ``-1``。如果設定成功則將回傳 ``0``。" #: ../../c-api/cell.rst:61 msgid "" @@ -80,3 +96,5 @@ msgid "" "are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` " "and must be a cell object." msgstr "" +"將 cell 物件 *cell* 的值設為 *value*。不會調整參照計數,並且不會進行任何安全" +"檢查;*cell* 必須為非 ``NULL`` 並且為一個 cell 物件。" diff --git a/c-api/gen.po b/c-api/gen.po index 10f9a83833..cdf17a01e5 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -4,13 +4,15 @@ # # Translators: # Leon H., 2017 +# Matt Wang , 2021 +# msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-09-13 00:11+0000\n" -"PO-Revision-Date: 2017-09-22 18:26+0000\n" -"Last-Translator: Leon H.\n" +"PO-Revision-Date: 2022-10-16 15:33+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -18,10 +20,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1.1\n" #: ../../c-api/gen.rst:6 msgid "Generator Objects" -msgstr "產生器物件" +msgstr "產生器 (Generator) 物件" #: ../../c-api/gen.rst:8 msgid "" @@ -30,26 +33,33 @@ msgid "" "rather than explicitly calling :c:func:`PyGen_New` or :c:func:" "`PyGen_NewWithQualName`." msgstr "" +"產生器物件是 Python 用來實現產生器疊代器 (generator iterator) 的物件。它們通" +"常透過疊代會產生值的函式來建立,而不是顯式呼叫 :c:func:`PyGen_New` 或 :c:" +"func:`PyGen_NewWithQualName`。" #: ../../c-api/gen.rst:15 msgid "The C structure used for generator objects." -msgstr "" +msgstr "用於產生器物件的 C 結構。" #: ../../c-api/gen.rst:20 msgid "The type object corresponding to generator objects." -msgstr "" +msgstr "與產生器物件對應的型別物件。" #: ../../c-api/gen.rst:25 msgid "" "Return true if *ob* is a generator object; *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" +"如果 *ob* 是一個產生器 (generator) 物件則回傳真值;*ob* 必須不為 ``NULL``。此" +"函式總是會成功執行。" #: ../../c-api/gen.rst:31 msgid "" "Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be " "``NULL``. This function always succeeds." msgstr "" +"如果 *ob* 的型別是 :c:type:`PyGen_Type` 則回傳真值;*ob* 必須不為 ``NULL``。" +"此函式總是會成功執行。" #: ../../c-api/gen.rst:37 msgid "" @@ -57,6 +67,8 @@ msgid "" "reference to *frame* is stolen by this function. The argument must not be " "``NULL``." msgstr "" +"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會取走一個對 *frame* 的" +"參照 (reference)。引數必須不為 ``NULL``。" #: ../../c-api/gen.rst:43 msgid "" @@ -65,3 +77,6 @@ msgid "" "to *frame* is stolen by this function. The *frame* argument must not be " "``NULL``." msgstr "" +"基於 *frame* 物件建立並回傳一個新的產生器物件,其中 ``__name__`` 和 " +"``__qualname__`` 設為 *name* 和 *qualname*。此函式會取走一個對 *frame* 的參" +"照。*frame* 引數必須不為 ``NULL``。"