From 27d588fe1895903698b6691ab440383aafeefd59 Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Sat, 1 Jul 2023 04:35:02 +0800 Subject: [PATCH] feat: translate `c-api/objbuffer.po` --- c-api/objbuffer.po | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/c-api/objbuffer.po b/c-api/objbuffer.po index d33b13eb8b..ccf7fed887 100644 --- a/c-api/objbuffer.po +++ b/c-api/objbuffer.po @@ -3,13 +3,15 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Liang-Bo Wang , 2015 +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2015-12-09 17:51+0000\n" -"Last-Translator: Liang-Bo Wang \n" +"PO-Revision-Date: 2023-07-01 04: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" @@ -17,6 +19,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.3.2\n" #: ../../c-api/objbuffer.rst:4 msgid "Old Buffer Protocol" @@ -31,6 +34,10 @@ msgid "" "you control over the lifetime of the resources acquired when a buffer is " "exported." msgstr "" +"這些函式是 Python 2 中「舊式緩衝區協定」API 的一部分。在 Python 3 中,該協議" +"已經不存在,但這些函式仍有公開以供移植 2.x 程式碼。它們充當\\ :ref:`新式緩衝" +"區協定 `\\ 的相容性包裝器,但它們無法讓你控制匯出 (export) 緩" +"衝區時所獲取資源的生命週期。" #: ../../c-api/objbuffer.rst:15 msgid "" @@ -39,6 +46,10 @@ msgid "" "`PyArg_ParseTuple` family of functions) to get a buffer view over an object, " "and :c:func:`PyBuffer_Release` when the buffer view can be released." msgstr "" +"因此,建議你呼叫 :c:func:`PyObject_GetBuffer` (或是以 ``y*`` 或 ``w*`` :ref:" +"`格式碼 (format code) ` 呼叫 :c:func:`PyArg_ParseTuple` 系列函" +"式)獲取物件的緩衝區視圖 (buffer view),以及緩衝區視圖可被釋放時呼叫 :c:func:" +"`PyBuffer_Release` 。" #: ../../c-api/objbuffer.rst:23 msgid "" @@ -48,6 +59,10 @@ msgid "" "and *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:" "`TypeError` on error." msgstr "" +"回傳一個指向可用作基於字元輸入之唯讀記憶體位置的指標。 *obj* 引數必須支援單一" +"片段 (single-segment) 字元緩衝區介面。成功時回傳 ``0``,並將 *buffer* 設定為" +"記憶體位置、將 *buffer_len* 設定為緩衝區長度。回傳 ``-1`` 並在錯誤時設定 :" +"exc:`TypeError`。" #: ../../c-api/objbuffer.rst:32 msgid "" @@ -57,12 +72,17 @@ msgid "" "and *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:" "`TypeError` on error." msgstr "" +"回傳一個指向包含任意資料之唯讀記憶體位置的指標。*obj* 引數必須支援單一片段可" +"讀緩衝區介面。成功時回傳 ``0``,並將 *buffer* 設定為記憶體位置、將 " +"*buffer_len* 設定為緩衝區長度。回傳 ``-1`` 並在錯誤時設定 :exc:`TypeError`。" #: ../../c-api/objbuffer.rst:41 msgid "" "Returns ``1`` if *o* supports the single-segment readable buffer interface. " "Otherwise returns ``0``. This function always succeeds." msgstr "" +"如果 *o* 支援單一片段可讀緩衝區介面,則回傳 ``1``,否則回傳 ``0``。這個函式一" +"定會執行成功的。" #: ../../c-api/objbuffer.rst:44 msgid "" @@ -70,6 +90,8 @@ msgid "" "which occur while calling corresponding functions will get suppressed. To " "get error reporting use :c:func:`PyObject_GetBuffer()` instead." msgstr "" +"請注意,該函式嘗試獲取和釋放緩衝區,並且呼叫相應函式時發生的例外將被抑制。要" +"獲取錯誤報告,請改用 :c:func:`PyObject_GetBuffer()`。" #: ../../c-api/objbuffer.rst:51 msgid "" @@ -78,3 +100,6 @@ msgid "" "``0``, sets *buffer* to the memory location and *buffer_len* to the buffer " "length. Returns ``-1`` and sets a :exc:`TypeError` on error." msgstr "" +"回傳指向可寫記憶體位置的指標。 *obj* 引數必須支援單一片段字元緩衝區介面。成功" +"時回傳 ``0``,並將 *buffer* 設定為記憶體位置,且將 *buffer_len* 設定為緩衝區" +"長度。回傳 ``-1`` 並在錯誤時設定 :exc:`TypeError`。"