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

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

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 在這句上的意思

@@ -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.

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

@@ -133,6 +159,11 @@ msgid ""
"``__slots__`` without including ``__dict__`` as one of the defined slots (as "
"such classes don't provide a ``__dict__`` attribute at all)."
msgstr ""
"此外,此裝飾器要求每個實例上的 ``__dict__`` 屬性是可變映射 (mutable "
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
"此外,此裝飾器要求每個實例上的 ``__dict__`` 屬性是可變映射 (mutable "
"此外,此裝飾器要求每個實例上的 ``__dict__`` 屬性是可變對映 (mutable "

@@ -142,6 +173,10 @@ msgid ""
"cache-method-calls` for more details on how this differs from :func:"
"`cached_property`."
msgstr ""
"如果可變映射不可用或需要金鑰共享以節省空間,則也可以透過在 :func:`lru_cache` "
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
"如果可變映射不可用或需要金鑰共享以節省空間,則也可以透過在 :func:`lru_cache` "
"如果可變對映不可用或需要金鑰共享以節省空間,則也可以透過在 :func:`lru_cache` "

"將舊式比較函式轉換為\\ :term:`鍵函式 <key function>`,能與接受鍵函式的工具一"
"起使用(例如 :func:`sorted`、:func:`min`、:func:`max`、:func:`heapq."
"nlargest`、:func:`heapq.nsmallest`、:func:`itertools.groupby`)。此函式主要作"
"為轉換工具,用於自有支援使用比較函式的 Python 2 轉換成的程式。"
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 2 轉換成的程式。"
"為轉換工具,用於從有支援使用比較函式的 Python 2 轉換成的程式。"

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