Skip to content

translate-weakref #904

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

Merged
merged 4 commits into from
May 23, 2024
Merged
Changes from 1 commit
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
47 changes: 36 additions & 11 deletions library/weakref.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-11 17:13+0000\n"
"PO-Revision-Date: 2024-05-08 22:24+0800\n"
"PO-Revision-Date: 2024-05-14 21:09+0800\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand All @@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.4.1\n"
"X-Generator: Poedit 3.4.4\n"

#: ../../library/weakref.rst:4
msgid ":mod:`weakref` --- Weak references"
Expand Down Expand Up @@ -112,7 +112,7 @@ msgid ""
msgstr ""
":class:`finalize` 提供了一種直接的方法來註冊在物件被垃圾回收時呼叫的清理函"
"式。這比在原始弱參照上設定回呼函式更容易使用,因為模組在物件被收集前會自動確"
"保終結函式 (finalizer) 保持存活。"
"保最終化函式 (finalizer) 保持存活。"

#: ../../library/weakref.rst:63
msgid ""
Expand Down Expand Up @@ -191,8 +191,8 @@ msgstr ""
"傳回對 *object* 的弱參照。如果參照目標仍存活,則可以透過呼叫參照物件來取回原"
"始物件;如果參照目標已不存活,呼叫參照物件將導致 :const:`None` 被回傳。如果 "
"*callback* 被提供而非 :const:`None`,且回傳的弱參照物件仍存活,那麼當物件即將"
"被終結 (finalize) 時,回呼將被呼叫;弱參照物件將作為唯一的參數傳遞給回呼;"
"照物件將不再可用。"
"被最終化 (finalize) 時,回呼將被呼叫;弱參照物件將作為唯一的參數傳遞給回呼;"
"參照物件將不再可用。"

#: ../../library/weakref.rst:108
msgid ""
Expand Down Expand Up @@ -399,6 +399,9 @@ msgid ""
"always survive until the reference object is collected, greatly simplifying "
"lifecycle management."
msgstr ""
"傳回可呼叫的最終化函式物件,此物件在 *obj* 被垃圾回收時會被呼叫。與一般的弱參"
"照不同,最終化函式將始終存在,直到參照物件被回收為止,從而大大簡化了生命週期"
"管理。"

#: ../../library/weakref.rst:275
msgid ""
Expand All @@ -407,6 +410,9 @@ msgid ""
"finalizer returns the result of evaluating ``func(*arg, **kwargs)``, whereas "
"calling a dead finalizer returns :const:`None`."
msgstr ""
"最終化函式在被呼叫(明確呼叫或在垃圾收集時)之前被視為\\ *存活*,之後它就會"
"\\ *死亡*。呼叫存活的最終化函式會回傳 ``func(*arg, **kwargs)`` 的計算結果,而"
"呼叫死亡的最終化函式會回傳 :const:`None`。"

#: ../../library/weakref.rst:280
msgid ""
Expand All @@ -415,49 +421,64 @@ msgid ""
"handled in the same way as exceptions raised from an object's :meth:`~object."
"__del__` method or a weak reference's callback."
msgstr ""
"垃圾回收期間最終化函式回呼引發的例外會在標準錯誤輸出中顯示,但無法傳播。它們"
"的處理方式與從物件的 :meth:`~object.__del__` 方法或弱參照的回呼引發的例外相"
"同。"

#: ../../library/weakref.rst:286
msgid ""
"When the program exits, each remaining live finalizer is called unless its :"
"attr:`atexit` attribute has been set to false. They are called in reverse "
"order of creation."
msgstr ""
"當程式退出時,除非該最終化函式的 :attr:`atexit` 屬性已被設定為 false,否則每"
"個存活的最終化函式會被呼叫。它們以與建立相反的順序被呼叫。"

#: ../../library/weakref.rst:290
msgid ""
"A finalizer will never invoke its callback during the later part of the :"
"term:`interpreter shutdown` when module globals are liable to have been "
"replaced by :const:`None`."
msgstr ""
"當模組的 globals 可能被 :const:`None` 取代時,最終化函式永遠不會在 :term:"
"`interpreter shutdown` 的後期調用(invoke)其回呼。"

#: ../../library/weakref.rst:296
msgid ""
"If *self* is alive then mark it as dead and return the result of calling "
"``func(*args, **kwargs)``. If *self* is dead then return :const:`None`."
msgstr ""
"如果 *self* 仍存活,則將其標記為死亡並回傳呼叫 ``func(*args, **kwargs)`` 的結"
"果。如果 *self* 已死亡,則回傳 :const:`None`。"

#: ../../library/weakref.rst:302
msgid ""
"If *self* is alive then mark it as dead and return the tuple ``(obj, func, "
"args, kwargs)``. If *self* is dead then return :const:`None`."
msgstr ""
"如果 *self* 仍存活,則將其標記為死亡並回傳元組 ``(obj, func, args, "
"kwargs)``。如果 *self* 已死亡,則回傳 :const:`None`。"

#: ../../library/weakref.rst:308
msgid ""
"If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If "
"*self* is dead then return :const:`None`."
msgstr ""
"如果 *self* 仍存活,則回傳元組 ``(obj, func, args, kwargs)``。如果 *self* 已"
"死亡,則回傳 :const:`None`。"

#: ../../library/weakref.rst:313
msgid "Property which is true if the finalizer is alive, false otherwise."
msgstr ""
msgstr "如果最終化函式仍存活,則屬性為 true,否則為 false。"

#: ../../library/weakref.rst:317
msgid ""
"A writable boolean property which by default is true. When the program "
"exits, it calls all remaining live finalizers for which :attr:`.atexit` is "
"true. They are called in reverse order of creation."
msgstr ""
"一個可寫的布林屬性,預設為 true。當程式退出時,它會呼叫 :attr:`.atexit` 為 "
"true 的所有剩餘且仍存活的最終化函式。它們以與建立相反的順序被呼叫。"

#: ../../library/weakref.rst:324
msgid ""
Expand All @@ -466,35 +487,39 @@ msgid ""
"will never be garbage collected. In particular, *func* should not be a "
"bound method of *obj*."
msgstr ""
"確保 *func*、*args* 和 *kwargs* 不直接或間接擁有對 *obj* 的任何參照非常重要,"
"否則 *obj* 將永遠不會被垃圾回收。尤其 *func* 不應該是 *obj* 的繫結方法。"

#: ../../library/weakref.rst:334
msgid "The type object for weak references objects."
msgstr ""
msgstr "弱參照物件的型別物件。"

#: ../../library/weakref.rst:339
msgid "The type object for proxies of objects which are not callable."
msgstr ""
msgstr "非可呼叫物件的代理的型別物件。"

#: ../../library/weakref.rst:344
msgid "The type object for proxies of callable objects."
msgstr ""
msgstr "可呼叫物件的代理的型別物件。"

#: ../../library/weakref.rst:349
msgid ""
"Sequence containing all the type objects for proxies. This can make it "
"simpler to test if an object is a proxy without being dependent on naming "
"both proxy types."
msgstr ""
"包含代理的所有型別物件的序列。這可以讓測試物件是否為代理變得更簡單,而無需依"
"賴命名兩種代理型別。"

#: ../../library/weakref.rst:356
msgid ":pep:`205` - Weak References"
msgstr ""
msgstr ":pep:`205` - 弱參照"

#: ../../library/weakref.rst:357
msgid ""
"The proposal and rationale for this feature, including links to earlier "
"implementations and information about similar features in other languages."
msgstr ""
msgstr "此功能的提案和理由,包括早期實作的連結以及其他語言中類似功能的資訊。"

#: ../../library/weakref.rst:364
msgid "Weak Reference Objects"
Expand Down
Loading