Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions c-api/bytearray.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-08 15:25+0800\n"
"POT-Creation-Date: 2026-03-28 00:21+0000\n"
"PO-Revision-Date: 2023-08-12 11:42+0800\n"
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -61,62 +61,75 @@ msgstr "直接 API 函式"

#: ../../c-api/bytearray.rst:42
msgid ""
"Return a new bytearray object from any object, *o*, that implements "
"the :ref:`buffer protocol <bufferobjects>`."
"Return a new bytearray object from any object, *o*, that implements the :ref:"
"`buffer protocol <bufferobjects>`."
msgstr ""
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協定 (buffer "
"protocol) <bufferobjects>`。"

#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:52
#: ../../c-api/bytearray.rst:59
#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:56
#: ../../c-api/bytearray.rst:63
msgid "On failure, return ``NULL`` with an exception set."
msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。"

#: ../../c-api/bytearray.rst:50
#: ../../c-api/bytearray.rst:48 ../../c-api/bytearray.rst:66
msgid ""
"If the object implements the buffer protocol, then the buffer must not be "
"mutated while the bytearray object is being created."
msgstr ""

#: ../../c-api/bytearray.rst:54
msgid "Create a new bytearray object from *string* and its length, *len*."
msgstr "從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。"

#: ../../c-api/bytearray.rst:57
#: ../../c-api/bytearray.rst:61
msgid ""
"Concat bytearrays *a* and *b* and return a new bytearray with the result."
msgstr "連接位元組陣列 *a* 和 *b*,並回傳一個包含結果的新位元組陣列。"

#: ../../c-api/bytearray.rst:64
#: ../../c-api/bytearray.rst:72
msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer."
msgstr "在檢查為 ``NULL`` 指標後,回傳 *bytearray* 的大小。"

#: ../../c-api/bytearray.rst:69
#: ../../c-api/bytearray.rst:77
msgid ""
"Return the contents of *bytearray* as a char array after checking for a "
"``NULL`` pointer. The returned array always has an extra null byte appended."
msgstr ""
"在檢查是否為 ``NULL`` 指標後,將 *bytearray* 的內容回傳為字元陣列。回傳的陣列"
"總是會多附加一個空位元組。"

#: ../../c-api/bytearray.rst:76
#: ../../c-api/bytearray.rst:82 ../../c-api/bytearray.rst:104
msgid ""
"It is not thread-safe to mutate the bytearray object while using the "
"returned char array."
msgstr ""

#: ../../c-api/bytearray.rst:87
msgid ""
"Resize the internal buffer of *bytearray* to *len*. Failure is a ``-1`` "
"return with an exception set."
msgstr "將 *bytearray* 的內部緩衝區大小調整為 *len*。失敗時會回傳 ``-1`` 並設定例外。"
msgstr ""
"將 *bytearray* 的內部緩衝區大小調整為 *len*。失敗時會回傳 ``-1`` 並設定例外。"

#: ../../c-api/bytearray.rst:79
#: ../../c-api/bytearray.rst:90
msgid ""
"A negative *len* will now result in an exception being set and -1 returned."
msgstr "負的 *len* 現在會設定例外並回傳 -1。"

#: ../../c-api/bytearray.rst:84
#: ../../c-api/bytearray.rst:95
msgid "Macros"
msgstr "巨集"

#: ../../c-api/bytearray.rst:86
#: ../../c-api/bytearray.rst:97
msgid "These macros trade safety for speed and they don't check pointers."
msgstr "這些巨集犧牲了安全性以換取速度,並且它們不會檢查指標。"

#: ../../c-api/bytearray.rst:90
#: ../../c-api/bytearray.rst:101
msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking."
msgstr "與 :c:func:`PyByteArray_AsString` 類似,但沒有錯誤檢查。"

#: ../../c-api/bytearray.rst:95
#: ../../c-api/bytearray.rst:109
msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking."
msgstr "與 :c:func:`PyByteArray_Size` 類似,但沒有錯誤檢查。"

Expand Down
66 changes: 42 additions & 24 deletions c-api/bytes.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-01-22 16:55+0000\n"
"POT-Creation-Date: 2026-03-28 00:21+0000\n"
"PO-Revision-Date: 2018-05-23 14:04+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -245,15 +245,21 @@ msgid ""
"protocol."
msgstr ""

#: ../../c-api/bytes.rst:129
#: ../../c-api/bytes.rst:127
msgid ""
"If the object implements the buffer protocol, then the buffer must not be "
"mutated while the bytes object is being created."
msgstr ""

#: ../../c-api/bytes.rst:133
msgid "Return the length of the bytes in bytes object *o*."
msgstr ""

#: ../../c-api/bytes.rst:134
#: ../../c-api/bytes.rst:138
msgid "Similar to :c:func:`PyBytes_Size`, but without error checking."
msgstr "和 :c:func:`PyBytes_Size` 類似,但不進行錯誤檢查。"

#: ../../c-api/bytes.rst:139
#: ../../c-api/bytes.rst:143
msgid ""
"Return a pointer to the contents of *o*. The pointer refers to the internal "
"buffer of *o*, which consists of ``len(o) + 1`` bytes. The last byte in the "
Expand All @@ -264,24 +270,24 @@ msgid ""
"`PyBytes_AsString` returns ``NULL`` and raises :exc:`TypeError`."
msgstr ""

#: ../../c-api/bytes.rst:151
#: ../../c-api/bytes.rst:155
msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking."
msgstr "和 :c:func:`PyBytes_AsString` 類似,但不進行錯誤檢查。"

#: ../../c-api/bytes.rst:156
#: ../../c-api/bytes.rst:160
msgid ""
"Return the null-terminated contents of the object *obj* through the output "
"variables *buffer* and *length*. Returns ``0`` on success."
msgstr ""

#: ../../c-api/bytes.rst:160
#: ../../c-api/bytes.rst:164
msgid ""
"If *length* is ``NULL``, the bytes object may not contain embedded null "
"bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is "
"raised."
msgstr ""

#: ../../c-api/bytes.rst:164
#: ../../c-api/bytes.rst:168
msgid ""
"The buffer refers to an internal buffer of *obj*, which includes an "
"additional null byte at the end (not counted in *length*). The data must "
Expand All @@ -291,13 +297,13 @@ msgid ""
"returns ``-1`` and raises :exc:`TypeError`."
msgstr ""

#: ../../c-api/bytes.rst:171
#: ../../c-api/bytes.rst:175
msgid ""
"Previously, :exc:`TypeError` was raised when embedded null bytes were "
"encountered in the bytes object."
msgstr ""

#: ../../c-api/bytes.rst:178
#: ../../c-api/bytes.rst:182
msgid ""
"Create a new bytes object in *\\*bytes* containing the contents of *newpart* "
"appended to *bytes*; the caller will own the new reference. The reference "
Expand All @@ -306,37 +312,49 @@ msgid ""
"of *\\*bytes* will be set to ``NULL``; the appropriate exception will be set."
msgstr ""

#: ../../c-api/bytes.rst:187
#: ../../c-api/bytes.rst:189 ../../c-api/bytes.rst:199
msgid ""
"If *newpart* implements the buffer protocol, then the buffer must not be "
"mutated while the new bytes object is being created."
msgstr ""

#: ../../c-api/bytes.rst:194
msgid ""
"Create a new bytes object in *\\*bytes* containing the contents of *newpart* "
"appended to *bytes*. This version releases the :term:`strong reference` to "
"*newpart* (i.e. decrements its reference count)."
msgstr ""

#: ../../c-api/bytes.rst:194
#: ../../c-api/bytes.rst:205
msgid "Similar to ``sep.join(iterable)`` in Python."
msgstr "類似 Python 中的 ``sep.join(iterable)``。"

#: ../../c-api/bytes.rst:196
#: ../../c-api/bytes.rst:207
msgid ""
"*sep* must be Python :class:`bytes` object. (Note that :c:func:"
"`PyUnicode_Join` accepts ``NULL`` separator and treats it as a space, "
"whereas :c:func:`PyBytes_Join` doesn't accept ``NULL`` separator.)"
msgstr ""

#: ../../c-api/bytes.rst:201
#: ../../c-api/bytes.rst:212
msgid ""
"*iterable* must be an iterable object yielding objects that implement the :"
"ref:`buffer protocol <bufferobjects>`."
msgstr ""

#: ../../c-api/bytes.rst:204
#: ../../c-api/bytes.rst:215
msgid ""
"On success, return a new :class:`bytes` object. On error, set an exception "
"and return ``NULL``."
msgstr ""

#: ../../c-api/bytes.rst:212
#: ../../c-api/bytes.rst:221
msgid ""
"If *iterable* objects implement the buffer protocol, then the buffers must "
"not be mutated while the new bytes object is being created."
msgstr ""

#: ../../c-api/bytes.rst:226
msgid ""
"Resize a bytes object. *newsize* will be the new length of the bytes object. "
"You can think of it as creating a new bytes object and destroying the old "
Expand All @@ -348,19 +366,19 @@ msgid ""
"``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned."
msgstr ""

#: ../../c-api/bytes.rst:226
#: ../../c-api/bytes.rst:240
msgid ""
"Get the string representation of *bytes*. This function is currently used to "
"implement :meth:`!bytes.__repr__` in Python."
msgstr ""

#: ../../c-api/bytes.rst:229
#: ../../c-api/bytes.rst:243
msgid ""
"This function does not do type checking; it is undefined behavior to pass "
"*bytes* as a non-bytes object or ``NULL``."
msgstr ""

#: ../../c-api/bytes.rst:232
#: ../../c-api/bytes.rst:246
msgid ""
"If *smartquotes* is true, the representation will use a double-quoted string "
"instead of single-quoted string when single-quotes are present in *bytes*. "
Expand All @@ -369,33 +387,33 @@ msgid ""
"is false."
msgstr ""

#: ../../c-api/bytes.rst:238
#: ../../c-api/bytes.rst:252
msgid ""
"On success, this function returns a :term:`strong reference` to a :class:"
"`str` object containing the representation. On failure, this returns "
"``NULL`` with an exception set."
msgstr ""

#: ../../c-api/bytes.rst:245
#: ../../c-api/bytes.rst:259
msgid ""
"Unescape a backslash-escaped string *s*. *s* must not be ``NULL``. *len* "
"must be the size of *s*."
msgstr ""

#: ../../c-api/bytes.rst:248
#: ../../c-api/bytes.rst:262
msgid ""
"*errors* must be one of ``\"strict\"``, ``\"replace\"``, or ``\"ignore\"``. "
"If *errors* is ``NULL``, then ``\"strict\"`` is used by default."
msgstr ""

#: ../../c-api/bytes.rst:251
#: ../../c-api/bytes.rst:265
msgid ""
"On success, this function returns a :term:`strong reference` to a Python :"
"class:`bytes` object containing the unescaped string. On failure, this "
"function returns ``NULL`` with an exception set."
msgstr ""

#: ../../c-api/bytes.rst:255
#: ../../c-api/bytes.rst:269
msgid "*unicode* and *recode_encoding* are now unused."
msgstr ""

Expand Down
40 changes: 27 additions & 13 deletions c-api/file.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-01-15 00:15+0000\n"
"POT-Creation-Date: 2026-03-23 00:22+0000\n"
"PO-Revision-Date: 2023-04-24 20:38+0800\n"
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -192,52 +192,66 @@ msgstr ""
"`const char*`。"

#: ../../c-api/file.rst:124
#, fuzzy
msgid ""
"Write object *obj* to file object *p*. The only supported flag for *flags* "
"is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is "
"written instead of the :func:`repr`. Return ``0`` on success or ``-1`` on "
"failure; the appropriate exception will be set."
"written instead of the :func:`repr`."
msgstr ""
"將物件 *obj* 寫入檔案物件 *p*。 *flags* 唯一支援的旗標是 :c:macro:"
"`Py_PRINT_RAW`;如果有給定,則寫入物件的 :func:`str` 而不是 :func:`repr`。在"
"成功回傳 ``0`` 或在失敗回傳 ``-1``;將設定適當的例外。"

#: ../../c-api/file.rst:132
#: ../../c-api/file.rst:128
msgid "If *obj* is ``NULL``, write the string ``\"<NULL>\"``."
msgstr ""

#: ../../c-api/file.rst:130
#, fuzzy
msgid ""
"Return ``0`` on success or ``-1`` on failure; the appropriate exception will "
"be set."
msgstr ""
"寫入字串 *s* 到 檔案物件 *p*。當成功時回傳 0,而當失敗時回傳 -1,並會設定合適"
"的例外狀況。"

#: ../../c-api/file.rst:135
msgid ""
"Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on "
"failure; the appropriate exception will be set."
msgstr ""
"寫入字串 *s* 到 檔案物件 *p*。當成功時回傳 0,而當失敗時回傳 -1,並會設定合適"
"的例外狀況。"

#: ../../c-api/file.rst:137
#: ../../c-api/file.rst:140
msgid "Deprecated API"
msgstr "已棄用的 API"

#: ../../c-api/file.rst:140
#: ../../c-api/file.rst:143
msgid ""
"These are :term:`soft deprecated` APIs that were included in Python's C API "
"by mistake. They are documented solely for completeness; use other "
"``PyFile*`` APIs instead."
msgstr ""
"這些是被錯誤地包含在 Python C API 中的\\ :term:`軟性棄用 <soft deprecated>` API。它們僅為"
"了完整性而記錄於文件中;請改用其他 ``PyFile*`` API。"
"這些是被錯誤地包含在 Python C API 中的\\ :term:`軟性棄用 <soft deprecated>` "
"API。它們僅為了完整性而記錄於文件中;請改用其他 ``PyFile*`` API。"

#: ../../c-api/file.rst:146
#: ../../c-api/file.rst:149
msgid ""
"Use :c:func:`PyFile_FromFd` with defaults (``fd, NULL, \"w\", -1, NULL, "
"NULL, NULL, 0``) instead."
msgstr ""
"請改用帶有預設值 (``fd, NULL, \"w\", -1, NULL, NULL, NULL, 0``) 的 :c:func:`PyFile_FromFd`。"
"請改用帶有預設值 (``fd, NULL, \"w\", -1, NULL, NULL, NULL, 0``) 的 :c:func:"
"`PyFile_FromFd`。"

#: ../../c-api/file.rst:150
#: ../../c-api/file.rst:153
msgid ""
"Type of file-like objects used internally at Python startup when :py:mod:"
"`io` is not yet available. Use Python :py:func:`open` or :c:func:"
"`PyFile_FromFd` to create file objects instead."
msgstr ""
"在 Python 啟動期間,當 :py:mod:`io` 尚不可用時會在內部使用的類檔案物件的型別。請改用 "
"Python :py:func:`open` 或 :c:func:`PyFile_FromFd` 來建立檔案物件。"
"在 Python 啟動期間,當 :py:mod:`io` 尚不可用時會在內部使用的類檔案物件的型"
"別。請改用 Python :py:func:`open` 或 :c:func:`PyFile_FromFd` 來建立檔案物件。"

#: ../../c-api/file.rst:8
msgid "object"
Expand Down
Loading
Loading