Skip to content
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

Translate library/functools.po #774

Merged
merged 2 commits into from
Aug 25, 2024
Merged

Conversation

mattwang44
Copy link
Collaborator

@mattwang44 mattwang44 commented Dec 26, 2023

resolve #773

preview image image image image image image

Copy link
Collaborator

@ken71301 ken71301 left a comment

Choose a reason for hiding this comment

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

first review, to rst:130


#: ../../library/functools.rst:31
msgid ""
"Simple lightweight unbounded function cache. Sometimes called `\"memoize\" "
"<https://en.wikipedia.org/wiki/Memoization>`_."
msgstr ""
"簡單的輕量級無界函式快取 (Simple lightweight unbounded function cache)。有時"
Copy link
Collaborator

Choose a reason for hiding this comment

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

bound function 之前被翻為 繫結函式,這邊不確定需不需要固定住這個翻法

@@ -78,6 +89,9 @@ msgid ""
"to :func:`property`, with the addition of caching. Useful for expensive "
"computed properties of instances that are otherwise effectively immutable."
msgstr ""
"將類別的一個方法轉換為屬性 (property),其值會計算一次,然後在實例的生命週期內"
"快取為普通屬性。類似 :func:`property`,但增加了快取機制。對於實質上幾乎是不可"
Copy link
Collaborator

Choose a reason for hiding this comment

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

後面這句的意思會比較接近這樣嗎?
對於除了使用這個方法(cached_property)之外幾乎不可變的實例來說,針對其需要繁重計算的屬性會很有用。
上面那句還沒有潤飾,但這邊我主要是想搞清楚 otherwise 在這句上的意思

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

你說的沒錯,微微修改一版

@@ -116,13 +136,19 @@ msgid ""
"necessary locking inside the decorated getter function or around the cached "
"property access."
msgstr ""
"*cached_property* 無法防止多執行緒使用中可能出現的競爭條件 (race condition)。"
"getter 函式可以在同一個實例上運行多次,最後一次運行會設定快取的值。所以快取的"
"屬性最好是冪等的 (idempotent),或者在一個實例上運行多次不會有害。如果同步是必"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is fine 要翻嗎?

Copy link
Collaborator

Choose a reason for hiding this comment

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

這句感覺應該沒有偏向哪種使用方式比較好的感覺

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

漏翻,已補上

library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
Copy link
Collaborator

@ken71301 ken71301 left a comment

Choose a reason for hiding this comment

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

review p2. to rst:227

library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
Copy link
Collaborator

@ken71301 ken71301 left a comment

Choose a reason for hiding this comment

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

review part3.
to rst:437

library/functools.po Outdated Show resolved Hide resolved
@@ -331,6 +419,10 @@ msgid ""
"indicates this is a bottleneck for a given application, implementing all six "
"rich comparison methods instead is likely to provide an easy speed boost."
msgstr ""
"雖然此裝飾器可以輕鬆建立能好好運作的完全有序型別 (totally ordered types),但"
"它\\ *確實*\\ 以衍生比較方法的執行速度較慢和堆疊追蹤 (stack trace) 較複雜為代"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這裡原句的 does 應該是在強調cost 我覺得翻過來應該也是在正後方比較好

ex. 他確實以較慢的執行速度與較複雜的堆疊追蹤為代價來衍生比較方法

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

變得較慢較複雜的是比較方法的執行,這樣改我覺得比較像是在描述「衍生」?
小修改以強調原意

library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
"回傳一個新的 :ref:`partial 物件 <partial-objects>`,它在呼叫時的行為類似於使"
"用位置引數 *args* 和關鍵字引數 *keywords* 呼叫的 *func*。如果向呼叫提供更多引"
"數,它們將被附加到 *args*。如果提供了額外的關鍵字引數,它們會擴充並覆寫 "
"*keywords*。大致相當於: ::"
Copy link
Collaborator

Choose a reason for hiding this comment

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

equivalent 我在隔壁棚是翻 等價,不過這個不統一應該沒啥差

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

就不改了


#: ../../library/functools.rst:364
msgid ""
"Return a new :class:`partialmethod` descriptor which behaves like :class:"
"`partial` except that it is designed to be used as a method definition "
"rather than being directly callable."
msgstr ""
"回傳一個新的 :class:`partialmethod` 描述器 (descriptor),其行為類似於 :class:"
"`partial`,只不過它被設計為用於方法定義而不能直接呼叫。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這邊的 rather than 是 不應該這麼做 還是 不能這麼做 啊?
遮邊主要疑慮是這句差一個字就會有差了
只不過它被設計為用於方法定義而不能直接呼叫
or
只不過它被設計為用於方法定義而不是直接呼叫

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

會有 exception 所以偏向「不能這麼做」?但語意上我是覺得兩者都可以

image

library/functools.po Outdated Show resolved Hide resolved
library/functools.po Outdated Show resolved Hide resolved
@@ -394,6 +504,10 @@ msgid ""
"argument, even before the *args* and *keywords* supplied to the :class:"
"`partialmethod` constructor."
msgstr ""
"當 *func* 是非描述器可呼叫物件 (non-descriptor callable) 時,會動態建立適當的"
"繫結方法 (bound method)。當用作方法時,其行為類似於普通的 Python 函式:"
"*self* 引數將作為第一個位置引數插入,會在提供給 :class:`partialmethod` 建構函"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這邊要不要倒裝一下
self 引數會在提供給 :class:partialmethod 建構函式的 argskeywords 更之前被作為第一個位置引數插入

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

我是覺得 在...之前 比較像補充敘述,重點是 作為第一個位置引數插入 所以還是先提及會比較好被理解

library/functools.po Outdated Show resolved Hide resolved
Copy link
Collaborator

@ken71301 ken71301 left a comment

Choose a reason for hiding this comment

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

review over~

@@ -438,35 +565,42 @@ msgid ""
"functions annotated with types, the decorator will infer the type of the "
"first argument automatically::"
msgstr ""
"若要為函式新增重載實作,請使用泛型函式的 :func:`register` 屬性,該屬性可用作"
Copy link
Collaborator

Choose a reason for hiding this comment

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

overload有固定翻譯嗎? 我目前看到的好像都是以 過載 或 超載 作為翻譯居多

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

改「過載」

@@ -528,13 +675,19 @@ msgid ""
"Here is the ``Negator`` class with the ``neg`` methods bound to the class, "
"rather than an instance of the class::"
msgstr ""
"``@singledispatchmethod`` 支援與其他裝飾器嵌套 (nest),例如 :func:"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nest 翻為 巢狀 相關的詞彙應該較好

Copy link
Collaborator

Choose a reason for hiding this comment

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

在這裏我可能會翻成 巢狀使用 之類的

@@ -528,13 +675,19 @@ msgid ""
"Here is the ``Negator`` class with the ``neg`` methods bound to the class, "
"rather than an instance of the class::"
msgstr ""
"``@singledispatchmethod`` 支援與其他裝飾器嵌套 (nest),例如 :func:"
"`@classmethod<classmethod>`。請注意,為了允許 ``dispatcher.register``,"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這裡要不要翻譯成 使 dispatcher.register 可用?

library/functools.po Outdated Show resolved Hide resolved
@@ -557,6 +716,9 @@ msgid ""
"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
"that refers to the function being wrapped."
msgstr ""
"為了允許出於自我檢查和其他目的所對原始函式的存取(例如繞過快取裝飾器,如 :"
Copy link
Collaborator

Choose a reason for hiding this comment

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

introspection 應該翻成 內省 嗎?

Co-authored-by: Payon <ken71301@hotmail.com>
Copy link
Collaborator

@ken71301 ken71301 left a comment

Choose a reason for hiding this comment

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

LGTM~

@ken71301 ken71301 merged commit ff862d0 into python:3.12 Aug 25, 2024
1 check passed
@mattwang44 mattwang44 deleted the library/functools branch August 25, 2024 13:53
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.

Translate library/functools.po
2 participants