From d52f6dfc51942a948174088ed68354c734bef13c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sat, 11 May 2024 23:19:04 +0800 Subject: [PATCH] feat: translate `c-api/mapping.po` --- c-api/mapping.po | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/c-api/mapping.po b/c-api/mapping.po index b4e27a793c..8c028539d4 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Matt Wang , 2024 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-09-03 00:03+0000\n" -"PO-Revision-Date: 2018-05-23 14:32+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2024-05-11 14:32+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -27,6 +27,8 @@ msgid "" "See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and :c:func:" "`PyObject_DelItem`." msgstr "" +"另請參閱 :c:func:`PyObject_GetItem`、:c:func:`PyObject_SetItem` 和 :c:func:" +"`PyObject_DelItem`。" #: ../../c-api/mapping.rst:14 msgid "" @@ -36,12 +38,17 @@ msgid "" "to determine what type of keys the class supports. This function always " "succeeds." msgstr "" +"如果物件有提供對映協定或支援切片 (slicing) 則回傳 ``1``,否則回傳 ``0``。請注" +"意,對於具有 :meth:`~object.__getitem__` 方法的 Python 類別,它會回傳 ``1``," +"因為通常無法確定該類別支援什麼類型的鍵。這個函式總是成功的。" #: ../../c-api/mapping.rst:25 msgid "" "Returns the number of keys in object *o* on success, and ``-1`` on failure. " "This is equivalent to the Python expression ``len(o)``." msgstr "" +"成功時回傳物件 *o* 中的鍵數,失敗時回傳 ``-1``。這相當於 Python 運算式 " +"``len(o)``。" #: ../../c-api/mapping.rst:31 msgid "" @@ -49,6 +56,8 @@ msgid "" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" +"這與 :c:func:`PyObject_GetItem` 相同,但 *key* 被指定為 :c:expr:`const " +"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" #: ../../c-api/mapping.rst:38 msgid "" @@ -56,10 +65,12 @@ msgid "" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" +"這與 :c:func:`PyObject_SetItem` 相同,但 *key* 被指定為 :c:expr:`const " +"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" #: ../../c-api/mapping.rst:45 msgid "This is an alias of :c:func:`PyObject_DelItem`." -msgstr "" +msgstr "這是 :c:func:`PyObject_DelItem` 的別名。" #: ../../c-api/mapping.rst:50 msgid "" @@ -67,6 +78,8 @@ msgid "" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" +"這與 :c:func:`PyObject_DelItem` 相同,但 *key* 被指定為 :c:expr:`const " +"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" #: ../../c-api/mapping.rst:57 msgid "" @@ -74,6 +87,8 @@ msgid "" "This is equivalent to the Python expression ``key in o``. This function " "always succeeds." msgstr "" +"如果對映物件具有鍵 *key* 則回傳 ``1``,否則回傳 ``0``。這相當於 Python 運算" +"式 ``key in o``。這個函式總是成功的。" #: ../../c-api/mapping.rst:63 msgid "" @@ -81,6 +96,8 @@ msgid "" "are silently ignored. For proper error handling, use :c:func:" "`PyObject_GetItem()` instead." msgstr "" +"呼叫 :meth:`~object.__getitem__` 方法時發生的例外將被默默忽略。為了適當地處理" +"錯誤,請改用 :c:func:`PyObject_GetItem()`。" #: ../../c-api/mapping.rst:70 msgid "" @@ -88,6 +105,8 @@ msgid "" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" +"這與 :c:func:`PyMapping_HasKey` 相同,但 *key* 被指定為 :c:expr:`const " +"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" #: ../../c-api/mapping.rst:76 msgid "" @@ -95,29 +114,33 @@ msgid "" "while creating the temporary :class:`str` object are silently ignored. For " "proper error handling, use :c:func:`PyMapping_GetItemString` instead." msgstr "" +"呼叫 :meth:`~object.__getitem__` 方法或建立臨時 :class:`str` 物件時發生的例外" +"將默默忽略。為了適當地處理錯誤,請改用 :c:func:`PyMapping_GetItemString`。" #: ../../c-api/mapping.rst:84 msgid "" "On success, return a list of the keys in object *o*. On failure, return " "``NULL``." -msgstr "" +msgstr "成功時回傳包含物件 *o* 內之鍵的串列,失敗時回傳 ``NULL``。" #: ../../c-api/mapping.rst:87 ../../c-api/mapping.rst:96 #: ../../c-api/mapping.rst:105 msgid "Previously, the function returned a list or a tuple." -msgstr "" +msgstr "在以前,該函式會回傳串列或元組。" #: ../../c-api/mapping.rst:93 msgid "" "On success, return a list of the values in object *o*. On failure, return " "``NULL``." -msgstr "" +msgstr "成功時回傳物件 *o* 中值的串列。失敗時回傳 ``NULL``。" #: ../../c-api/mapping.rst:102 msgid "" "On success, return a list of the items in object *o*, where each item is a " "tuple containing a key-value pair. On failure, return ``NULL``." msgstr "" +"成功時回傳物件 *o* 內之項目的串列,其中每個項目都是包含鍵值對的元組。失敗時回" +"傳 ``NULL``。" #: ../../c-api/mapping.rst:23 msgid "built-in function"