From bd9007640caf1a32154d8004558408214a8edfe3 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Thu, 24 Aug 2023 00:57:50 +0800 Subject: [PATCH] feat: translate `c-api/list.po` --- c-api/list.po | 53 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/c-api/list.po b/c-api/list.po index b5fb0dd15f..ed430f77a6 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -1,16 +1,16 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Nkeys Syu , 2016 +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2023-03-03 20:35+0800\n" -"Last-Translator: Nkeys Syu \n" +"PO-Revision-Date: 2023-08-24 00:55+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -26,20 +26,22 @@ msgstr "List(串列)物件" #: ../../c-api/list.rst:13 msgid "This subtype of :c:type:`PyObject` represents a Python list object." -msgstr "" +msgstr ":c:type:`PyObject` 的這個子型別表示 Python 的 list(串列)物件。" #: ../../c-api/list.rst:18 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python list type. " "This is the same object as :class:`list` in the Python layer." msgstr "" +"此 :c:type:`PyTypeObject` 實例表示 Python 的 list 型別。這與 Python 層中的 :" +"class:`list` 是同一個物件。" #: ../../c-api/list.rst:24 msgid "" "Return true if *p* is a list object or an instance of a subtype of the list " "type. This function always succeeds." msgstr "" -"如果 *p* 是一個 list 物件或者是 list 型別的子型別的實例,就回傳 true。這個函" +"如果 *p* 是一個 list 物件或者是 list 型別之子型別的實例,就回傳 true。這個函" "式永遠會成功執行。" #: ../../c-api/list.rst:30 @@ -52,7 +54,7 @@ msgstr "" #: ../../c-api/list.rst:36 msgid "Return a new list of length *len* on success, or ``NULL`` on failure." -msgstr "" +msgstr "成功時回傳長度為 *len* 的新串列,失敗時回傳 ``NULL``。" #: ../../c-api/list.rst:40 msgid "" @@ -61,12 +63,16 @@ msgid "" "`PySequence_SetItem` or expose the object to Python code before setting all " "items to a real object with :c:func:`PyList_SetItem`." msgstr "" +"如果 *len* 大於零,則回傳的串列物件之項目將被設定為 ``NULL``。因此,在使用 :" +"c:func:`PyList_SetItem` 來將所有項目設定為一個真實物件前,你無法使用像是 :c:" +"func:`PySequence_SetItem` 的使用抽象 API 函式,也不能將物件暴露 (expose) 給 " +"Python 程式碼。" #: ../../c-api/list.rst:50 msgid "" "Return the length of the list object in *list*; this is equivalent to " "``len(list)`` on a list object." -msgstr "" +msgstr "回傳 *list* 串列物件的長度;這相當於串列物件的 ``len(list)``。" #: ../../c-api/list.rst:56 msgid "Similar to :c:func:`PyList_Size`, but without error checking." @@ -79,10 +85,13 @@ msgid "" "supported. If *index* is out of bounds (<0 or >=len(list)), return ``NULL`` " "and set an :exc:`IndexError` exception." msgstr "" +"回傳 *list* 指向的串列中位於 *index* 位置的物件。該位置不可為負數;並不支援從" +"串列尾末開始索引。如果 *index* 超出邊界範圍(<0 或 >=len(list))則回傳 " +"``NULL`` 並設定 :exc:`IndexError` 例外。" #: ../../c-api/list.rst:69 msgid "Similar to :c:func:`PyList_GetItem`, but without error checking." -msgstr "" +msgstr "與 :c:func:`PyList_GetItem` 類似,但沒有錯誤檢查。" #: ../../c-api/list.rst:74 msgid "" @@ -90,18 +99,23 @@ msgid "" "If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` " "exception." msgstr "" +"將串列中索引 *index* 處的項目設定為 *item*。成功時回傳 ``0``。如果 *index* 超" +"出邊界範圍則回傳 ``-1`` 並設定一個 :exc:`IndexError` 例外。" #: ../../c-api/list.rst:80 msgid "" "This function \"steals\" a reference to *item* and discards a reference to " "an item already in the list at the affected position." msgstr "" +"此函式「竊取」對 *item* 的參照,並丟棄對串列中受影響位置上已存在項目的參照。" #: ../../c-api/list.rst:86 msgid "" "Macro form of :c:func:`PyList_SetItem` without error checking. This is " "normally only used to fill in new lists where there is no previous content." msgstr "" +":c:func:`PyList_SetItem` 的巨集形式,沒有錯誤檢查。這通常僅用於填充沒有已存在" +"內容的新串列。" #: ../../c-api/list.rst:91 msgid "" @@ -109,6 +123,9 @@ msgid "" "`PyList_SetItem`, does *not* discard a reference to any item that is being " "replaced; any reference in *list* at position *i* will be leaked." msgstr "" +"該巨集「竊取」對 *item* 的參照,並且與 :c:func:`PyList_SetItem` 不同的是,它" +"\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* 中位置 *i* 的任何參照都將被洩" +"漏 (leak)。" #: ../../c-api/list.rst:99 msgid "" @@ -116,6 +133,9 @@ msgid "" "``0`` if successful; return ``-1`` and set an exception if unsuccessful. " "Analogous to ``list.insert(index, item)``." msgstr "" +"將項目 *item* 插入串列 *list* 中索引 *index* 的位置之前。如果成功則回傳 " +"``0``;如果失敗則回傳 ``-1`` 並設定例外。類似於 ``list.insert(index, " +"item)``。" #: ../../c-api/list.rst:106 msgid "" @@ -123,6 +143,8 @@ msgid "" "successful; return ``-1`` and set an exception if unsuccessful. Analogous " "to ``list.append(item)``." msgstr "" +"將物件 *item* 附加到串列 *list* 的最後面。如果成功則回傳 ``0``;如果不成功," +"則回傳 ``-1`` 並設定例外。類似於 ``list.append(item)``。" #: ../../c-api/list.rst:113 msgid "" @@ -131,6 +153,9 @@ msgid "" "Analogous to ``list[low:high]``. Indexing from the end of the list is not " "supported." msgstr "" +"回傳 *list* 中的物件串列,其中包含 *low* 和 *high* *之間*\\ 的物件。如果沒有" +"成功則回傳 ``NULL`` 並設定例外。類似於 ``list[low:high]``。不支援從串列尾末開" +"始索引。" #: ../../c-api/list.rst:120 msgid "" @@ -140,24 +165,34 @@ msgid "" "Return ``0`` on success, ``-1`` on failure. Indexing from the end of the " "list is not supported." msgstr "" +"將 *low* 和 *high* 之間的 *list* 切片設定為 *itemlist* 的內容。類似於 " +"``list[low:high] = itemlist``。*itemlist* 可能為 ``NULL``,表示分配一個空串列" +"(切片刪除)。成功時回傳 ``0``,失敗時則回傳 ``-1``。不支援從串列尾末開始索" +"引。" #: ../../c-api/list.rst:129 msgid "" "Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is equivalent to ``list.sort()``." msgstr "" +"對 *list* 的項目進行原地 (in place) 排序。成功時回傳 ``0``,失敗時回傳 " +"``-1``。這相當於 ``list.sort()``。" #: ../../c-api/list.rst:135 msgid "" "Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is the equivalent of ``list.reverse()``." msgstr "" +"原地反轉 *list* 的項目。成功時回傳 ``0``,失敗時回傳 ``-1``。這相當於 ``list." +"reverse()``。" #: ../../c-api/list.rst:143 msgid "" "Return a new tuple object containing the contents of *list*; equivalent to " "``tuple(list)``." msgstr "" +"回傳一個新的 tuple(元組)物件,其中包含 *list* 的內容;相當於 " +"``tuple(list)``。" #: ../../c-api/list.rst:8 msgid "object"