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
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ make progress # Check translation progress
### reST Syntax
- Preserve `:mod:`, `:func:`, `:class:`, `:term:`, `:ref:`, `:pep:` roles
- Use `\\ ` as zero-width separator when Chinese precedes reST syntax
- `\\ ` is also required when a role/literal/emphasis close is immediately followed by an
**opening** full-width punctuation mark (`(`, `「`, `『`) — confirmed by corpus-wide grep:
~1 unescaped vs ~473 escaped occurrences. Example: `` :class:`Widget`\\ ( ``.
- `\\ ` is **not** needed before **closing/medial** full-width punctuation (`。`, `,`, `:`,
`;`, `!`, `?`, `」`, `』`, `)`) — this is the dominant, unescaped, CI-passing convention
throughout the corpus (thousands of unescaped examples vs. a handful of escaped outliers).
Do not add `\\ ` there even if it looks visually similar to the open-paren case.

## Key Resources

Expand Down
5 changes: 1 addition & 4 deletions c-api/buffer.po
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,8 @@ msgid ""
msgstr ""

#: ../../c-api/buffer.rst:266
#, fuzzy
msgid "This is an alias to :c:macro:`PyBUF_WRITABLE`."
msgstr ""
"這是 :c:macro:`PyBUF_WRITABLE` 的\\ :term:`軟性棄用 <soft deprecated>`\\ 別"
"名。"
msgstr "此為 :c:macro:`PyBUF_WRITABLE` 的別名。"

#: ../../c-api/buffer.rst:272
msgid ""
Expand Down
4 changes: 4 additions & 0 deletions c-api/bytes.po
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ msgid ""
"\"stolen\", the value of *\\*bytes* will be set to ``NULL``, and the "
"appropriate exception will be set."
msgstr ""
"在 *\\*bytes* 中建立一個新的 bytes 物件,其內容為 *newpart* 附加到 *bytes* 之"
"後的結果;呼叫者將擁有新的參照。*bytes* 舊值的參照將被「:term:`竊取 "
"<steal>`」。如果無法建立新物件,*bytes* 的舊參照仍將被「竊取」,*\\*bytes* 的"
"值將被設為 ``NULL``,並會設定適當的例外。"

#: ../../c-api/bytes.rst:190 ../../c-api/bytes.rst:200
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion c-api/code.po
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ msgstr ""

#: ../../c-api/code.rst:217
msgid "This is a function that does nothing."
msgstr ""
msgstr "此函式不執行任何操作。"

#: ../../c-api/code.rst:219
msgid ""
Expand Down
3 changes: 3 additions & 0 deletions c-api/dict.po
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ msgid ""
"on success or ``-1`` on failure. This function *does not* \":term:`steal`\" "
"a reference to *val*."
msgstr ""
"以 *key* 為鍵,將 *val* 插入至字典 *p* 中。*key* 必須是\\ :term:`可雜湊的 "
"<hashable>`,否則將引發 :exc:`TypeError`。成功時回傳 ``0``,失敗時回傳 "
"``-1``。此函式\\ *不會*\\ 「:term:`竊取 <steal>`」對 *val* 的參照。"

#: ../../c-api/dict.rst:103
msgid ""
Expand Down
13 changes: 13 additions & 0 deletions c-api/exceptions.po
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ msgid ""
"This call \":term:`steals <steal>`\" a reference to *exc*, which must be a "
"valid exception."
msgstr ""
"此呼叫「:term:`竊取 <steal>`」對 *exc* 的參照,*exc* 必須為一個有效的例外。"

#: ../../c-api/exceptions.rst:516
msgid "Use :c:func:`PyErr_GetRaisedException` instead."
Expand Down Expand Up @@ -699,6 +700,10 @@ msgid ""
"arguments. This function is kept for backwards compatibility. Prefer using :"
"c:func:`PyErr_SetHandledException`."
msgstr ""
"設定例外資訊,如同從 ``sys.exc_info()`` 得知的資訊一般。這裡指的是一個 *已經"
"被捕捉* 的例外,而不是剛被引發的例外。此函式「:term:`竊取 <steal>`」這些引數"
"的參照。若要清除例外狀態,請為所有三個引數傳入 ``NULL``。此函式是為了向後相容"
"而保留,建議改用 :c:func:`PyErr_SetHandledException`。"

#: ../../c-api/exceptions.rst:653
msgid ""
Expand All @@ -715,6 +720,9 @@ msgid ""
"argument). The function still \":term:`steals <steal>`\" references of all "
"three arguments."
msgstr ""
"引數 ``type`` 和 ``traceback`` 已不再使用,可以為 NULL。直譯器現在會從例外實"
"例(引數 ``value``)中衍生出它們。此函式仍會「:term:`竊取 <steal>`」所有三個"
"引數的參照。"

#: ../../c-api/exceptions.rst:668
msgid "Signal Handling"
Expand Down Expand Up @@ -933,6 +941,8 @@ msgid ""
"clear it. There is no type check to make sure that *ctx* is an exception "
"instance. This \":term:`steals <steal>`\" a reference to *ctx*."
msgstr ""
"將與該例外關聯的情境設定為 *ctx*。使用 ``NULL`` 來清除它。這裡不會檢查型別以"
"確保 *ctx* 是一個例外實例。此函式「:term:`竊取 <steal>`」對 *ctx* 的參照。"

#: ../../c-api/exceptions.rst:861
msgid ""
Expand All @@ -949,6 +959,9 @@ msgid ""
"exception instance or ``None``. This \":term:`steals <steal>`\" a reference "
"to *cause*."
msgstr ""
"將與該例外關聯的成因設定為 *cause*。使用 ``NULL`` 來清除它。這裡不會檢查型別"
"以確保 *cause* 是一個例外實例或 ``None``。此函式「:term:`竊取 <steal>`」對 "
"*cause* 的參照。"

#: ../../c-api/exceptions.rst:874
msgid ""
Expand Down
20 changes: 8 additions & 12 deletions c-api/gen.po
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,25 @@ msgstr ""
"此函式總是會成功執行。"

#: ../../c-api/gen.rst:37
#, fuzzy
msgid ""
"Create and return a new generator object based on the *frame* object. A "
"reference to *frame* is \":term:`stolen <steal>`\" by this function (even on "
"error). The argument must not be ``NULL``."
msgstr ""
"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會取走一個對 *frame* 的"
"參照 (reference)。引數必須不為 ``NULL``。"
"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會「:term:`竊取 "
"<steal>`」對 *frame* 的一個參照(即使發生錯誤也一樣)。引數必須不為 "
"``NULL``。"

#: ../../c-api/gen.rst:43
#, fuzzy
msgid ""
"Create and return a new generator object based on the *frame* object, with "
"``__name__`` and ``__qualname__`` set to *name* and *qualname*. A reference "
"to *frame* is \":term:`stolen <steal>`\" by this function (even on error). "
"The *frame* argument must not be ``NULL``."
msgstr ""
"基於 *frame* 物件建立並回傳一個新的產生器物件,其中 ``__name__`` 和 "
"``__qualname__`` 設為 *name* 和 *qualname*。此函式會取走一個對 *frame* 的參"
"。*frame* 引數必須不為 ``NULL``。"
"``__qualname__`` 設為 *name* 和 *qualname*。此函式會「:term:`竊取 <steal>`」"
"對 *frame* 的一個參照(即使發生錯誤也一樣)。*frame* 引數必須不為 ``NULL``。"

#: ../../c-api/gen.rst:51
msgid ""
Expand All @@ -107,14 +106,14 @@ msgstr ""
"AsyncGeneratorType` 使用。"

#: ../../c-api/gen.rst:70
#, fuzzy
msgid ""
"Create a new asynchronous generator wrapping *frame*, with ``__name__`` and "
"``__qualname__`` set to *name* and *qualname*. *frame* is \":term:`stolen "
"<steal>`\" by this function (even on error) and must not be ``NULL``."
msgstr ""
"建立一個包裝 *frame* 的非同步產生器,並將 ``__name__`` 和 ``__qualname__`` 設"
"為 *name* 和 *qualname*。*frame* 會被此函式取走,且不得為 ``NULL``。"
"為 *name* 和 *qualname*。*frame* 會被此函式「:term:`竊取 <steal>`」(即使發生"
"錯誤也一樣),且不得為 ``NULL``。"

#: ../../c-api/gen.rst:75
msgid ""
Expand All @@ -138,11 +137,8 @@ msgid "Deprecated API"
msgstr "已棄用的 API"

#: ../../c-api/gen.rst:94
#, fuzzy
msgid "This is an API that was included in Python's C API by mistake."
msgstr ""
"這是一個被\\ :term:`軟性棄用 <soft deprecated>`\\ 的 API,它被錯誤地包含在 "
"Python 的 C API 中。"
msgstr "這是一個被錯誤地包含在 Python 的 C API 中的 API。"

#: ../../c-api/gen.rst:97
msgid "It is solely here for completeness; do not use this API."
Expand Down
2 changes: 2 additions & 0 deletions c-api/init_config.po
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,8 @@ msgid ""
"The function now replaces :data:`sys.flags` (create a new object), instead "
"of modifying :data:`sys.flags` in-place."
msgstr ""
"此函式現在會取代 :data:`sys.flags`\\(建立新物件),而非原地修改 :data:`sys."
"flags`。"

#: ../../c-api/init_config.rst:634
msgid "PyConfig C API"
Expand Down
19 changes: 8 additions & 11 deletions c-api/intro.po
Original file line number Diff line number Diff line change
Expand Up @@ -773,20 +773,16 @@ msgid "Consider using the C99 standard suffixes ``LL`` and ``LLU`` directly."
msgstr ""

#: ../../c-api/intro.rst:511
#, fuzzy
msgid "This is an alias to :c:func:`!memcpy`."
msgstr "這現在是 ``va_copy`` 的別名。"
msgstr "此為 :c:func:`!memcpy` 的別名。"

#: ../../c-api/intro.rst:513
msgid "Use :c:func:`!memcpy` directly instead."
msgstr ""
msgstr "請直接使用 :c:func:`!memcpy`。"

#: ../../c-api/intro.rst:518
#, fuzzy
msgid "This is an alias to the C99-standard ``va_copy`` function."
msgstr ""
"這是 C99 標準 ``va_copy`` 函式的已\\ :term:`軟性棄用 <soft deprecated>`\\ 別"
"名。"
msgstr "此為 C99 標準 ``va_copy`` 函式的別名。"

#: ../../c-api/intro.rst:520
msgid ""
Expand Down Expand Up @@ -983,15 +979,13 @@ msgstr ""
"照 <borrowed reference>`\\ 就不需要做任何事情。"

#: ../../c-api/intro.rst:642
#, fuzzy
msgid ""
"Conversely, when a calling function passes in a reference to an object, "
"there are two possibilities: the function *steals* a reference to the "
"object, or it does not."
msgstr ""
"相反地,當呼叫的函式傳入物件的參照時,有兩種可能性:函式有\\ *竊取 (steal)* "
"物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定"
"它現在擁有該參照,並且你不再對它負責。"
"相反地,當呼叫的函式傳入物件的參照時,有兩種可能性:函式\\ *竊取 (steal)*\\ "
"物件的參照,或者沒有。"

#: ../../c-api/intro.rst:646
msgid ""
Expand All @@ -1000,6 +994,9 @@ msgid ""
"can use :c:func:`!Py_DECREF` at its discretion, you (the caller) must not "
"use that reference after the call."
msgstr ""
"*竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定它現在擁有該參照。由於新"
"的擁有者可以自行決定何時呼叫 :c:func:`!Py_DECREF`,你(呼叫者)在呼叫之後就不"
"可以再使用該參照。"

#: ../../c-api/intro.rst:655
msgid ""
Expand Down
11 changes: 5 additions & 6 deletions c-api/list.po
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ msgstr ""
"出邊界範圍則回傳 ``-1`` 並設定一個 :exc:`IndexError` 例外。"

#: ../../c-api/list.rst:105
#, fuzzy
msgid ""
"This function \":term:`steals <steal>`\" a reference to *item*, even on "
"error. On success, it discards a reference to an item already in the list at "
"the affected position (unless it was ``NULL``)."
msgstr ""
"此函式「竊取」對 *item* 的參照,並丟棄對串列中受影響位置上已存在項目的參照。"
"此函式「:term:`竊取 <steal>`」對 *item* 的參照,即使發生錯誤也一樣。成功時,"
"它會丟棄串列中受影響位置上已存在項目的參照(除非該項目為 ``NULL``)。"

#: ../../c-api/list.rst:113
msgid ""
Expand All @@ -149,15 +149,14 @@ msgstr ""
"查。"

#: ../../c-api/list.rst:122
#, fuzzy
msgid ""
"This macro \":term:`steals <steal>`\" a reference to *item*, and, unlike :c:"
"func:`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)。"
"該巨集「:term:`竊取 <steal>`」對 *item* 的參照,並且與 :c:func:"
"`PyList_SetItem` 不同的是,它\\ *不會*\\ 丟棄對任意被替換項目的參照;*list* "
"中位置 *i* 的任何參照都將被洩漏 (leak)。"

#: ../../c-api/list.rst:129
msgid ""
Expand Down
12 changes: 12 additions & 0 deletions c-api/memory.po
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ msgid ""
"in the previous example, the allocated memory for the I/O buffer completely "
"escapes the Python memory manager."
msgstr ""
"然而,在大多數情況下,建議從 Python 堆積分配記憶體,這是因為 Python 堆積是由 "
"Python 記憶體管理器所控制的。舉例來說,當直譯器被以 C 撰寫的新物件型別擴充"
"時,就必須這樣做。使用 Python 堆積的另一個理由,是希望能\\ *告知*\\ Python 記"
"憶體管理器該擴充模組的記憶體需求。即使所請求的記憶體僅用於內部、高度特定的用"
"途,將所有記憶體請求都委託給 Python 記憶體管理器,也能讓直譯器對其整體的記憶"
"體使用狀況有更準確的掌握。因此,在某些情況下,Python 記憶體管理器可能會(或可"
"能不會)觸發適當的動作,例如垃圾回收、記憶體壓縮或其他預防性程序。請注意,如"
"同前面範例所示,若使用 C 函式庫的分配器,配置給 I/O 緩衝區的記憶體會完全逃脫 "
"Python 記憶體管理器的掌控。"

#: ../../c-api/memory.rst:88
msgid ""
Expand Down Expand Up @@ -226,6 +235,9 @@ msgid ""
"of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request "
"fails. The memory is initialized to zeros."
msgstr ""
"分配 *nelem* 個元素,每個元素大小為 *elsize* 個位元組,並回傳一個型別為 :c:"
"expr:`void*` 的指標指向所分配的記憶體;如果請求失敗則回傳 ``NULL``。這塊記憶"
"體會被初始化為零。"

#: ../../c-api/memory.rst:168
msgid ""
Expand Down
8 changes: 5 additions & 3 deletions c-api/module.po
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ msgid ""
"function that returns a new reference without bothering to check its result "
"or even saving it to a variable."
msgstr ""
"類似於 :c:func:`PyModule_AddObjectRef`,但會「:term:`竊取 <steal>`」對 "
"*value* 的參照(即使發生錯誤也一樣)。它可以搭配某個回傳新參照之函式的結果來"
"呼叫,而不需要費心檢查其結果,甚至不需要將其儲存到變數中。"

#: ../../c-api/module.rst:569
msgid ""
Expand All @@ -663,13 +666,12 @@ msgstr ""
"}"

#: ../../c-api/module.rst:578
#, fuzzy
msgid ""
"Similar to :c:func:`PyModule_AddObjectRef`, but :term:`steals <steal>` a "
"reference to *value* on success (if it returns ``0``)."
msgstr ""
"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會偷走對 "
"*value* 的參照。"
"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會\\ :"
"term:`竊取 <steal>`\\ 對 *value* 的參照。"

#: ../../c-api/module.rst:581
msgid ""
Expand Down
3 changes: 3 additions & 0 deletions c-api/sequence.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ msgid ""
"of the Python statement ``o[i] = v``. This function *does not* \":term:"
"`steal`\" a reference to *v*."
msgstr ""
"將物件 *v* 指定給 *o* 的第 *i* 個元素。失敗時引發例外並回傳 ``-1``;成功時回"
"傳 ``0``。這相當於 Python 陳述式 ``o[i] = v``。此函式\\ *不會*\\ 「:term:`竊"
"取 <steal>`」對 *v* 的參照。"

#: ../../c-api/sequence.rst:72
msgid ""
Expand Down
5 changes: 1 addition & 4 deletions c-api/set.po
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,10 @@ msgid "Deprecated API"
msgstr "已棄用的 API"

#: ../../c-api/set.rst:207
#, fuzzy
msgid ""
"A constant representing the size of an internal preallocated table inside :c:"
"type:`PySetObject` instances."
msgstr ""
"一個被\\ :term:`軟性棄用 <soft deprecated>`\\ 的常數,代表 :c:type:"
"`PySetObject` 實例內部預分配表格的大小。"
msgstr "一個代表 :c:type:`PySetObject` 實例內部預分配表格大小的常數。"

#: ../../c-api/set.rst:210
msgid ""
Expand Down
6 changes: 6 additions & 0 deletions c-api/threads.po
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,12 @@ msgid ""
"isn't found. If *exc* is ``NULL``, the pending exception (if any) for the "
"thread is cleared. This raises no exceptions."
msgstr ""
"非同步地在執行緒中引發例外。*id* 引數為目標執行緒的執行緒 id;*exc* 為要引發"
"的例外物件。此函式不會\\ :term:`竊取 <steal>`\\ 任何對 *exc* 的參照。為了防止"
"不當誤用,你必須自行編寫 C 擴充來呼叫此函式。呼叫時必須具有\\ :term:`已附加的"
"執行緒狀態 <attached thread state>`\\ 。回傳被修改的執行緒狀態數量;通常為"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"執行緒狀態 <attached thread state>`\\ 。回傳被修改的執行緒狀態數量;通常為"
"執行緒狀態 <attached thread state>`。回傳被修改的執行緒狀態數量;通常為"

"一,但若找不到該執行緒 id 則為零。如果 *exc* 為 ``NULL``,則會清除該執行緒的"
"待處理例外(如果有的話)。此函式不會引發任何例外。"

#: ../../c-api/threads.rst:750
msgid ""
Expand Down
14 changes: 7 additions & 7 deletions c-api/tuple.po
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ msgstr ""
"*pos* 超出邊界則回傳 ``-1``,並設定 :exc:`IndexError` 例外。"

#: ../../c-api/tuple.rst:93
#, fuzzy
msgid ""
"This function \":term:`steals <steal>`\" a reference to *o* and discards a "
"reference to an item already in the tuple at the affected position (unless "
"it was NULL)."
msgstr "此函式 \"竊取\" 對 *o* 的參照,並丟棄對元組中受影響位置的項目的參照。"
msgstr ""
"此函式「:term:`竊取 <steal>`」對 *o* 的參照,並丟棄元組中該受影響位置上已存在"
"項目的參照(除非該參照為 NULL)。"

#: ../../c-api/tuple.rst:100
msgid ""
Expand All @@ -153,14 +154,14 @@ msgstr ""
"with-assertions>` 建置,則會進行作為斷言(asserting)的邊界檢查。"

#: ../../c-api/tuple.rst:108
#, fuzzy
msgid ""
"This function \":term:`steals <steal>`\" a reference to *o*, and, unlike :c:"
"func:`PyTuple_SetItem`, does *not* discard a reference to any item that is "
"being replaced; any reference in the tuple at position *pos* will be leaked."
msgstr ""
"此函式 \"竊取\" 對 *o* 的參照,且與 :c:func:`PyTuple_SetItem` 不同的是,此函"
"式並 *不* 丟棄任何被替代項目的參照;元組中 *pos* 位置的所有參照皆會被洩漏。"
"此函式「:term:`竊取 <steal>`」對 *o* 的參照,且與 :c:func:`PyTuple_SetItem` "
"不同的是,此函式並\\ *不*\\ 丟棄任何被替換項目的參照;元組中 *pos* 位置的所有"
"參照皆會被洩漏。"

#: ../../c-api/tuple.rst:115
msgid ""
Expand Down Expand Up @@ -319,9 +320,8 @@ msgstr ""
"`PyTuple_SET_ITEM` 類似,此函式僅套用於填充全新實例。"

#: ../../c-api/tuple.rst:248
#, fuzzy
msgid "This function \":term:`steals <steal>`\" a reference to *o*."
msgstr "此函式 \"竊取\" *o* 的參照。"
msgstr "此函式「:term:`竊取 <steal>`」對 *o* 的參照。"

#: ../../c-api/tuple.rst:253
msgid "Alias to :c:func:`PyStructSequence_SetItem`."
Expand Down
Loading
Loading