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
49 changes: 47 additions & 2 deletions c-api/descriptor.po
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ msgid ""
"Create a new get-set descriptor for extension type *type* from the :c:type:"
"`PyGetSetDef` structure *getset*."
msgstr ""
"從 :c:type:`PyGetSetDef` 結構 *getset* 為擴充型別 *type* 建立一個新的 get-"
"set 描述器。"

#: ../../c-api/descriptor.rst:21
msgid ""
Expand All @@ -50,6 +52,10 @@ msgid ""
"of descriptor created for entries in :c:member:`~PyTypeObject.tp_getset`, "
"and it appears in Python as a :class:`types.GetSetDescriptorType` object."
msgstr ""
"get-set 描述器所公開的屬性是由 C 取得器 (getter) 和設定器 (setter) 函式實作"
"的,而不是直接儲存在實例中。這與 :c:member:`~PyTypeObject.tp_getset` 中各項目"
"所建立的是同一種描述器,並在 Python 中以 :class:`types.GetSetDescriptorType` "
"物件的形式呈現。"

#: ../../c-api/descriptor.rst:26 ../../c-api/descriptor.rst:39
#: ../../c-api/descriptor.rst:70 ../../c-api/descriptor.rst:101
Expand All @@ -58,12 +64,16 @@ msgid ""
"On success, return a :term:`strong reference` to the descriptor. Return "
"``NULL`` with an exception set on failure."
msgstr ""
"成功時,回傳一個對描述器的 :term:`strong reference`\\ 。失敗時,回傳 "
"``NULL`` 並設定例外。"

#: ../../c-api/descriptor.rst:31
msgid ""
"Create a new member descriptor for extension type *type* from the :c:type:"
"`PyMemberDef` structure *member*."
msgstr ""
"從 :c:type:`PyMemberDef` 結構 *member* 為擴充型別 *type* 建立一個新的 member "
"描述器。"

#: ../../c-api/descriptor.rst:34
msgid ""
Expand All @@ -72,6 +82,9 @@ msgid ""
"member:`~PyTypeObject.tp_members`, and it appears in Python as a :class:"
"`types.MemberDescriptorType` object."
msgstr ""
"member 描述器將型別的 C 結構欄位公開為 Python 屬性。這與 :c:member:"
"`~PyTypeObject.tp_members` 中各項目所建立的是同一種描述器,並在 Python 中以 :"
"class:`types.MemberDescriptorType` 物件的形式呈現。"

#: ../../c-api/descriptor.rst:44
msgid ""
Expand All @@ -89,12 +102,17 @@ msgid ""
"type attributes. They correspond to :class:`types.GetSetDescriptorType` "
"objects in Python."
msgstr ""
"此為由 :c:type:`PyGetSetDef` 結構所建立的 get-set 描述器物件的型別物件。這些"
"描述器實作了值由 C 取得器和設定器函式計算得出的屬性,並用於許多內建型別屬性。"
"它們對應於 Python 中的 :class:`types.GetSetDescriptorType` 物件。"

#: ../../c-api/descriptor.rst:62
msgid ""
"Create a new method descriptor for extension type *type* from the :c:type:"
"`PyMethodDef` structure *meth*."
msgstr ""
"從 :c:type:`PyMethodDef` 結構 *meth* 為擴充型別 *type* 建立一個新的 method 描"
"述器。"

#: ../../c-api/descriptor.rst:65
msgid ""
Expand All @@ -103,6 +121,9 @@ msgid ""
"tp_methods`, and it appears in Python as a :class:`types."
"MethodDescriptorType` object."
msgstr ""
"method 描述器將 C 函式公開為型別上的方法。這與 :c:member:`~PyTypeObject."
"tp_methods` 中各項目所建立的是同一種描述器,並在 Python 中以 :class:`types."
"MethodDescriptorType` 物件的形式呈現。"

#: ../../c-api/descriptor.rst:75
msgid ""
Expand All @@ -111,24 +132,31 @@ msgid ""
"a type, and correspond to :class:`types.MethodDescriptorType` objects in "
"Python."
msgstr ""
"此為由 :c:type:`PyMethodDef` 結構所建立的 method 描述器物件的型別物件。這些描"
"述器將 C 函式公開為型別上的方法,並對應於 Python 中的 :class:`types."
"MethodDescriptorType` 物件。"

#: ../../c-api/descriptor.rst:83
msgid "Describes a slot wrapper used by :c:func:`PyDescr_NewWrapper`."
msgstr ""
msgstr "描述由 :c:func:`PyDescr_NewWrapper` 所使用的 slot wrapper。"

#: ../../c-api/descriptor.rst:85
msgid ""
"Each ``wrapperbase`` record stores the Python-visible name and metadata for "
"a special method implemented by a type slot, together with the wrapper "
"function used to adapt that slot to Python's calling convention."
msgstr ""
"每筆 ``wrapperbase`` 紀錄都儲存了由某個型別 slot 所實作的特殊方法之 Python 可"
"見名稱與中繼資料,以及用來將該 slot 轉接為 Python 呼叫慣例的 wrapper 函式。"

#: ../../c-api/descriptor.rst:91
msgid ""
"Create a new wrapper descriptor for extension type *type* from the :c:struct:"
"`wrapperbase` structure *base* and the wrapped slot function pointer "
"*wrapped*."
msgstr ""
"從 :c:struct:`wrapperbase` 結構 *base* 和被包裝的 slot 函式指標 *wrapped* 為"
"擴充型別 *type* 建立一個新的 wrapper 描述器。"

#: ../../c-api/descriptor.rst:96
msgid ""
Expand All @@ -137,6 +165,9 @@ msgid ""
"methods such as ``__repr__`` or ``__add__``, and it appears in Python as a :"
"class:`types.WrapperDescriptorType` object."
msgstr ""
"wrapper 描述器將由型別 slot 實作的特殊方法公開出來。這與 CPython 為 "
"``__repr__``\\ 、``__add__`` 等基於 slot 的特殊方法所建立的是同一種描述器,並"
"在 Python 中以 :class:`types.WrapperDescriptorType` 物件的形式呈現。"

#: ../../c-api/descriptor.rst:106
msgid ""
Expand All @@ -152,6 +183,8 @@ msgid ""
"Create a new class method descriptor for extension type *type* from the :c:"
"type:`PyMethodDef` structure *method*."
msgstr ""
"從 :c:type:`PyMethodDef` 結構 *method* 為擴充型別 *type* 建立一個新的 class "
"method 描述器。"

#: ../../c-api/descriptor.rst:118
msgid ""
Expand All @@ -160,6 +193,10 @@ msgid ""
"``METH_CLASS`` entries in :c:member:`~PyTypeObject.tp_methods`, and it "
"appears in Python as a :class:`types.ClassMethodDescriptorType` object."
msgstr ""
"class method 描述器所公開的 C 方法,在被存取時接收的是類別本身而非實例。這"
"與 :c:member:`~PyTypeObject.tp_methods` 中 ``METH_CLASS`` 項目所建立的是同一"
"種描述器,並在 Python 中以 :class:`types.ClassMethodDescriptorType` 物件的形"
"式呈現。"

#: ../../c-api/descriptor.rst:128
msgid ""
Expand All @@ -174,7 +211,7 @@ msgstr ""
msgid ""
"Create a new bound wrapper object from the wrapper descriptor *d* and the "
"instance *self*."
msgstr ""
msgstr "從 wrapper 描述器 *d* 和實例 *self* 建立一個新的已繫結 wrapper 物件。"

#: ../../c-api/descriptor.rst:138
msgid ""
Expand All @@ -183,12 +220,17 @@ msgid ""
"accessed through an instance, and they appear in Python as :class:`types."
"MethodWrapperType` objects."
msgstr ""
"這是由 :c:func:`PyDescr_NewWrapper` 所建立的 wrapper 描述器的已繫結形式。當 "
"slot wrapper 透過實例被存取時,CPython 就會建立這些物件,它們在 Python 中以 :"
"class:`types.MethodWrapperType` 物件的形式出現。"

#: ../../c-api/descriptor.rst:143
msgid ""
"On success, return a :term:`strong reference` to the wrapper object. Return "
"``NULL`` with an exception set on failure."
msgstr ""
"成功時,回傳一個對 wrapper 物件的 :term:`strong reference`\\ 。失敗時,回傳 "
"``NULL`` 並設定例外。"

#: ../../c-api/descriptor.rst:147
msgid "Built-in descriptors"
Expand All @@ -213,6 +255,9 @@ msgid ""
"extension types, and corresponds to :class:`types.ClassMethodDescriptorType` "
"objects in Python."
msgstr ""
"此為 C 層級 class method 描述器物件的型別物件。這是為 C 擴充型別中定義的 :"
"func:`classmethod` 所建立的描述器之型別,並對應於 Python 中的 :class:`types."
"ClassMethodDescriptorType` 物件。"

#: ../../c-api/descriptor.rst:171
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
Loading
Loading