Skip to content

translate c-api/contextvars #1053 #1054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.13
Choose a base branch
from

Conversation

husohome
Copy link
Contributor

#1053

備註:
翻譯時我會先查 https://docs.python.org/zh-tw/3/search.html?q=reference
這邊的翻法會優先於樂詞網

第一次 PR 不吝指教!

Copy link
Collaborator

@mattwang44 mattwang44 left a comment

Choose a reason for hiding this comment

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

感謝幫忙!


#: ../../c-api/contextvars.rst:15
msgid ""
"In Python 3.7.1 the signatures of all context variables C APIs were "
"**changed** to use :c:type:`PyObject` pointers instead of :c:type:"
"`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::"
msgstr ""
"在 Python 3.7.1 中所有情境變數 C API 的簽名都被 **改為** 使用 :c:type:"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 通常會希望中文字間不要空格

Suggested change
"在 Python 3.7.1 中所有情境變數 C API 的簽名都被 **改為** 使用 :c:type:"
"在 Python 3.7.1 中所有情境變數 C API 的簽名都被\\ **改為**\\ 使用 :c:type:"

@@ -42,94 +51,103 @@ msgstr "更多細節請見 :issue:`34762`。"
#: ../../c-api/contextvars.rst:29
msgid ""
"This section details the public C API for the :mod:`contextvars` module."
msgstr ""
msgstr "本節詳述 :mod:`contextvars` 模組的公用 C API。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: public ㄧ詞以前好像比較常翻成「公開」,比較偏向代表有 expose 出來


#: ../../c-api/contextvars.rst:33
msgid ""
"The C structure used to represent a :class:`contextvars.Context` object."
msgstr ""
msgstr "用來代表 :class:`contextvars.Context` 物件的 C 結構。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這裡的 present 如果翻成「表示」或「表現」會不會比較貼切?


#: ../../c-api/contextvars.rst:76
msgid "Context object management functions:"
msgstr ""
msgstr "情境物件管理功能:"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這邊的 function 指的是「函式」還是「功能」?


#: ../../c-api/contextvars.rst:85
msgid ""
"Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` "
"if an error has occurred."
msgstr ""
msgstr "建立傳入的 *ctx* 情境物件的淺層複製。如果發生錯誤,則回傳 ``NULL``。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

附一下原文好了

Suggested change
msgstr "建立傳入的 *ctx* 情境物件的淺層複製。如果發生錯誤,則回傳 ``NULL``。"
msgstr "建立傳入的 *ctx* 情境物件的淺層複製 (shallow copy)。如果發生錯誤,則回傳 ``NULL``。"


#: ../../c-api/contextvars.rst:131
msgid ""
"Set the value of *var* to *value* in the current context. Returns a new "
"token object for this change, or ``NULL`` if an error has occurred."
msgstr ""
"在目前的情境中將 *var* 的值設為 *value*。會回傳一個用來代表此變更的新 token "
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: token 有好的翻譯嗎?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants