From d60ea74034dcc732b53748473d0eb8408670fea7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 5 Jul 2026 14:17:12 +0000 Subject: [PATCH 1/5] Sync with cpython and translate new/fuzzy entries from upstream sync Resets to python/python-docs-zh-tw cron/sync/3.14 (cpython 44b4029a), pulls in library/concurrent.futures.po's latest doc refresh, and translates the accumulated backlog of new/fuzzy msgids versus the 3.14 branch: 1229 entries in library/tkinter.po (upstream doc rewrite), library/tkinter.ttk.po, library/dataclasses.po, library/curses.po, library/os.po, a brand-new library/asyncio-threading.po, and 43 other files, for 1328 entries total across 49 files. Co-authored-by: Claude --- c-api/bytes.po | 4 + c-api/dict.po | 3 + c-api/exceptions.po | 12 +- c-api/gen.po | 14 +- c-api/init_config.po | 2 + c-api/intro.po | 9 +- c-api/list.po | 5 +- c-api/memory.po | 12 + c-api/module.po | 8 +- c-api/sequence.po | 3 + c-api/threads.po | 6 + c-api/tuple.po | 13 +- c-api/type.po | 2 +- c-api/typeobj.po | 10 +- c-api/unicode.po | 3 + c-api/weakref.po | 10 + extending/extending.po | 7 +- faq/design.po | 5 + glossary.po | 46 +- howto/curses.po | 2 + howto/mro.po | 3 +- library/argparse.po | 13 +- library/asyncio-threading.po | 103 +- library/codecs.po | 2 + library/collections.abc.po | 4 + library/concurrent.futures.po | 7 + library/csv.po | 17 +- library/curses.ascii.po | 8 +- library/curses.panel.po | 7 +- library/curses.po | 140 +- library/dataclasses.po | 336 ++--- library/dialog.po | 57 +- library/imaplib.po | 6 + library/numbers.po | 6 +- library/os.po | 81 +- library/pyexpat.po | 23 +- library/shutil.po | 6 + library/socket.po | 30 +- library/stdtypes.po | 10 + library/tkinter.colorchooser.po | 8 +- library/tkinter.dnd.po | 2 + library/tkinter.font.po | 12 +- library/tkinter.messagebox.po | 7 +- library/tkinter.po | 2266 ++++++++++++++++++++++++++----- library/tkinter.scrolledtext.po | 4 + library/tkinter.ttk.po | 210 ++- library/warnings.po | 18 +- reference/expressions.po | 62 +- tutorial/venv.po | 3 + 49 files changed, 2881 insertions(+), 746 deletions(-) diff --git a/c-api/bytes.po b/c-api/bytes.po index e61db1bc7b0..2d32a716a77 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -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* 舊值的參照將被「竊取」。如果無法建立" +"新物件,*bytes* 的舊參照仍將被「竊取」,*\\*bytes* 的值將被設為 ``NULL``,並" +"會設定適當的例外。" #: ../../c-api/bytes.rst:190 ../../c-api/bytes.rst:200 msgid "" diff --git a/c-api/dict.po b/c-api/dict.po index f04cedf2cae..d256a012ee3 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -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:`可雜湊的 " +"`,否則將引發 :exc:`TypeError`。成功時回傳 ``0``,失敗時回傳 " +"``-1``。此函式\\ *不會*\\ 「竊取」對 *val* 的參照。" #: ../../c-api/dict.rst:103 msgid "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index c19667487f2..5d83fc66989 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -543,7 +543,7 @@ msgstr "" msgid "" "This call \":term:`steals `\" a reference to *exc*, which must be a " "valid exception." -msgstr "" +msgstr "此呼叫「竊取」對 *exc* 的參照,*exc* 必須為一個有效的例外。" #: ../../c-api/exceptions.rst:516 msgid "Use :c:func:`PyErr_GetRaisedException` instead." @@ -699,6 +699,10 @@ msgid "" "arguments. This function is kept for backwards compatibility. Prefer using :" "c:func:`PyErr_SetHandledException`." msgstr "" +"設定例外資訊,如同從 ``sys.exc_info()`` 得知的資訊一般。這裡指的是一個 *已經" +"被捕捉* 的例外,而不是剛被引發的例外。此函式「竊取」這些引數的參照。若要清除" +"例外狀態,請為所有三個引數傳入 ``NULL``。此函式是為了向下相容而保留,建議改" +"用 :c:func:`PyErr_SetHandledException`。" #: ../../c-api/exceptions.rst:653 msgid "" @@ -715,6 +719,8 @@ msgid "" "argument). The function still \":term:`steals `\" references of all " "three arguments." msgstr "" +"引數 ``type`` 和 ``traceback`` 已不再使用,可以為 NULL。直譯器現在會從例外實" +"例(引數 ``value``)中衍生出它們。此函式仍會「竊取」所有三個引數的參照。" #: ../../c-api/exceptions.rst:668 msgid "Signal Handling" @@ -933,6 +939,8 @@ msgid "" "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This \":term:`steals `\" a reference to *ctx*." msgstr "" +"將與該例外關聯的情境設定為 *ctx*。使用 ``NULL`` 來清除它。這裡不會檢查型別以" +"確保 *ctx* 是一個例外實例。此函式「竊取」對 *ctx* 的參照。" #: ../../c-api/exceptions.rst:861 msgid "" @@ -949,6 +957,8 @@ msgid "" "exception instance or ``None``. This \":term:`steals `\" a reference " "to *cause*." msgstr "" +"將與該例外關聯的成因設定為 *cause*。使用 ``NULL`` 來清除它。這裡不會檢查型別" +"以確保 *cause* 是一個例外實例或 ``None``。此函式「竊取」對 *cause* 的參照。" #: ../../c-api/exceptions.rst:874 msgid "" diff --git a/c-api/gen.po b/c-api/gen.po index 98f34dd8352..f874bd149e0 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -61,17 +61,15 @@ 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 `\" by this function (even on " "error). The argument must not be ``NULL``." msgstr "" -"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會取走一個對 *frame* 的" -"參照 (reference)。引數必須不為 ``NULL``。" +"基於 *frame* 物件建立並回傳一個新的產生器物件。此函式會「竊取」對 *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 " @@ -79,8 +77,8 @@ msgid "" "The *frame* argument must not be ``NULL``." msgstr "" "基於 *frame* 物件建立並回傳一個新的產生器物件,其中 ``__name__`` 和 " -"``__qualname__`` 設為 *name* 和 *qualname*。此函式會取走一個對 *frame* 的參" -"照。*frame* 引數必須不為 ``NULL``。" +"``__qualname__`` 設為 *name* 和 *qualname*。此函式會「竊取」對 *frame* 的一個" +"參照(即使發生錯誤也一樣)。*frame* 引數必須不為 ``NULL``。" #: ../../c-api/gen.rst:51 msgid "" @@ -107,14 +105,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 " "`\" by this function (even on error) and must not be ``NULL``." msgstr "" "建立一個包裝 *frame* 的非同步產生器,並將 ``__name__`` 和 ``__qualname__`` 設" -"為 *name* 和 *qualname*。*frame* 會被此函式取走,且不得為 ``NULL``。" +"為 *name* 和 *qualname*。*frame* 會被此函式「竊取」(即使發生錯誤也一樣),且" +"不得為 ``NULL``。" #: ../../c-api/gen.rst:75 msgid "" diff --git a/c-api/init_config.po b/c-api/init_config.po index 603221f0cbe..57db1334934 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -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" diff --git a/c-api/intro.po b/c-api/intro.po index 7b497a9391f..3b24db155ce 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -987,15 +987,13 @@ msgstr "" "照 `\\ 就不需要做任何事情。" #: ../../c-api/intro.rst:642 -#, fuzzy msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " "object, or it does not." msgstr "" -"相反地,當呼叫的函式傳入物件的參照時,有兩種可能性:函式有\\ *竊取 (steal)* " -"物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" -"它現在擁有該參照,並且你不再對它負責。" +"相反地,當呼叫的函式傳入物件的參照時,有兩種可能性:函式\\ *竊取 (steal)*\\ " +"物件的參照,或者沒有。" #: ../../c-api/intro.rst:646 msgid "" @@ -1004,6 +1002,9 @@ msgid "" "can use :c:func:`!Py_DECREF` at its discretion, you (the caller) must not " "use that reference after the call." msgstr "" +"*竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定它現在擁有該參照。由於新" +"的擁有者可以自行決定何時呼叫 :c:func:`!Py_DECREF`,你(呼叫者)在呼叫之後就不" +"可以再使用該參照。" #: ../../c-api/intro.rst:655 msgid "" diff --git a/c-api/list.po b/c-api/list.po index b35893c5ba4..ee5740648f7 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -123,13 +123,13 @@ msgstr "" "出邊界範圍則回傳 ``-1`` 並設定一個 :exc:`IndexError` 例外。" #: ../../c-api/list.rst:105 -#, fuzzy msgid "" "This function \":term:`steals `\" a reference to *item*, even on " "error. On success, it discards a reference to an item already in the list at " "the affected position (unless it was ``NULL``)." msgstr "" -"此函式「竊取」對 *item* 的參照,並丟棄對串列中受影響位置上已存在項目的參照。" +"此函式「竊取」對 *item* 的參照,即使發生錯誤也一樣。成功時,它會丟棄串列中受" +"影響位置上已存在項目的參照(除非該項目為 ``NULL``)。" #: ../../c-api/list.rst:113 msgid "" @@ -149,7 +149,6 @@ msgstr "" "查。" #: ../../c-api/list.rst:122 -#, fuzzy msgid "" "This macro \":term:`steals `\" a reference to *item*, and, unlike :c:" "func:`PyList_SetItem`, does *not* discard a reference to any item that is " diff --git a/c-api/memory.po b/c-api/memory.po index 7686b4d1332..9a26b6bbbee 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -108,6 +108,15 @@ msgid "" "in the previous example, the allocated memory for the I/O buffer completely " "escapes the Python memory manager." msgstr "" +"然而,在大多數情況下,建議從 Python 堆積分配記憶體,這是因為 Python 堆積是由 " +"Python 記憶體管理器所控制的。舉例來說,當直譯器被以 C 撰寫的新物件型別擴充" +"時,就必須這樣做。使用 Python 堆積的另一個理由,是希望能\\ *告知*\\ Python 記" +"憶體管理器該擴充模組的記憶體需求。即使所請求的記憶體僅用於內部、高度特定的用" +"途,將所有記憶體請求都委託給 Python 記憶體管理器,也能讓直譯器對其整體的記憶" +"體使用狀況有更準確的掌握。因此,在某些情況下,Python 記憶體管理器可能會(或可" +"能不會)觸發適當的動作,例如垃圾回收、記憶體壓縮或其他預防性程序。請注意,如" +"同前面範例所示,若使用 C 函式庫的分配器,配置給 I/O 緩衝區的記憶體會完全逃脫 " +"Python 記憶體管理器的掌控。" #: ../../c-api/memory.rst:88 msgid "" @@ -226,6 +235,9 @@ msgid "" "of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request " "fails. The memory is initialized to zeros." msgstr "" +"分配 *nelem* 個元素,每個元素大小為 *elsize* 個位元組,並回傳一個型別為 :c:" +"expr:`void*` 的指標指向所分配的記憶體;如果請求失敗則回傳 ``NULL``。這塊記憶" +"體會被初始化為零。" #: ../../c-api/memory.rst:168 msgid "" diff --git a/c-api/module.po b/c-api/module.po index cb4b083be97..5d31686f65d 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -651,6 +651,9 @@ msgid "" "function that returns a new reference without bothering to check its result " "or even saving it to a variable." msgstr "" +"類似於 :c:func:`PyModule_AddObjectRef`,但會「竊取」對 *value* 的參照(即使發" +"生錯誤也一樣)。它可以搭配某個回傳新參照之函式的結果來呼叫,而不需要費心檢查" +"其結果,甚至不需要將其儲存到變數中。" #: ../../c-api/module.rst:569 msgid "" @@ -663,13 +666,12 @@ msgstr "" "}" #: ../../c-api/module.rst:578 -#, fuzzy msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but :term:`steals ` a " "reference to *value* on success (if it returns ``0``)." msgstr "" -"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會偷走對 " -"*value* 的參照。" +"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會「竊" +"取」對 *value* 的參照。" #: ../../c-api/module.rst:581 msgid "" diff --git a/c-api/sequence.po b/c-api/sequence.po index 78f72a8cd67..ce0761c641e 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -82,6 +82,9 @@ msgid "" "of the Python statement ``o[i] = v``. This function *does not* \":term:" "`steal`\" a reference to *v*." msgstr "" +"將物件 *v* 指定給 *o* 的第 *i* 個元素。失敗時引發例外並回傳 ``-1``;成功時回" +"傳 ``0``。這相當於 Python 陳述式 ``o[i] = v``。此函式\\ *不會*\\ 「竊取」對 " +"*v* 的參照。" #: ../../c-api/sequence.rst:72 msgid "" diff --git a/c-api/threads.po b/c-api/threads.po index 13f8ab939f7..db56d3e96c7 100644 --- a/c-api/threads.po +++ b/c-api/threads.po @@ -925,6 +925,12 @@ msgid "" "isn't found. If *exc* is ``NULL``, the pending exception (if any) for the " "thread is cleared. This raises no exceptions." msgstr "" +"非同步地在執行緒中引發例外。*id* 引數為目標執行緒的執行緒 id;*exc* 為要引發" +"的例外物件。此函式不會竊取任何對 *exc* 的參照。為了防止不當誤用,你必須自行編" +"寫 C 擴充來呼叫此函式。呼叫時必須具有 :term:`attached thread state`。回傳被修" +"改的執行緒狀態數量;通常為一,但若找不到該執行緒 id 則為零。如果 *exc* 為 " +"``NULL``,則會清除該執行緒的待處理例外(如果有的話)。此函式不會引發任何例" +"外。" #: ../../c-api/threads.rst:750 msgid "" diff --git a/c-api/tuple.po b/c-api/tuple.po index 18e5a17884c..a6f1f4091ba 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -128,12 +128,13 @@ msgstr "" "*pos* 超出邊界則回傳 ``-1``,並設定 :exc:`IndexError` 例外。" #: ../../c-api/tuple.rst:93 -#, fuzzy msgid "" "This function \":term:`steals `\" a reference to *o* and discards a " "reference to an item already in the tuple at the affected position (unless " "it was NULL)." -msgstr "此函式 \"竊取\" 對 *o* 的參照,並丟棄對元組中受影響位置的項目的參照。" +msgstr "" +"此函式「竊取」對 *o* 的參照,並丟棄元組中該受影響位置上已存在項目的參照(除非" +"該參照為 NULL)。" #: ../../c-api/tuple.rst:100 msgid "" @@ -153,14 +154,13 @@ msgstr "" "with-assertions>` 建置,則會進行作為斷言(asserting)的邊界檢查。" #: ../../c-api/tuple.rst:108 -#, fuzzy msgid "" "This function \":term:`steals `\" a reference to *o*, and, unlike :c:" "func:`PyTuple_SetItem`, does *not* discard a reference to any item that is " "being replaced; any reference in the tuple at position *pos* will be leaked." msgstr "" -"此函式 \"竊取\" 對 *o* 的參照,且與 :c:func:`PyTuple_SetItem` 不同的是,此函" -"式並 *不* 丟棄任何被替代項目的參照;元組中 *pos* 位置的所有參照皆會被洩漏。" +"此函式「竊取」對 *o* 的參照,且與 :c:func:`PyTuple_SetItem` 不同的是,此函式" +"並\\ *不*\\ 丟棄任何被替換項目的參照;元組中 *pos* 位置的所有參照皆會被洩漏。" #: ../../c-api/tuple.rst:115 msgid "" @@ -319,9 +319,8 @@ msgstr "" "`PyTuple_SET_ITEM` 類似,此函式僅套用於填充全新實例。" #: ../../c-api/tuple.rst:248 -#, fuzzy msgid "This function \":term:`steals `\" a reference to *o*." -msgstr "此函式 \"竊取\" *o* 的參照。" +msgstr "此函式「竊取」對 *o* 的參照。" #: ../../c-api/tuple.rst:253 msgid "Alias to :c:func:`PyStructSequence_SetItem`." diff --git a/c-api/type.po b/c-api/type.po index 968d140b99b..a42030740f8 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -614,7 +614,7 @@ msgstr "" msgid "" "The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize` is " "zero)." -msgstr "" +msgstr "基底並非大小可變的(其 :c:member:`~PyTypeObject.tp_itemsize` 為零)。" #: ../../c-api/type.rst:555 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 3cb85361339..f5c51e94b42 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -4289,6 +4289,8 @@ msgid "" "Check if the request can be met. If not, raise :exc:`BufferError`, set " "``view->obj`` to ``NULL`` and return ``-1``." msgstr "" +"檢查該請求是否能夠被滿足。如果不能,則引發 :exc:`BufferError`,將 ``view-" +">obj`` 設為 ``NULL`` 並回傳 ``-1``。" #: ../../c-api/typeobj.rst:3050 msgid "Fill in the requested fields." @@ -4300,7 +4302,7 @@ msgstr "" #: ../../c-api/typeobj.rst:3054 msgid "Set ``view->obj`` to *exporter* and increment ``view->obj``." -msgstr "" +msgstr "將 ``view->obj`` 設為 *exporter*,並遞增 ``view->obj``。" #: ../../c-api/typeobj.rst:3056 msgid "Return ``0``." @@ -4352,12 +4354,16 @@ msgid "" "Re-export: Each member of the tree acts as the exporting object and sets " "``view->obj`` to a new reference to itself." msgstr "" +"重新匯出:樹狀結構中的每個成員都作為匯出物件,並將 ``view->obj`` 設為指向自身" +"的新參照。" #: ../../c-api/typeobj.rst:3082 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, ``view->obj`` will be a new reference to the root object." msgstr "" +"重新導向:緩衝區請求會被重新導向至樹狀結構的根物件。在這種情況下,``view-" +">obj`` 將會是指向該根物件的新參照。" #: ../../c-api/typeobj.rst:3086 msgid "" @@ -4437,6 +4443,8 @@ msgid "" "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" +"此函式絕不能遞減 ``view->obj``,因為這會由 :c:func:`PyBuffer_Release` 自動完" +"成(此機制有助於打破循環參照)。" #: ../../c-api/typeobj.rst:3142 msgid "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 3efbb868f2e..ba6fd6fcb5a 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -925,6 +925,9 @@ msgid "" "term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` " "releases (\":term:`steals `\") this reference." msgstr "" +"將字串 *right* 附加到 *p_left* 的結尾。*p_left* 必須指向一個 Unicode 物件的 :" +"term:`強參照 `;:c:func:`!PyUnicode_Append` 會釋放(「竊" +"取」)此參照。" #: ../../c-api/unicode.rst:669 msgid "On error, set *\\*p_left* to ``NULL`` and set an exception." diff --git a/c-api/weakref.po b/c-api/weakref.po index f20eee57aa5..ab0d213cf67 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -64,6 +64,11 @@ msgid "" "weakly referenceable object, this will raise :exc:`TypeError` and return " "``NULL``." msgstr "" +"回傳物件 *ob* 的弱參照物件。這總是會回傳一個新參照,但不保證會建立一個新物" +"件;也可能會回傳一個已存在的參照物件。第二個參數 *callback* 可以是一個可呼叫" +"物件,會在 *ob* 被垃圾回收時收到通知;它應該接受一個參數,也就是該弱參照物件" +"本身。*callback* 也可以是 ``None`` 或 ``NULL``。如果 *ob* 不是可被弱參照的物" +"件,則會引發 :exc:`TypeError` 並回傳 ``NULL``。" #: ../../c-api/weakref.rst:49 ../../c-api/weakref.rst:65 msgid "" @@ -82,6 +87,11 @@ msgid "" "*ob* weakly referenceable object, this will raise :exc:`TypeError` and " "return ``NULL``." msgstr "" +"回傳物件 *ob* 的弱參照代理物件。這總是會回傳一個新參照,但不保證會建立一個新" +"物件;也可能會回傳一個已存在的代理物件。第二個參數 *callback* 可以是一個可呼" +"叫物件,會在 *ob* 被垃圾回收時收到通知;它應該接受一個參數,也就是該弱參照物" +"件本身。*callback* 也可以是 ``None`` 或 ``NULL``。如果 *ob* 不是可被弱參照的" +"物件,則會引發 :exc:`TypeError` 並回傳 ``NULL``。" #: ../../c-api/weakref.rst:71 msgid "" diff --git a/extending/extending.po b/extending/extending.po index ffe5607f5d8..10e4530b4c1 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -1138,7 +1138,6 @@ msgstr "" "機制;其實作將需要從 C 回呼中呼叫 Python 回呼函式。其他用途也是可以想像的。" #: ../../extending/extending.rst:547 -#, fuzzy msgid "" "Fortunately, the Python interpreter is easily called recursively, and there " "is a standard interface to call a Python function. (If you're interested in " @@ -1146,9 +1145,8 @@ msgid "" "`veryhigh`.)" msgstr "" "幸運的是,Python 直譯器可以很容易地被遞迴呼叫,並且有一個標準介面可以呼叫 " -"Python 函式。(我不會深入討論如何以特定字串作為輸入來呼叫 Python 剖析器 --- " -"如果你有興趣,可以查看 Python 原始碼中 :file:`Modules/main.c` 裡 :option:`-" -"c` 命令列選項的實作。)" +"Python 函式。(如果你對於如何以特定字串作為輸入來呼叫 Python 剖析器感興趣,請" +"參閱\\ :ref:`veryhigh`。)" #: ../../extending/extending.rst:551 msgid "" @@ -1893,7 +1891,6 @@ msgstr "" "歸零時,表示該物件的最後一個參照已被刪除,物件便被釋放。" #: ../../extending/extending.rst:937 -#, fuzzy msgid "" "An alternative strategy is called :dfn:`automatic garbage collection`. " "(Sometimes, reference counting is also referred to as a garbage collection " diff --git a/faq/design.po b/faq/design.po index 459a7908357..3aed21feac5 100644 --- a/faq/design.po +++ b/faq/design.po @@ -523,6 +523,11 @@ msgid "" "statements. An older alternative is a sequence of ``if... elif... elif... " "else``." msgstr "" +"一般來說,結構化的 switch 陳述式會在運算式具有特定值或一組值時執行對應的程式" +"碼區塊。自 Python 3.10 起,你可以輕鬆地用 ``match ... case`` 陳述式來比對字面" +"值,或是命名空間中的常數。關於 :keyword:`match` 陳述式的更多資訊,請參閱\\ :" +"ref:`規格說明 `\\ 和\\ :ref:`教學 `\\ 。較舊的替代方式是使" +"用一連串的 ``if... elif... elif... else``。" #: ../../faq/design.rst:270 msgid "" diff --git a/glossary.po b/glossary.po index b414623b1ea..0729d741ac8 100644 --- a/glossary.po +++ b/glossary.po @@ -228,14 +228,17 @@ msgid "" "generator iterator` are uncommon in practice; \"asynchronous generator\" " "alone is almost always sufficient." msgstr "" +"依情境不同,非正式地用來表示\\ :term:`asynchronous generator function`\\ (非" +"同步產生器函式)或\\ :term:`asynchronous generator iterator`\\ (非同步產生器" +"疊代器)兩者之一。正式用語\\ :term:`asynchronous generator function`\\ 和\\ :" +"term:`asynchronous generator iterator`\\ 在實務上並不常見;單獨使用" +"「asynchronous generator」(非同步產生器)幾乎都已足夠。" #: ../../glossary.rst:104 -#, fuzzy msgid "asynchronous generator function" -msgstr "asynchronous generator(非同步產生器)" +msgstr "asynchronous generator function(非同步產生器函式)" #: ../../glossary.rst:106 -#, fuzzy msgid "" "A function which returns an :term:`asynchronous generator iterator`. It " "looks like a coroutine function defined with :keyword:`async def` except " @@ -245,7 +248,7 @@ msgstr "" "一個會回傳 :term:`asynchronous generator iterator`\\ (非同步產生器疊代器)的" "函式。它看起來像一個以 :keyword:`async def` 定義的協程函式 (coroutine " "function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用於 :" -"keyword:`async for` 迴圈的值。" +"keyword:`async for` 迴圈的值。請參閱 :pep:`525`。" #: ../../glossary.rst:111 msgid "" @@ -260,10 +263,10 @@ msgid "asynchronous generator iterator" msgstr "asynchronous generator iterator(非同步產生器疊代器)" #: ../../glossary.rst:116 -#, fuzzy msgid "An object created by an :term:`asynchronous generator function`." msgstr "" -"一個由 :term:`asynchronous generator`\\ (非同步產生器)函式所建立的物件。" +"一個由 :term:`asynchronous generator function`\\ (非同步產生器函式)所建立的" +"物件。" #: ../../glossary.rst:118 msgid "" @@ -1437,37 +1440,40 @@ msgid "" "`generator function` and :term:`generator iterator` are uncommon in " "practice; \"generator\" alone is almost always sufficient." msgstr "" +"依情境不同,非正式地用來表示\\ :term:`generator function`\\ (產生器函式)或" +"\\ :term:`generator iterator`\\ (產生器疊代器)兩者之一。正式用語\\ :term:" +"`generator function`\\ 和\\ :term:`generator iterator`\\ 在實務上並不常見;單" +"獨使用「generator」(產生器)幾乎都已足夠。" #: ../../glossary.rst:652 ../../glossary.rst:653 -#, fuzzy msgid "generator function" -msgstr "generic function(泛型函式)" +msgstr "generator function(產生器函式)" #: ../../glossary.rst:655 -#, fuzzy msgid "" "A function which returns a :term:`generator` object. It looks like a normal " "function except that it contains :keyword:`yield` expressions for producing " "a series of values usable in a :keyword:`for`\\-loop or that can be " "retrieved one at a time with the :func:`next` function. See :ref:`yieldexpr`." msgstr "" -"一個會回傳 :term:`generator iterator`\\ (產生器疊代器)的函式。它看起來像一" -"個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," -"這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" +"一個會回傳 :term:`generator`\\ (產生器)物件的函式。它看起來像一個正常的函" +"式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值,這些值可用" +"於 :keyword:`for` 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。請參" +"閱 :ref:`yieldexpr`。" #: ../../glossary.rst:660 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" #: ../../glossary.rst:662 -#, fuzzy msgid "" "An object created by a :term:`generator function` or a :term:`generator " "expression`." -msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" +msgstr "" +"一個由 :term:`generator function`\\ (產生器函式)或 :term:`generator " +"expression`\\ (產生器運算式)所建立的物件。" #: ../../glossary.rst:665 -#, fuzzy msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). When " @@ -1485,6 +1491,9 @@ msgid "" "method to raise an exception at the point where the generator was paused. " "See :ref:`generator-methods`." msgstr "" +"產生器疊代器也實作了 :meth:`~generator.send` method(方法),用於將值傳入已暫" +"停的產生器;以及 :meth:`~generator.throw` method(方法),用於在產生器暫停之" +"處引發例外。請參閱 :ref:`generator-methods`。" #: ../../glossary.rst:675 ../../glossary.rst:676 msgid "generator expression" @@ -3322,7 +3331,7 @@ msgstr ":term:`standard library` 的縮寫。" #: ../../glossary.rst:1517 msgid "steal" -msgstr "" +msgstr "steal(竊取)" #: ../../glossary.rst:1519 msgid "" @@ -3331,10 +3340,13 @@ msgid "" "reference after the call. Generally, functions that \"steal\" an argument do " "so even if they fail." msgstr "" +"在 Python 的 C API 中,「*竊取 (stealing)*」一個引數意味著該引數的所有權會轉" +"移給被呼叫的函式。呼叫者在呼叫之後就不可以再使用該參照。通常,會「竊取」引數" +"的函式,即使呼叫失敗,也依然會竊取該引數。" #: ../../glossary.rst:1524 msgid "See :ref:`api-refcountdetails` for a full explanation." -msgstr "" +msgstr "請參閱 :ref:`api-refcountdetails`\\ 以獲得完整的說明。" #: ../../glossary.rst:1525 msgid "strong reference" diff --git a/howto/curses.po b/howto/curses.po index 32d9076a678..7a29785af5f 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -103,6 +103,8 @@ msgid "" "third-party :pypi:`windows-curses` package provides the same interface on " "Windows." msgstr "" +"Windows 版本的 Python 並未包含 :mod:`curses` 模組。第三方 :pypi:`windows-" +"curses` 套件在 Windows 上提供了相同的介面。" #: ../../howto/curses.rst:63 msgid "The Python curses module" diff --git a/howto/mro.po b/howto/mro.po index 3821539bef8..9a6dc77c5b7 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -32,9 +32,8 @@ msgstr "" "Python 3。" #: ../../howto/mro.rst:13 -#, fuzzy msgid "By `Michele Simionato `__." -msgstr "作者:`Michele Simionato `__。" +msgstr "作者:`Michele Simionato `__。" #: ../../howto/mro.rst:0 msgid "Abstract" diff --git a/library/argparse.po b/library/argparse.po index d3b4e1f3b71..fbd53fc6c4a 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -878,7 +878,7 @@ msgstr "" msgid "" "Each line is treated as a single argument, so an empty line is read as an " "empty string (``''``)." -msgstr "" +msgstr "每一行都會被視為單一引數,因此空白行會被讀取為空字串 (``''``)。" #: ../../library/argparse.rst:448 msgid "" @@ -2095,6 +2095,9 @@ msgid "" "positional argument yields an empty list (``[]``). Only a non-``None`` " "*default* overrides this (so ``default=None`` still gives ``[]``)." msgstr "" +"因為 ``nargs='*'`` 會將所有提供的值收集到一個 list 中,所以缺少位置引數時會得" +"到一個空 list (``[]``)。只有非 ``None`` 的 *default* 才會覆寫此行為(因此 " +"``default=None`` 仍然會得到 ``[]``)。" #: ../../library/argparse.rst:1054 msgid "" @@ -2720,6 +2723,9 @@ msgid "" "For conflicting *option strings* rather than ``dest`` names, see " "conflict_handler_." msgstr "" +"多個引數可以共用相同的 ``dest``。預設情況下,會以命令列上最後給定的該引數的值" +"為準。可以改用 ``action='append'`` 將所有引數的值收集到一個 list 中。若衝突的" +"是 *選項字串* 而非 ``dest`` 名稱,請參閱 conflict_handler_。" #: ../../library/argparse.rst:1374 msgid "deprecated" @@ -3487,6 +3493,9 @@ msgid "" "won't be retained. Users should give them distinct ``dest`` values to keep " "both." msgstr "" +"如果子剖析器定義了一個與父剖析器相同 ``dest`` 的引數,兩者會共用同一個命名空" +"間屬性,因此父剖析器的值不會被保留。使用者應該為它們指定不同的 ``dest`` 值," +"才能同時保留兩者。" #: ../../library/argparse.rst:1770 msgid "" @@ -4323,6 +4332,8 @@ msgid "" "Note that with this override an argument can no longer contain spaces, since " "each space-separated word becomes a separate argument." msgstr "" +"請注意,透過此覆寫,引數不能再包含空格,因為每個以空格分隔的詞都會變成一個獨" +"立的引數。" #: ../../library/argparse.rst:2219 msgid "Exiting methods" diff --git a/library/asyncio-threading.po b/library/asyncio-threading.po index f1b502620f2..db1e7523b44 100644 --- a/library/asyncio-threading.po +++ b/library/asyncio-threading.po @@ -17,7 +17,7 @@ msgstr "" #: ../../library/asyncio-threading.rst:6 msgid "asyncio and free-threaded Python" -msgstr "" +msgstr "asyncio 與自由執行緒 Python" #: ../../library/asyncio-threading.rst:8 msgid "" @@ -27,6 +27,10 @@ msgid "" "off-loading CPU-bound work to a thread or process pool, but that is still " "limited by the :term:`global interpreter lock` in CPython." msgstr "" +"asyncio 使用事件迴圈作為排程器,藉由在多個任務之間切換來實現高效率的並行性," +"並允許非阻塞的 I/O 操作。這讓 I/O 密集型的使用情境有更好的效能。它也允許將 " +"CPU 密集型的工作卸載給執行緒池或行程池,但這仍然受限於 CPython 中的\\ :term:`" +"全域直譯器鎖 `。" #: ../../library/asyncio-threading.rst:15 msgid "" @@ -35,6 +39,9 @@ msgid "" "asyncio can now take advantage of multiple CPU cores without the limitations " "imposed by the GIL." msgstr "" +"然而,在\\ :ref:`自由執行緒 Python `\\ 中,GIL 會" +"被停用,Python 能夠執行真正的多執行緒程式碼。這代表 asyncio 現在可以在不受 " +"GIL 限制的情況下,充分利用多個 CPU 核心。" #: ../../library/asyncio-threading.rst:20 msgid "" @@ -42,6 +49,8 @@ msgid "" "and the implementation of asyncio is safe to use in a multi-threaded " "environment." msgstr "" +"自 Python 3.14 起,asyncio 提供了對自由執行緒 Python 的完整支援,且 asyncio " +"的實作在多執行緒環境中可安全使用。" #: ../../library/asyncio-threading.rst:24 msgid "" @@ -54,6 +63,12 @@ msgid "" "multiple CPU cores. It is also useful when you need to run blocking or CPU-" "bound code from an asyncio application." msgstr "" +"在單一核心上運行的單一事件迴圈可以同時處理許多個連線,但用來處理每個連線的 " +"Python 程式碼仍然是依序執行的。一旦每個請求所需的運算量變得不小,這種處理方式" +"就會成為瓶頸,單一核心也就無法再負荷。此時將 asyncio 與執行緒結合會特別有用:" +"透過每個執行緒各自運行一個事件迴圈,不同請求的處理便能在多個 CPU 核心上平行執" +"行。當你需要在 asyncio 應用程式中執行阻塞或 CPU 密集型程式碼時,這種做法也很" +"有幫助。" #: ../../library/asyncio-threading.rst:37 msgid "" @@ -63,10 +78,14 @@ msgid "" "under free-threaded Python, together with benchmarks of the resulting " "improvements." msgstr "" +"`Scaling asyncio on Free-Threaded Python `__,這是 Kumar Aditya 撰寫的部落格文" +"章,說明了讓 asyncio 在自由執行緒 Python 下保持安全與高效的內部變更,並附上改" +"善成果的效能基準測試。" #: ../../library/asyncio-threading.rst:45 msgid "Thread safety considerations" -msgstr "" +msgstr "執行緒安全考量" #: ../../library/asyncio-threading.rst:47 msgid "" @@ -74,6 +93,8 @@ msgid "" "environment, there are still some considerations to keep in mind when using " "asyncio with threads:" msgstr "" +"雖然 asyncio 在自由執行緒 Python 環境中被設計為執行緒安全,但在搭配執行緒使" +"用 asyncio 時,仍有一些注意事項:" #: ../../library/asyncio-threading.rst:51 msgid "" @@ -81,12 +102,16 @@ msgid "" "be shared across threads. This ensures that the event loop can manage its " "own tasks and callbacks without interference from other threads." msgstr "" +"**事件迴圈**:每個執行緒都應該有自己的事件迴圈,且不應在多個執行緒之間共用。" +"這可以確保事件迴圈能夠管理自己的任務和回呼,而不受其他執行緒的干擾。" #: ../../library/asyncio-threading.rst:56 msgid "" "**Task management**: Tasks and futures created in one thread should not be " "awaited or manipulated from another thread." msgstr "" +"**任務管理**:在一個執行緒中建立的任務和 Future 不應該在另一個執行緒中被等待" +"或操作。" #: ../../library/asyncio-threading.rst:59 msgid "" @@ -96,6 +121,10 @@ msgid "" "loop from another thread. If you need to call a callback from a different " "thread, you can use :meth:`loop.call_soon_threadsafe` to schedule it safely." msgstr "" +"**執行緒安全的 API**:從多個執行緒與 asyncio 互動時,使用 asyncio 提供的執行" +"緒安全 API 相當重要,例如使用 :func:`asyncio.run_coroutine_threadsafe` 從另一" +"個執行緒向事件迴圈提交協程。如果你需要從不同的執行緒呼叫回呼函式,可以使用 :" +"meth:`loop.call_soon_threadsafe` 來安全地排程該回呼。" #: ../../library/asyncio-threading.rst:66 msgid "" @@ -105,10 +134,13 @@ msgid "" "should use the synchronization primitives from the :mod:`threading` module " "instead." msgstr "" +"**同步**:asyncio 提供的同步原語(例如 :class:`asyncio.Lock` 和 :class:" +"`asyncio.Event`)並不是設計來跨執行緒使用的。如果你需要在執行緒之間進行同步," +"應該改用 :mod:`threading` 模組提供的同步原語。" #: ../../library/asyncio-threading.rst:74 msgid "Using asyncio with threads" -msgstr "" +msgstr "搭配執行緒使用 asyncio" #: ../../library/asyncio-threading.rst:76 msgid "" @@ -117,10 +149,13 @@ msgid "" "thread can run its own event loop, and tasks can be scheduled on those loops " "independently." msgstr "" +"asyncio 支援每個執行緒各自運行一個事件迴圈,這讓你可以在自由執行緒 Python 環" +"境中充分利用多個 CPU 核心。每個執行緒都可以運行自己的事件迴圈,且任務可以獨立" +"地被排程到這些事件迴圈上。" #: ../../library/asyncio-threading.rst:81 msgid "Here's an example of how to use asyncio with threads::" -msgstr "" +msgstr "以下是如何搭配執行緒使用 asyncio 的範例: ::" #: ../../library/asyncio-threading.rst:83 msgid "" @@ -144,6 +179,25 @@ msgid "" "for t in threads:\n" " t.join()" msgstr "" +"import asyncio\n" +"import threading\n" +"\n" +"async def worker(name: str) -> None:\n" +" print(f\"Worker {name} starting\")\n" +" await asyncio.sleep(1)\n" +" print(f\"Worker {name} done\")\n" +"\n" +"def run_loop(name: str) -> None:\n" +" asyncio.run(worker(name))\n" +"\n" +"threads = [\n" +" threading.Thread(target=run_loop, args=(f\"T{i}\",))\n" +" for i in range(4)\n" +"]\n" +"for t in threads:\n" +" t.start()\n" +"for t in threads:\n" +" t.join()" #: ../../library/asyncio-threading.rst:103 msgid "" @@ -151,10 +205,13 @@ msgid "" "run` and runs a coroutine on it. The threads execute concurrently, and in a " "free-threaded build they can run on separate CPU cores in parallel." msgstr "" +"在這個範例中,每個執行緒都使用 :func:`asyncio.run` 建立自己的事件迴圈,並在其" +"上運行一個協程。這些執行緒會並行執行,而在自由執行緒建置版本中,它們可以在不" +"同的 CPU 核心上平行運行。" #: ../../library/asyncio-threading.rst:110 msgid "Producer/consumer across threads" -msgstr "" +msgstr "跨執行緒的生產者/消費者" #: ../../library/asyncio-threading.rst:112 msgid "" @@ -163,6 +220,9 @@ msgid "" "`queue.Queue` rather than :class:`asyncio.Queue`, which is only safe within " "a single event loop.::" msgstr "" +"當一個普通(非 asyncio)的執行緒需要將工作交給在另一個執行緒中運行的 asyncio " +"事件迴圈時,應該使用像 :class:`queue.Queue` 這樣的執行緒安全原語,而不是只在" +"單一事件迴圈中才安全的 :class:`asyncio.Queue`。 ::" #: ../../library/asyncio-threading.rst:117 msgid "" @@ -196,6 +256,35 @@ msgid "" "producer(q)\n" "consumer_thread.join()" msgstr "" +"import asyncio\n" +"import queue\n" +"import threading\n" +"\n" +"def producer(q: queue.Queue[int]) -> None:\n" +" for i in range(5):\n" +" print(f\"Producing {i}\")\n" +" q.put(i)\n" +" q.shutdown()\n" +"\n" +"async def consumer(q: queue.Queue[int]) -> None:\n" +" while True:\n" +" try:\n" +" item = q.get_nowait()\n" +" except queue.Empty:\n" +" await asyncio.sleep(0.1)\n" +" continue\n" +" except queue.ShutDown:\n" +" break\n" +" print(f\"Consumed {item}\")\n" +" await asyncio.sleep(item)\n" +"\n" +"q: queue.Queue[int] = queue.Queue()\n" +"consumer_thread = threading.Thread(\n" +" target=lambda: asyncio.run(consumer(q))\n" +")\n" +"consumer_thread.start()\n" +"producer(q)\n" +"consumer_thread.join()" #: ../../library/asyncio-threading.rst:147 msgid "" @@ -206,3 +295,7 @@ msgid "" "subsequent :meth:`~queue.Queue.get_nowait` calls to raise :exc:`queue." "ShutDown` so the consumer can exit cleanly." msgstr "" +"生產者運行在主執行緒上,而消費者則在自己執行緒中的事件迴圈裡運行,但兩者能透" +"過 ``queue.Queue`` 安全地通訊。當佇列為空時,消費者會短暫休眠後再重試。當生產" +"者完成時,它會呼叫 :meth:`~queue.Queue.shutdown`,這會使後續的 :meth:`~queue." +"Queue.get_nowait` 呼叫引發 :exc:`queue.ShutDown`,讓消費者能夠乾淨地結束。" diff --git a/library/codecs.po b/library/codecs.po index 5efecefc9f7..0e3f32f780a 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -2430,6 +2430,8 @@ msgid "" "The decoding and encoding algorithms scale poorly, so limit the length of " "untrusted input." msgstr "" +"此解碼和編碼演算法的效能會隨輸入變大而急遽變差,因此請限制不受信任輸入的長" +"度。" #: ../../library/codecs.rst:1408 msgid "raw_unicode_escape" diff --git a/library/collections.abc.po b/library/collections.abc.po index f5d30db6dda..efe1da343db 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -822,6 +822,10 @@ msgid "" "using mixins, inherit from both :class:`Set` and :class:`Hashable`, then " "define ``__hash__ = Set._hash``." msgstr "" +":class:`Set` mixin 提供了 :meth:`!_hash` 方法來計算集合的雜湊值;然而,由於並" +"非所有集合都是 :term:`hashable` 或不可變的,因此並未定義 :meth:`~object." +"__hash__`。若要使用 mixin 為集合加入可雜湊性,請同時繼承 :class:`Set` 和 :" +"class:`Hashable`,然後定義 ``__hash__ = Set._hash``。" #: ../../library/collections.abc.rst:467 msgid "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 1badabc09fe..0a1e171add7 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -705,6 +705,8 @@ msgid "" "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" +"*max_workers* 預設使用 :func:`os.process_cpu_count`,而非 :func:`os." +"cpu_count`。" #: ../../library/concurrent.futures.rst:418 msgid "" @@ -713,6 +715,9 @@ msgid "" "`ProcessPoolExecutor` you must explicitly pass ``mp_context=multiprocessing." "get_context(\"fork\")``." msgstr "" +"預設的行程啟動方法(參閱 :ref:`multiprocessing-start-methods`)已不再使用 " +"*fork*。如果你需要讓 :class:`ProcessPoolExecutor` 使用 *fork* 啟動方法,必須" +"明確傳入 ``mp_context=multiprocessing.get_context(\"fork\")``。" #: ../../library/concurrent.futures.rst:424 msgid "" @@ -720,6 +725,8 @@ msgid "" "process exited upon reaching its *max_tasks_per_child* limit while tasks " "remained queued." msgstr "" +"修正了一個死鎖問題 (:gh:`115634`):當工作行程因達到 *max_tasks_per_child* 上" +"限而結束、但仍有任務在佇列中等待時,executor 可能會卡住。" #: ../../library/concurrent.futures.rst:431 msgid "" diff --git a/library/csv.po b/library/csv.po index fc796096834..ee81f538b8f 100644 --- a/library/csv.po +++ b/library/csv.po @@ -148,13 +148,15 @@ msgstr "" #: ../../library/csv.rst:86 msgid "where :file:`eggs.csv` contains:" -msgstr "" +msgstr "其中 :file:`eggs.csv` 包含:" #: ../../library/csv.rst:88 ../../library/csv.rst:124 msgid "" "Spam Spam Spam Spam Spam |Baked Beans|\n" "Spam |Lovely Spam| |Wonderful Spam|" msgstr "" +"Spam Spam Spam Spam Spam |Baked Beans|\n" +"Spam |Lovely Spam| |Wonderful Spam|" #: ../../library/csv.rst:96 msgid "" @@ -206,7 +208,7 @@ msgstr "" #: ../../library/csv.rst:122 msgid "which writes :file:`eggs.csv` containing:" -msgstr "" +msgstr "這會寫入 :file:`eggs.csv`,其內容為:" #: ../../library/csv.rst:132 msgid "" @@ -339,7 +341,7 @@ msgstr "" #: ../../library/csv.rst:210 msgid "where :file:`names.csv` contains:" -msgstr "" +msgstr "其中 :file:`names.csv` 包含:" #: ../../library/csv.rst:212 msgid "" @@ -347,6 +349,9 @@ msgid "" "Eric,Idle\n" "John,Cleese" msgstr "" +"first_name,last_name\n" +"Eric,Idle\n" +"John,Cleese" #: ../../library/csv.rst:222 msgid "" @@ -407,7 +412,7 @@ msgstr "" #: ../../library/csv.rst:255 msgid "which writes :file:`names.csv` containing:" -msgstr "" +msgstr "這會寫入 :file:`names.csv`,其內容為:" #: ../../library/csv.rst:257 msgid "" @@ -416,6 +421,10 @@ msgid "" "Lovely,Spam\n" "Wonderful,Spam" msgstr "" +"first_name,last_name\n" +"Baked,Beans\n" +"Lovely,Spam\n" +"Wonderful,Spam" #: ../../library/csv.rst:267 msgid "" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 62a5aa98c91..a649987e78c 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -211,7 +211,7 @@ msgstr "" #: ../../library/curses.ascii.rst:120 msgid "Checks for an ASCII blank character; space or horizontal tab." -msgstr "" +msgstr "檢查是否為 ASCII 空白字元;空格或水平定位字元。" #: ../../library/curses.ascii.rst:125 msgid "" @@ -226,7 +226,7 @@ msgstr "" #: ../../library/curses.ascii.rst:136 msgid "Checks for any ASCII printable character except space." -msgstr "" +msgstr "檢查是否為除了空格以外的任何 ASCII 可列印字元。" #: ../../library/curses.ascii.rst:141 msgid "Checks for an ASCII lower-case character." @@ -240,7 +240,7 @@ msgstr "" msgid "" "Checks for any ASCII printable character which is not a space or an " "alphanumeric character." -msgstr "" +msgstr "檢查是否為既非空格、也非字母數字字元的任何 ASCII 可列印字元。" #: ../../library/curses.ascii.rst:157 msgid "" @@ -263,6 +263,8 @@ msgid "" "Checks for an ASCII control character (ordinal values 0 to 31). Unlike :" "func:`iscntrl`, this does not include the delete character (0x7f)." msgstr "" +"檢查是否為 ASCII 控制字元(序數值 0 到 31)。與 :func:`iscntrl` 不同的是,這" +"不包括刪除字元(0x7f)。" #: ../../library/curses.ascii.rst:180 msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." diff --git a/library/curses.panel.po b/library/curses.panel.po index f28a9d6756e..92987d33d49 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -47,6 +47,9 @@ msgid "" "keep the returned panel object referenced explicitly. If you don't, the " "panel object is garbage collected and removed from the panel stack." msgstr "" +"回傳一個面板物件,將其與給定的視窗 *win* 建立關聯,並將新面板放置在面板堆疊的" +"最上層。請注意,你需要明確地保留對回傳面板物件的參照;如果不這樣做,該面板物" +"件將被垃圾回收並從面板堆疊中移除。" #: ../../library/curses.panel.rst:39 msgid "Returns the top panel in the panel stack." @@ -60,7 +63,7 @@ msgstr "" #: ../../library/curses.panel.rst:51 msgid "Panel objects" -msgstr "" +msgstr "面板物件" #: ../../library/curses.panel.rst:53 msgid "" @@ -115,7 +118,7 @@ msgstr "" msgid "" "Display the panel (which might have been hidden), placing it on top of the " "panel stack." -msgstr "" +msgstr "顯示該面板(可能已被隱藏),並將其放置在面板堆疊的最上層。" #: ../../library/curses.panel.rst:111 msgid "Push panel to the top of the stack." diff --git a/library/curses.po b/library/curses.po index 5286f40f5d8..ea434184351 100644 --- a/library/curses.po +++ b/library/curses.po @@ -152,7 +152,7 @@ msgstr "" #: ../../library/curses.rst:86 msgid "This is an ncurses extension." -msgstr "" +msgstr "這是一個 ncurses 擴充功能。" #: ../../library/curses.rst:93 msgid "" @@ -190,6 +190,10 @@ msgid "" "will be between ``0`` (no component) and ``1000`` (maximum amount of " "component). Raise an exception if the color is not supported." msgstr "" +"回傳顏色 *color_number* 中紅色、綠色和藍色(RGB)分量的強度,其值必須介於 " +"``0`` 和 ``COLORS - 1`` 之間。回傳一個 3 元組,其中包含給定顏色的 R、G、B " +"值,數值介於 ``0``\\ (無此分量)和 ``1000``\\ (該分量的最大值)之間。如果不" +"支援該顏色,則引發例外。" #: ../../library/curses.rst:130 msgid "" @@ -236,6 +240,9 @@ msgid "" "representing the desired next state. The :func:`doupdate` function updates " "the physical screen to match the virtual screen." msgstr "" +"更新實體螢幕。curses 函式庫保留兩個資料結構,一個代表目前的實體螢幕內容,另一" +"個是代表所需下一個狀態的虛擬螢幕。:func:`doupdate` 函式會更新實體螢幕以符合虛" +"擬螢幕。" #: ../../library/curses.rst:174 msgid "" @@ -275,6 +282,11 @@ msgid "" "current line, and so are screen updates. This may be used for enabling " "character-at-a-time line editing without touching the rest of the screen." msgstr "" +":func:`.filter` 常式(如果使用)必須在呼叫 :func:`initscr` 之前呼叫。其效果" +"是,在初始化期間,:envvar:`LINES` 會被設為 ``1``;``clear``、``cup``、" +"``cud``、``cud1``、``cuu1``、``cuu``、``vpa`` 等功能會被停用;且 ``home`` 字" +"串會被設為 ``cr`` 的值。其效果是游標被限制在目前行內,螢幕更新也是如此。這可" +"用於在不影響螢幕其餘部分的情況下,啟用逐字元的行編輯功能。" #: ../../library/curses.rst:212 msgid "" @@ -324,6 +336,9 @@ msgid "" "that data, returning the new window object. The *file* argument must be a " "file object opened for reading in binary mode." msgstr "" +"讀取先前透過 :meth:`window.putwin` 呼叫儲存在檔案中的視窗相關資料。此常式接著" +"會使用該資料建立並初始化一個新視窗,並回傳新的視窗物件。*file* 引數必須是以二" +"進位模式開啟以供讀取的檔案物件。" #: ../../library/curses.rst:257 msgid "" @@ -337,6 +352,8 @@ msgid "" "``False``. Extended color support allows more than 256 color pairs for " "terminals that support more than 16 colors (for example, xterm-256color)." msgstr "" +"如果模組支援延伸色彩,則回傳 ``True``;否則回傳 ``False``。延伸色彩支援讓支援" +"超過 16 種顏色的終端機(例如 xterm-256color)能使用超過 256 組色彩對。" #: ../../library/curses.rst:265 msgid "Extended color support requires ncurses version 6.1 or later." @@ -407,7 +424,7 @@ msgstr "" #: ../../library/curses.rst:330 msgid "" "See :func:`setupterm` for a caveat about calling it before this function." -msgstr "" +msgstr "請參閱 :func:`setupterm`,以了解在呼叫此函式之前呼叫它的相關注意事項。" #: ../../library/curses.rst:334 msgid "" @@ -421,6 +438,8 @@ msgid "" "will flush all output in the terminal driver queue. If *flag* is ``False``, " "no flushing is done." msgstr "" +"如果 *flag* 為 ``True``,按下中斷鍵(interrupt、break 或 quit)將清空終端機驅" +"動程式佇列中的所有輸出。如果 *flag* 為 ``False``,則不會執行清空動作。" #: ../../library/curses.rst:347 msgid "" @@ -447,7 +466,7 @@ msgstr "" #: ../../library/curses.rst:366 msgid "Raise a :exc:`ValueError` if *k* is negative." -msgstr "" +msgstr "如果 *k* 為負數,則引發 :exc:`ValueError`。" #: ../../library/curses.rst:371 msgid "" @@ -477,6 +496,9 @@ msgid "" "sixth of a second. Use a negative *interval* to obtain the interval value " "without changing it." msgstr "" +"設定按下與放開事件之間可經過的最長時間(以毫秒為單位),以便將其識別為一次點" +"擊,並回傳先前的間隔值。預設值為 166 毫秒,即六分之一秒。使用負值的 " +"*interval* 可在不變更該值的情況下取得目前的間隔值。" #: ../../library/curses.rst:399 msgid "" @@ -486,6 +508,9 @@ msgid "" "previous value of the mouse event mask. If this function is never called, " "no mouse events are ever reported." msgstr "" +"設定要回報的滑鼠事件,並回傳一個元組 ``(availmask, oldmask)``。*availmask* 表" +"示指定的滑鼠事件中哪些可以被回報;若完全失敗則回傳 ``0``。*oldmask* 是先前的" +"滑鼠事件遮罩值。如果從未呼叫此函式,則永遠不會回報任何滑鼠事件。" #: ../../library/curses.rst:408 msgid "Sleep for *ms* milliseconds." @@ -512,6 +537,13 @@ msgid "" "arguments define a clipping box on the screen within which the pad region is " "to be displayed." msgstr "" +"pad 就像視窗一樣,只是它不受螢幕大小的限制,也不一定與螢幕的特定部分相關聯。" +"當需要一個大視窗,但同一時間只有其中一部分會顯示在螢幕上時,就可以使用 pad。" +"pad 不會自動重新整理(例如因捲動或輸入回顯而觸發)。pad 的 :meth:`~window." +"refresh` 和 :meth:`~window.noutrefresh` 方法需要 6 個引數,以指定要顯示的 " +"pad 部分,以及螢幕上用於顯示的位置。這些引數為 *pminrow*、*pmincol*、" +"*sminrow*、*smincol*、*smaxrow*、*smaxcol*;*p* 開頭的引數表示要顯示的 pad 區" +"域左上角座標,*s* 開頭的引數則定義螢幕上用來顯示該 pad 區域的裁切框。" #: ../../library/curses.rst:432 msgid "" @@ -534,7 +566,7 @@ msgstr "" #: ../../library/curses.rst:445 msgid "If *flag* is ``False``, the effect is the same as calling :func:`nonl`." -msgstr "" +msgstr "如果 *flag* 為 ``False``,其效果與呼叫 :func:`nonl` 相同。" #: ../../library/curses.rst:450 msgid "" @@ -592,7 +624,7 @@ msgstr "" #: ../../library/curses.rst:652 ../../library/curses.rst:662 #: ../../library/curses.rst:672 msgid ":func:`setupterm` (or :func:`initscr`) must be called first." -msgstr "" +msgstr "必須先呼叫 :func:`setupterm`\\ (或 :func:`initscr`)。" #: ../../library/curses.rst:504 msgid "" @@ -691,6 +723,8 @@ msgid "" "terminfo database entry could not be read. If the terminal has already been " "initialized, this function has no effect." msgstr "" +"如果找不到終端機,或無法讀取其 terminfo 資料庫項目,則引發 :exc:`curses." +"error`。如果終端機已經初始化,則此函式不會有任何作用。" #: ../../library/curses.rst:603 msgid "" @@ -698,6 +732,9 @@ msgid "" "func:`setupterm` allocated: the curses library keeps only a single current " "terminal and does not free the previously allocated one." msgstr "" +"在呼叫 :func:`setupterm` 之後呼叫 :func:`initscr` 會導致 :func:`setupterm` 配" +"置的終端機發生洩漏:curses 函式庫僅會保留單一個目前的終端機,並不會釋放先前配" +"置的那一個。" #: ../../library/curses.rst:611 msgid "" @@ -761,6 +798,9 @@ msgid "" "``b'\\033[6;4H'``, the exact result depending on terminal type. Up to nine " "integer parameters may be supplied." msgstr "" +"使用提供的參數實例化位元組物件 *str*,其中 *str* 應為從 terminfo 資料庫取得的" +"參數化字串。例如,``tparm(tigetstr(\"cup\"), 5, 3)`` 可能會得到 " +"``b'\\033[6;4H'``,實際結果取決於終端機類型。最多可提供九個整數參數。" #: ../../library/curses.rst:677 msgid "" @@ -844,7 +884,7 @@ msgstr "" #: ../../library/curses.rst:759 msgid "Window objects" -msgstr "" +msgstr "視窗物件" #: ../../library/curses.rst:763 msgid "" @@ -865,6 +905,8 @@ msgid "" "Attempting to write to the lower-right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" +"在視窗、子視窗或 pad 之外寫入會引發 :exc:`curses.error`。嘗試寫入視窗、子視窗" +"或 pad 的右下角時,會在該字元印出後引發例外。" #: ../../library/curses.rst:784 msgid "" @@ -884,6 +926,8 @@ msgid "" "Attempting to write to the lower-right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" +"在視窗、子視窗或 pad 之外寫入會引發 :exc:`curses.error`。嘗試寫入視窗、子視窗" +"或 pad 的右下角時,會在該字串印出後引發例外。" #: ../../library/curses.rst:801 msgid "" @@ -893,6 +937,10 @@ msgid "" "meth:`!addstr` with a *str* that has embedded newlines; instead, call :meth:" "`!addstr` separately for each line." msgstr "" +"此 Python 模組後端 ncurses 中的一個錯誤,可能會在調整視窗大小時導致 " +"segfault。此問題已在 ncurses-6.1-20190511 中修正。如果你仍在使用較舊版本的 " +"ncurses,可以透過不對含有內嵌換行字元的 *str* 呼叫 :meth:`!addstr` 來避免觸發" +"此問題;改為針對每一行分別呼叫 :meth:`!addstr`。" #: ../../library/curses.rst:810 msgid "" @@ -1106,6 +1154,8 @@ msgid "" "Delete the character under the cursor, or at ``(y, x)`` if specified. All " "characters to the right on the same line are shifted one position left." msgstr "" +"刪除游標所在位置的字元,若有指定則刪除 ``(y, x)`` 位置的字元。同一行中右側的" +"所有字元都會向左移動一個位置。" #: ../../library/curses.rst:938 msgid "" @@ -1156,11 +1206,12 @@ msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." msgstr "回傳左上角的座標 ``(y, x)``。" #: ../../library/curses.rst:989 -#, fuzzy msgid "" "Return the given window's current background character/attribute pair. Its " "components can be extracted like those of :meth:`inch`." -msgstr "回傳給定視窗目前的背景字元/屬性對。" +msgstr "" +"回傳給定視窗目前的背景字元/屬性對。其組成部分可以像 :meth:`inch` 的結果一樣被" +"提取出來。" #: ../../library/curses.rst:995 msgid "" @@ -1201,6 +1252,8 @@ msgid "" "Read a bytes object from the user, with primitive line editing capacity. At " "most *n* characters are read; *n* defaults to and cannot exceed 2047." msgstr "" +"從使用者處讀取一個位元組物件,具備基本的行編輯功能。最多讀取 *n* 個字元;*n* " +"預設且不能超過 2047。" #: ../../library/curses.rst:1039 ../../library/curses.rst:1140 msgid "The maximum value for *n* was increased from 1023 to 2047." @@ -1218,6 +1271,8 @@ msgid "" "of the character *ch* with attributes *attr*. The line stops at the right " "edge of the window if fewer than *n* cells are available." msgstr "" +"從 ``(y, x)`` 開始顯示一條長度為 *n* 的水平線,由具有屬性 *attr* 的字元 *ch* " +"組成。如果可用的儲存格數少於 *n* 個,該線會在視窗右緣停止。" #: ../../library/curses.rst:1059 msgid "" @@ -1232,6 +1287,8 @@ msgid "" "If *flag* is ``True``, :mod:`!curses` will try to use hardware line editing " "facilities. Otherwise, curses will not use them." msgstr "" +"如果 *flag* 為 ``True``,:mod:`!curses` 將嘗試使用硬體行編輯功能。否則," +"curses 將不會使用這些功能。" #: ../../library/curses.rst:1073 msgid "" @@ -1248,6 +1305,9 @@ msgid "" "with the :data:`A_CHARTEXT` and :data:`A_ATTRIBUTES` bit-masks, and the " "color pair with :func:`pair_number`." msgstr "" +"回傳視窗中給定位置的字元。最低的 8 位元是字元本身,較高位元則是屬性;可分別使" +"用 :data:`A_CHARTEXT` 和 :data:`A_ATTRIBUTES` 位元遮罩取出,並使用 :func:" +"`pair_number` 取出色彩對。" #: ../../library/curses.rst:1090 msgid "" @@ -1256,6 +1316,9 @@ msgid "" "cursor are shifted one position right, with the rightmost character on the " "line being lost. The cursor position does not change." msgstr "" +"在游標所在位置的字元之前插入具有屬性 *attr* 的字元 *ch*,若有指定則插入到 " +"``(y, x)`` 位置。游標右側的所有字元都會向右移動一個位置,該行最右側的字元將會" +"遺失。游標位置不會改變。" #: ../../library/curses.rst:1098 msgid "" @@ -1300,6 +1363,10 @@ msgid "" "characters long (exclusive of the trailing NUL). The maximum value for *n* " "is 2047." msgstr "" +"回傳一個位元組物件,內容為從目前游標位置(若有指定則為 *y*、*x* 位置)開始擷" +"取的字元,直到該行結尾為止。字元的屬性和色彩資訊會被移除。如果有指定 *n*,:" +"meth:`instr` 會回傳最多 *n* 個字元長的字串(不含結尾的 NUL)。*n* 的最大值為 " +"2047。" #: ../../library/curses.rst:1146 msgid "" @@ -1326,6 +1393,8 @@ msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible." msgstr "" +"如果 *flag* 為 ``True``,更新時游標會保留在原處,而不是移到「游標位置」。這樣" +"可以盡可能減少游標的移動。" #: ../../library/curses.rst:1169 msgid "" @@ -1353,6 +1422,8 @@ msgid "" "Moving the window so that any part of it would be off the screen is an " "error: the window is not moved and :exc:`curses.error` is raised." msgstr "" +"若移動視窗會使其任何部分超出螢幕範圍,則視為錯誤:視窗將不會被移動,並會引" +"發 :exc:`curses.error`。" #: ../../library/curses.rst:1194 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." @@ -1381,6 +1452,8 @@ msgid "" "window is a pad created with :func:`newpad`; they have the same meaning as " "for :meth:`refresh`." msgstr "" +"這 6 個引數只有在視窗是使用 :func:`newpad` 建立的 pad 時才能指定,且此時為必" +"要引數;它們的意義與 :meth:`refresh` 中的相同。" #: ../../library/curses.rst:1219 msgid "" @@ -1452,6 +1525,12 @@ msgid "" "Negative values of *pminrow*, *pmincol*, *sminrow*, or *smincol* are treated " "as if they were zero." msgstr "" +"這 6 個引數只有在視窗是使用 :func:`newpad` 建立的 pad 時才能指定,且此時為必" +"要引數。這些額外的參數用於指出涉及 pad 和螢幕的哪個部分。*pminrow* 和 " +"*pmincol* 指定要在 pad 中顯示的矩形左上角。*sminrow*、*smincol*、*smaxrow* " +"和 *smaxcol* 指定要在螢幕上顯示的矩形邊界。由於兩個矩形的大小必須相同,pad 中" +"要顯示的矩形右下角會由螢幕座標計算得出。兩個矩形都必須完全包含在各自的結構" +"內。*pminrow*、*pmincol*、*sminrow* 或 *smincol* 的負值會被視為零。" #: ../../library/curses.rst:1280 msgid "" @@ -1467,6 +1546,9 @@ msgid "" "*lines* is positive, or downward if it is negative. Scrolling has no effect " "unless it has been enabled for the window with :meth:`scrollok`." msgstr "" +"捲動螢幕或捲動區域。如果 *lines* 為正值,則向上捲動 *lines* 行;如果為負值," +"則向下捲動。除非已使用 :meth:`scrollok` 為該視窗啟用捲動功能,否則捲動不會產" +"生任何效果。" #: ../../library/curses.rst:1295 msgid "" @@ -1501,6 +1583,9 @@ msgid "" "parent pad (unlike :meth:`subwin`, which uses screen coordinates). This " "method is only available for pads created with :func:`newpad`." msgstr "" +"回傳一個子 pad,其左上角位於 ``(begin_y, begin_x)``,寬度/高度為 *ncols*/" +"*nlines*。座標是相對於父 pad 而言(不同於 :meth:`subwin`,後者使用的是螢幕座" +"標)。此方法僅適用於以 :func:`newpad` 建立的 pad。" #: ../../library/curses.rst:1332 msgid "" @@ -1508,6 +1593,8 @@ msgid "" "coordinates ``(begin_y, begin_x)``, and whose width/height is *ncols*/" "*nlines*." msgstr "" +"回傳一個子視窗,其左上角位於螢幕相對座標 ``(begin_y, begin_x)``,寬度/高度為 " +"*ncols*/*nlines*。" #: ../../library/curses.rst:1335 msgid "" @@ -1624,6 +1711,8 @@ msgid "" "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" +"螢幕的寬度,也就是欄數。僅在呼叫 :func:`initscr` 之後才會被定義。會由 :func:" +"`update_lines_cols`、:func:`resizeterm` 和 :func:`resize_term` 更新。" #: ../../library/curses.rst:1447 msgid "" @@ -1631,6 +1720,8 @@ msgid "" "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" +"螢幕的高度,也就是行數。僅在呼叫 :func:`initscr` 之後才會被定義。會由 :func:" +"`update_lines_cols`、:func:`resizeterm` 和 :func:`resize_term` 更新。" #: ../../library/curses.rst:1453 msgid "" @@ -2218,7 +2309,7 @@ msgstr "" #: ../../library/curses.rst:1750 msgid "alternate name for upper-right corner" -msgstr "" +msgstr "右上角的替代名稱" #: ../../library/curses.rst:1752 msgid "solid square block" @@ -2286,11 +2377,11 @@ msgstr "" #: ../../library/curses.rst:1784 msgid "lower-left corner" -msgstr "" +msgstr "左下角" #: ../../library/curses.rst:1786 msgid "lower-right corner" -msgstr "" +msgstr "右下角" #: ../../library/curses.rst:1788 msgid "left tee" @@ -2338,7 +2429,7 @@ msgstr "" #: ../../library/curses.rst:1810 msgid "alternate name for lower-right corner" -msgstr "" +msgstr "右下角的替代名稱" #: ../../library/curses.rst:1812 msgid "alternate name for vertical line" @@ -2350,7 +2441,7 @@ msgstr "" #: ../../library/curses.rst:1816 msgid "alternate name for lower-left corner" -msgstr "" +msgstr "左下角的替代名稱" #: ../../library/curses.rst:1818 msgid "alternate name for bottom tee" @@ -2378,11 +2469,11 @@ msgstr "" #: ../../library/curses.rst:1830 msgid "upper-left corner" -msgstr "" +msgstr "左上角" #: ../../library/curses.rst:1832 msgid "upper-right corner" -msgstr "" +msgstr "右上角" #: ../../library/curses.rst:1834 msgid "vertical line" @@ -2427,7 +2518,7 @@ msgstr "" #: ../../library/curses.rst:1856 msgid "Alt was down during button state change" -msgstr "" +msgstr "按鈕狀態變更時 Alt 鍵處於按下狀態" #: ../../library/curses.rst:1863 msgid "The following table lists the predefined colors:" @@ -2498,6 +2589,10 @@ msgid "" "(including xterm and most other software terminal emulators). Otherwise it " "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" +"繪製一個矩形。第一個引數必須是視窗物件;其餘引數是相對於該視窗的座標。第二個" +"和第三個引數是要繪製矩形左上角的 y 和 x 座標;第四個和第五個引數是右下角的 y " +"和 x 座標。在支援的終端機(包括 xterm 和大多數其他軟體終端機模擬器)上,矩形" +"會使用 VT100/IBM PC 表單字元繪製。否則會使用 ASCII 破折號、直線和加號繪製。" #: ../../library/curses.rst:1919 msgid "Textbox objects" @@ -2517,6 +2612,10 @@ msgid "" "containing window, with coordinates ``(0, 0)``. The instance's :attr:" "`stripspaces` flag is initially on." msgstr "" +"回傳一個文字框元件物件。*win* 引數應為容納此文字框的 curses :ref:`視窗 " +"` 物件。如果 *insert_mode* 為 true,文字框會插入輸入的" +"字元,將現有文字向右移動,而不是覆蓋它。文字框的編輯游標初始位置在容納視窗的" +"左上角,座標為 ``(0, 0)``。該實例的 :attr:`stripspaces` 旗標初始為開啟狀態。" #: ../../library/curses.rst:1934 msgid ":class:`Textbox` objects have the following methods:" @@ -2532,6 +2631,11 @@ msgid "" "This method returns the window contents as a string; whether blanks in the " "window are included is affected by the :attr:`stripspaces` attribute." msgstr "" +"這是你通常會使用的進入點。它會接受編輯按鍵,直到輸入其中一個終止按鍵為止。如" +"果有提供 *validate*,它必須是一個函式。每輸入一個按鍵,就會以該按鍵作為參數呼" +"叫它一次;命令的分派是根據其回傳結果進行的。如果它回傳假值,該按鍵將被忽略。" +"此方法會以字串形式回傳視窗內容;視窗中的空白是否會被包含在內,則受 :attr:" +"`stripspaces` 屬性影響。" #: ../../library/curses.rst:1951 msgid "" @@ -2539,6 +2643,8 @@ msgid "" "``0`` if a termination keystroke was processed. Here are the supported " "special keystrokes:" msgstr "" +"處理單一個命令按鍵。若要繼續編輯則回傳 ``1``,若已處理終止按鍵則回傳 ``0``。" +"以下是支援的特殊按鍵:" #: ../../library/curses.rst:1956 ../../library/curses.rst:1995 msgid "Keystroke" @@ -2612,7 +2718,7 @@ msgstr ":kbd:`Control-J`" msgid "" "Terminate if the window is 1 line, otherwise move to the start of the next " "line." -msgstr "" +msgstr "如果視窗只有 1 行則終止,否則移動到下一行的開頭。" #: ../../library/curses.rst:1979 msgid ":kbd:`Control-K`" diff --git a/library/dataclasses.po b/library/dataclasses.po index dcfc903aa6f..14122c04fe7 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -24,7 +24,6 @@ msgid "**Source code:** :source:`Lib/dataclasses.py`" msgstr "**原始碼:**\\ :source:`Lib/dataclasses.py`" #: ../../library/dataclasses.rst:14 -#, fuzzy msgid "" "This module provides a decorator and functions for automatically adding " "generated :term:`special methods ` such as :meth:`~object." @@ -36,7 +35,6 @@ msgstr "" "定義的類別。它最初在 :pep:`557` 中描述。" #: ../../library/dataclasses.rst:19 -#, fuzzy msgid "" "The member variables to use in these generated methods are defined using :" "pep:`526` type annotations. For example, this code::" @@ -60,7 +58,6 @@ msgid "" msgstr "" #: ../../library/dataclasses.rst:34 -#, fuzzy msgid "will add, among other things, a :meth:`!__init__` that looks like::" msgstr "將新增,除其他事項外,一個 :meth:`!__init__` 看起來像: ::" @@ -79,7 +76,6 @@ msgstr "" " self.quantity_on_hand = quantity_on_hand" #: ../../library/dataclasses.rst:41 -#, fuzzy msgid "" "Note that this method is automatically added to the class: it is not " "directly specified in the :class:`!InventoryItem` definition shown above." @@ -92,7 +88,6 @@ msgid "Module contents" msgstr "模組內容" #: ../../library/dataclasses.rst:51 -#, fuzzy msgid "" "This function is a :term:`decorator` that is used to add generated :term:" "`special methods ` to classes, as described below." @@ -101,7 +96,6 @@ msgstr "" "method>`\\新增到類別中,如下所述。" #: ../../library/dataclasses.rst:54 -#, fuzzy msgid "" "The ``@dataclass`` decorator examines the class to find ``field``\\s. A " "``field`` is defined as a class variable that has a :term:`type annotation " @@ -113,7 +107,6 @@ msgstr "" "外,``@dataclass`` 中沒有任何內容檢查變數註釋中指定的型別。" #: ../../library/dataclasses.rst:60 -#, fuzzy msgid "" "The order of the fields in all of the generated methods is the order in " "which they appear in the class definition." @@ -132,7 +125,6 @@ msgstr "" "同一個類別;不會建立新類別。" #: ../../library/dataclasses.rst:69 -#, fuzzy msgid "" "If ``@dataclass`` is used just as a simple decorator with no parameters, it " "acts as if it has the default values documented in this signature. That is, " @@ -187,7 +179,6 @@ msgid "" msgstr "如果該類別已經定義了 :meth:`!__init__`,則此參數會被忽略。" #: ../../library/dataclasses.rst:95 -#, fuzzy msgid "" "*repr*: If true (the default), a :meth:`~object.__repr__` method will be " "generated. The generated repr string will have the class name and the name " @@ -196,10 +187,10 @@ msgid "" "example: ``InventoryItem(name='widget', unit_price=3.0, " "quantity_on_hand=10)``." msgstr "" -"*repr*:如果為真(預設值),將生成一個 :meth:`__repr__` 方法。生成的 repr 字" -"串將包含類別名稱以及每個欄位的名稱和 repr,按照它們在類別中定義的順序排列。不" -"包括標記為從 repr 中排除的欄位。例如:``InventoryItem(name='widget', " -"unit_price=3.0, quantity_on_hand=10)``。" +"*repr*:如果為真(預設值),將生成一個 :meth:`~object.__repr__` 方法。生成的 " +"repr 字串將依欄位在類別中定義的順序,包含類別名稱以及每個欄位的名稱和 repr。" +"標記為從 repr 中排除的欄位則不會被包括在內。例如:" +"``InventoryItem(name='widget', unit_price=3.0, quantity_on_hand=10)``。" #: ../../library/dataclasses.rst:102 msgid "" @@ -229,6 +220,8 @@ msgid "" "example, ``self.a == other.a and self.b == other.b``), rather than comparing " "tuples of fields as in previous versions." msgstr "" +"生成的 ``__eq__`` 方法現在會逐一比較每個欄位(例如 ``self.a == other.a and " +"self.b == other.b``),而不是像先前版本那樣比較欄位的 tuple。" #: ../../library/dataclasses.rst:118 msgid "" @@ -236,6 +229,8 @@ msgid "" "where attributes compare equal by identity but not by value (such as " "``float('nan')``)." msgstr "" +"此變更使比較速度更快,但在屬性依識別性相等、卻依數值不相等的情況下(例如 " +"``float('nan')``),可能會改變比較結果。" #: ../../library/dataclasses.rst:122 msgid "" @@ -243,9 +238,10 @@ msgid "" "of the fields and comparing them (for example, ``(self.a, self.b) == (other." "a, other.b)``)." msgstr "" +"在 Python 3.12 及更早版本中,比較是透過建立欄位的 tuple 並進行比較來執行的" +"(例如 ``(self.a, self.b) == (other.a, other.b)``)。" #: ../../library/dataclasses.rst:126 -#, fuzzy msgid "" "*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" "`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " @@ -253,10 +249,10 @@ msgid "" "fields, in order. Both instances in the comparison must be of the identical " "type. If *order* is true and *eq* is false, a :exc:`ValueError` is raised." msgstr "" -"*order*:如果為真(預設為 ``False``),:meth:`~object.__lt__`、:meth:" -"`~object.__le__`、:meth:`~object.__gt__` 和 :meth:`~object.__ge__` 方法將是產" -"生。它們按順序比較類別,就好像它是其欄位的元組一樣。比較中的兩個實例必須屬於" -"同一型別。如果 *order* 為真且 *eq* 為假,則會引發 :exc:`ValueError`。" +"*order*:如果為真(預設為 ``False``),將會生成 :meth:`~object.__lt__`、:" +"meth:`~object.__le__`、:meth:`~object.__gt__` 和 :meth:`~object.__ge__` 方" +"法。這些方法會依序將類別比較為其欄位的 tuple。比較中的兩個實例必須屬於同一型" +"別。如果 *order* 為真而 *eq* 為假,則會引發 :exc:`ValueError`。" #: ../../library/dataclasses.rst:133 msgid "" @@ -267,18 +263,17 @@ msgstr "" "meth:`!__ge__` 中的任何一個,則引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:137 -#, fuzzy msgid "" "*unsafe_hash*: If true, force ``dataclasses`` to create a :meth:`~object." "__hash__` method, even though it may not be safe to do so. Otherwise, " "generate a :meth:`~object.__hash__` method according to how *eq* and " "*frozen* are set. The default value is ``False``." msgstr "" -"*unsafe_hash*:如果 ``False``\\ (預設值),將根據 *eq* 和 *frozen* 的設定生" -"成一個 :meth:`~object.__hash__` 方法。" +"*unsafe_hash*:如果為真,將強制 ``dataclasses`` 建立一個 :meth:`~object." +"__hash__` 方法,即使這樣做可能並不安全。否則,會根據 *eq* 和 *frozen* 的設定" +"方式來生成 :meth:`~object.__hash__` 方法。預設值為 ``False``。" #: ../../library/dataclasses.rst:143 -#, fuzzy msgid "" ":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are " "added to hashed collections such as dictionaries and sets. Having a :meth:`!" @@ -287,13 +282,12 @@ msgid "" "and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* " "flags in the ``@dataclass`` decorator." msgstr "" -":meth:`!__hash__` 由內建的 :meth:`hash` 使用,當物件被新增到雜湊集合(如字典" -"和集合)時。擁有 :meth:`!__hash__` 意味著該類別的實例是不可變的。可變性是一個" -"複雜的屬性,它取決於程序設計師的意圖 :meth:`!__eq__` 的存在和行為,以及 " -"dataclass 裝飾器中的 *eq* 和 *frozen* 旗標的值." +":meth:`!__hash__` 由內建的 :meth:`hash` 使用,也會在物件被新增到如字典和集合" +"等雜湊集合時使用。擁有 :meth:`!__hash__` 意味著該類別的實例是不可變的。可變性" +"是一個複雜的屬性,取決於程式設計師的意圖、:meth:`!__eq__` 的存在與行為,以及 " +"``@dataclass`` 裝飾器中 *eq* 和 *frozen* 旗標的值。" #: ../../library/dataclasses.rst:150 -#, fuzzy msgid "" "By default, ``@dataclass`` will not implicitly add a :meth:`~object." "__hash__` method unless it is safe to do so. Neither will it add or change " @@ -307,7 +301,6 @@ msgstr "" "件中所述。" #: ../../library/dataclasses.rst:156 -#, fuzzy msgid "" "If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``, " "then ``@dataclass`` *may* add an implicit :meth:`!__hash__` method. Although " @@ -323,7 +316,6 @@ msgstr "" "個特殊的用例,應該仔細考慮。" #: ../../library/dataclasses.rst:163 -#, fuzzy msgid "" "Here are the rules governing implicit creation of a :meth:`!__hash__` " "method. Note that you cannot both have an explicit :meth:`!__hash__` method " @@ -351,15 +343,13 @@ msgstr "" "別是 :class:`object`,這意味著它將回退到基於 id 的雜湊)。" #: ../../library/dataclasses.rst:176 -#, fuzzy msgid "" "*frozen*: If true (the default is ``False``), assigning to fields will " "generate an exception. This emulates read-only frozen instances. See the :" "ref:`discussion ` below." msgstr "" -"*frozen*:如果為真(預設為 ``False``),分配給欄位將產生例外。這模擬了只讀的" -"凍結實例。如果 :meth:`~object.__setattr__` 或 :meth:`~object.__delattr__` 在" -"類別中定義,則 :exc:`TypeError` 被引發。請參閱下面的討論。" +"*frozen*:如果為真(預設為 ``False``),對欄位賦值將會產生例外。這模擬了唯讀" +"的凍結實例。請參閱下面的\\ :ref:`討論 `。" #: ../../library/dataclasses.rst:180 msgid "" @@ -370,7 +360,6 @@ msgstr "" "且 *frozen* 為真,則會引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:183 -#, fuzzy msgid "" "*match_args*: If true (the default is ``True``), the :attr:`~object." "__match_args__` tuple will be created from the list of non keyword-only " @@ -379,13 +368,12 @@ msgid "" "__match_args__` is already defined in the class, then :attr:`!" "__match_args__` will not be generated." msgstr "" -"*match_args*:如果為真(預設為 ``True``),``__match_args__`` 元組將從參數列" -"表建立到生成的 :meth:`~object.__init__` 方法(即使 :meth: `!__init__` 未生" -"成,見上文)。如果為 false,或者類別中已經定義了 :attr:`!__match_args__`,則" -"不會生成 :attr:`!__match_args__`。" +"*match_args*:如果為真(預設為 ``True``),:attr:`~object.__match_args__` " +"tuple 將依據傳給生成的 :meth:`~object.__init__` 方法的非僅限關鍵字參數列表建" +"立(即使未生成 :meth:`!__init__` 方法也一樣,見上文)。如果為假,或類別中已經" +"定義了 :attr:`!__match_args__`,則不會生成 :attr:`!__match_args__`。" #: ../../library/dataclasses.rst:192 -#, fuzzy msgid "" "*kw_only*: If true (the default value is ``False``), then all fields will be " "marked as keyword-only. If a field is marked as keyword-only, then the only " @@ -394,27 +382,25 @@ msgid "" "is called. See the :term:`parameter` glossary entry for details. Also see " "the :const:`KW_ONLY` section." msgstr "" -"``kw_only``:如果為 true(預設值為 ``False``),則所有欄位將被標記為僅限關鍵" -"字。如果一個欄位被標記為僅限關鍵字,那麼唯一的影響是從僅限關鍵字欄位生成的 :" -"meth:`~object.__init__` 參數必須在呼叫 :meth:`!__init__` 時指定關鍵字。對資料" -"類別的任何其他方面都沒有影響。有關詳細資訊,請參閱 :term:`parameter` 詞彙表條" -"目。另請參閱 :const:`KW_ONLY` 部分。" +"*kw_only*:如果為真(預設值為 ``False``),則所有欄位都會被標記為僅限關鍵字。" +"如果一個欄位被標記為僅限關鍵字,那麼唯一的影響是:由該欄位生成的 :meth:" +"`~object.__init__` 參數,在呼叫 :meth:`!__init__` 時必須以關鍵字指定。詳情請" +"參閱 :term:`parameter` 詞彙表條目。另請參閱 :const:`KW_ONLY` 一節。" #: ../../library/dataclasses.rst:200 msgid "Keyword-only fields are not included in :attr:`!__match_args__`." msgstr "" #: ../../library/dataclasses.rst:204 -#, fuzzy msgid "" "*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " "attribute will be generated and new class will be returned instead of the " "original one. If :attr:`!__slots__` is already defined in the class, then :" "exc:`TypeError` is raised." msgstr "" -"``slots``:如果為 true(預設為 ``False``),將生成 :attr:`~object.__slots__` " -"屬性並回傳新類別而不是原始類別。如果 :attr:`!__slots__` 已經在類別中定義," -"則 :exc:`TypeError` 被引發。" +"*slots*:如果為真(預設為 ``False``),將會生成 :attr:`~object.__slots__` 屬" +"性,並回傳新的類別而非原始類別。如果 :attr:`!__slots__` 已經在類別中定義,則" +"會引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:210 msgid "" @@ -425,7 +411,6 @@ msgid "" msgstr "" #: ../../library/dataclasses.rst:218 -#, fuzzy msgid "" "If a field name is already included in the :attr:`!__slots__` of a base " "class, it will not be included in the generated :attr:`!__slots__` to " @@ -434,14 +419,13 @@ msgid "" "`fields` instead. To be able to determine inherited slots, base class :attr:" "`!__slots__` may be any iterable, but *not* an iterator." msgstr "" -"如果欄位名稱已經包含在基底類別的 :attr:`!__slots__` 中,它將不會包含在生成" -"的 :attr:`!__slots__` 中以防止 :ref:`覆蓋它們 `。因此," -"不要使用 __slots__ 來檢索資料類別的欄位名稱。使用 :func:`fields` 代替。為了能" -"夠確定繼承的插槽,基底類別 :attr:`!__slots__` 可以是任何可疊代的,但*不是*疊" -"代器。" +"如果欄位名稱已經包含在基底類別的 :attr:`!__slots__` 中,為了防止\\ :ref:`覆蓋" +"它們 `,該名稱將不會包含在生成的 :attr:`!__slots__` " +"中。因此,請不要使用 :attr:`!__slots__` 來取得資料類別的欄位名稱,請改用 :" +"func:`fields`。為了能夠判斷繼承的插槽,基底類別的 :attr:`!__slots__` 可以是任" +"何可疊代物件,但\\ *不能*\\ 是疊代器。" #: ../../library/dataclasses.rst:228 -#, fuzzy msgid "" "*weakref_slot*: If true (the default is ``False``), add a slot named " "\"__weakref__\", which is required to make an instance :func:`weakref-able " @@ -449,11 +433,10 @@ msgid "" "specifying ``slots=True``." msgstr "" "*weakref_slot*:如果為真(預設為 ``False``),新增一個名為 \"__weakref__\" 的" -"插槽,這是使實例可弱引用所必需的。在沒有指定 ``slots=True`` 的情況下指定 " -"``weakref_slot=True`` 是錯誤的。" +"插槽,這是使實例\\ :func:`可弱引用 `\\ 所必需的。在未同時指定 " +"``slots=True`` 的情況下指定 ``weakref_slot=True`` 屬於錯誤用法。" #: ../../library/dataclasses.rst:236 -#, fuzzy msgid "" "``field``\\s may optionally specify a default value, using normal Python " "syntax::" @@ -468,7 +451,6 @@ msgid "" msgstr "" #: ../../library/dataclasses.rst:244 -#, fuzzy msgid "" "In this example, both :attr:`!a` and :attr:`!b` will be included in the " "added :meth:`~object.__init__` method, which will be defined as::" @@ -481,17 +463,15 @@ msgid "def __init__(self, a: int, b: int = 0):" msgstr "def __init__(self, a: int, b: int = 0):" #: ../../library/dataclasses.rst:249 -#, fuzzy msgid "" ":exc:`TypeError` will be raised if a field without a default value follows a " "field with a default value. This is true whether this occurs in a single " "class, or as a result of class inheritance." msgstr "" -":exc:`TypeError` 如果沒有預設值的欄位跟在具有預設值的欄位之後,將引發。無論這" -"發生在單個類別中還是作為類別繼承的結果,都是如此。" +"如果沒有預設值的欄位出現在有預設值的欄位之後,則會引發 :exc:`TypeError`。無論" +"這發生在單一類別中,還是類別繼承的結果,都是如此。" #: ../../library/dataclasses.rst:255 -#, fuzzy msgid "" "For common and simple use cases, no other functionality is required. There " "are, however, some dataclass features that require additional per-field " @@ -520,7 +500,6 @@ msgstr "" "c.mylist += [1, 2, 3]" #: ../../library/dataclasses.rst:268 -#, fuzzy msgid "" "As shown above, the :const:`MISSING` value is a sentinel object used to " "detect if some parameters are provided by the user. This sentinel is used " @@ -545,7 +524,6 @@ msgstr "" "呼叫本身會替換預設值的正常位置。" #: ../../library/dataclasses.rst:279 -#, fuzzy msgid "" "*default_factory*: If provided, it must be a zero-argument callable that " "will be called when a default value is needed for this field. Among other " @@ -558,7 +536,6 @@ msgstr "" "定 *default* 和 *default_factory* 是錯誤的。" #: ../../library/dataclasses.rst:285 -#, fuzzy msgid "" "*init*: If true (the default), this field is included as a parameter to the " "generated :meth:`~object.__init__` method." @@ -567,7 +544,6 @@ msgstr "" "方法的參數包含在內。" #: ../../library/dataclasses.rst:288 -#, fuzzy msgid "" "*repr*: If true (the default), this field is included in the string returned " "by the generated :meth:`~object.__repr__` method." @@ -576,7 +552,6 @@ msgstr "" "法回傳的字串中。" #: ../../library/dataclasses.rst:291 -#, fuzzy msgid "" "*hash*: This can be a bool or ``None``. If true, this field is included in " "the generated :meth:`~object.__hash__` method. If false, this field is " @@ -586,13 +561,13 @@ msgid "" "comparisons. Setting this value to anything other than ``None`` is " "discouraged." msgstr "" -"*hash*:這可以是 bool 或 ``None``。如果為真,則此欄位包含在生成的 :meth:" -"`__hash__` 方法中。如果 ``None``\\ (預設值),則使用\\ *比較*\\ 的值:這通常" -"是預期的行為。如果一個欄位用於比較,則應在雜湊中考慮該欄位。不鼓勵將此值設定" -"為 ``None`` 以外的任何值。" +"*hash*:這可以是 bool 或 ``None``。如果為真,則此欄位會包含在生成的 :meth:" +"`~object.__hash__` 方法中。如果為假,則此欄位會被排除在生成的 :meth:`~object." +"__hash__` 之外。如果為 ``None``\\ (預設值),則使用 *compare* 的值:這通常會" +"是預期的行為,因為如果一個欄位用於比較,通常也應該將它納入雜湊中。不建議將此" +"值設定為 ``None`` 以外的其他值。" #: ../../library/dataclasses.rst:299 -#, fuzzy msgid "" "One possible reason to set ``hash=False`` but ``compare=True`` would be if a " "field is expensive to compute a hash value for, that field is needed for " @@ -605,7 +580,6 @@ msgstr "" "值。即使一個欄位被排除在雜湊之外,它仍然會被用於比較。" #: ../../library/dataclasses.rst:305 -#, fuzzy msgid "" "*compare*: If true (the default), this field is included in the generated " "equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." @@ -615,7 +589,6 @@ msgstr "" "`~object.__eq__`、:meth:`~object.__gt__` 等)。" #: ../../library/dataclasses.rst:309 -#, fuzzy msgid "" "*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " "empty dict. This value is wrapped in :func:`~types.MappingProxyType` to " @@ -624,13 +597,12 @@ msgid "" "mechanism. Multiple third-parties can each have their own key, to use as a " "namespace in the metadata." msgstr "" -"*metadata*:這可以是對映或無。 None 被視為空字典。此值包含在 :func:`~types." -"MappingProxyType` 中以使其成為只讀的,並暴露在 :class:`Field` 物件上。它根本" -"不被資料類別使用,而是作為第三方擴充機制提供的。多個第三方可以各自擁有自己的" -"密鑰,用作元資料中的命名空間。" +"*metadata*:這可以是對映或 ``None``。``None`` 會被視為空字典。此值會被包裝" +"在 :func:`~types.MappingProxyType` 中以使其成為唯讀,並公開在 :class:`Field` " +"物件上。Data Classes 完全不會使用它,它是作為第三方擴充機制提供的。多個第三方" +"可以各自擁有自己的鍵,在元資料中作為命名空間使用。" #: ../../library/dataclasses.rst:317 -#, fuzzy msgid "" "*kw_only*: If true, this field will be marked as keyword-only. This is used " "when the generated :meth:`~object.__init__` method's parameters are computed." @@ -647,7 +619,6 @@ msgid "*doc*: optional docstring for this field." msgstr "" #: ../../library/dataclasses.rst:329 -#, fuzzy msgid "" "If the default value of a field is specified by a call to :func:`!field`, " "then the class attribute for this field will be replaced by the specified " @@ -657,10 +628,10 @@ msgid "" "fields, just as if the default value itself were specified. For example, " "after::" msgstr "" -"如果欄位的預設值是透過呼叫 :func:`!field` 指定的,那麼該欄位的類別屬性將被指" -"定的 *default* 值替換。如果沒有提供 *default*,那麼類別屬性將被刪除。目的是" -"在 :func:`@dataclass ` 裝飾器運行後,類別屬性將全部包含欄位的預設" -"值,就像預設值本身已指定一樣。例如,在: ::" +"如果欄位的預設值是透過呼叫 :func:`!field` 指定的,那麼該欄位的類別屬性將被替" +"換為指定的 *default* 值。如果未提供 *default*,那麼該類別屬性將被刪除。其用意" +"是讓 :deco:`dataclass` 裝飾器執行後,類別屬性都會包含欄位的預設值,就像該預設" +"值本身已被指定一樣。舉例來說,在下列程式碼之後: ::" #: ../../library/dataclasses.rst:338 msgid "" @@ -679,17 +650,15 @@ msgstr "" " t: int = 20" #: ../../library/dataclasses.rst:345 -#, fuzzy msgid "" "The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" "C.t` will be ``20``, and the class attributes :attr:`!C.x` and :attr:`!C.y` " "will not be set." msgstr "" -"類別屬性 :attr:`!C.z` 將為 ``10``,類別屬性 :attr:`!C.t` 將為 ``20``,類別屬" -"性 :attr:`!C.x` 和 :attr:`!C.y` 將不會放。" +"類別屬性 :attr:`!C.z` 將為 ``10``,類別屬性 :attr:`!C.t` 將為 ``20``,而類別" +"屬性 :attr:`!C.x` 和 :attr:`!C.y` 將不會被設定。" #: ../../library/dataclasses.rst:351 -#, fuzzy msgid "" ":class:`!Field` objects describe each defined field. These objects are " "created internally, and are returned by the :func:`fields` module-level " @@ -709,7 +678,6 @@ msgid ":attr:`!type`: The type of the field." msgstr ":attr:`!type`:欄位的型別。" #: ../../library/dataclasses.rst:358 -#, fuzzy msgid "" ":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" "attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have " @@ -720,7 +688,6 @@ msgstr "" "們在 :func:`field` 函式中的含義和值相同。" #: ../../library/dataclasses.rst:362 -#, fuzzy msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." @@ -736,7 +703,6 @@ msgid "" msgstr "" #: ../../library/dataclasses.rst:376 -#, fuzzy msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " "dataclass. Accepts either a dataclass, or an instance of a dataclass. " @@ -748,7 +714,6 @@ msgstr "" "``ClassVar`` 或 ``InitVar`` 的偽欄位。" #: ../../library/dataclasses.rst:383 -#, fuzzy msgid "" "Converts the dataclass *obj* to a dict (by using the factory function " "*dict_factory*). Each dataclass is converted to a dict of its fields, as " @@ -760,9 +725,8 @@ msgstr "" "遞迴到。其他物件使用 :func:`copy.deepcopy` 複製。" #: ../../library/dataclasses.rst:389 -#, fuzzy msgid "Example of using :func:`!asdict` on nested dataclasses::" -msgstr "在嵌套資料類別上使用 :func:`!asdict` 的範例: ::" +msgstr "在巢狀資料類別上使用 :func:`!asdict` 的範例: ::" #: ../../library/dataclasses.rst:391 msgid "" @@ -797,22 +761,19 @@ msgstr "" "assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" #: ../../library/dataclasses.rst:406 ../../library/dataclasses.rst:426 -#, fuzzy msgid "To create a shallow copy, the following workaround may be used::" -msgstr "要建立淺複製,可以使用以下解決方法:" +msgstr "若要建立淺複製,可以使用以下替代方法: ::" #: ../../library/dataclasses.rst:408 msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" msgstr "{field.name: getattr(obj, field.name) for field in fields(obj)}" #: ../../library/dataclasses.rst:410 -#, fuzzy msgid "" ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." msgstr ":func:`!asdict` 如果 *obj* 不是資料類別實例,則引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:415 -#, fuzzy msgid "" "Converts the dataclass *obj* to a tuple (by using the factory function " "*tuple_factory*). Each dataclass is converted to a tuple of its field " @@ -840,7 +801,6 @@ msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" msgstr "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" #: ../../library/dataclasses.rst:430 -#, fuzzy msgid "" ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " "instance." @@ -848,7 +808,6 @@ msgstr "" ":func:`!astuple` 如果 *obj* 不是資料類別實例,則引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:435 -#, fuzzy msgid "" "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " "base classes as given in *bases*, and initialized with a namespace as given " @@ -859,13 +818,13 @@ msgid "" "*slots*, and *weakref_slot* have the same meaning as they do in :deco:" "`dataclass`." msgstr "" -"建立一個名為 *cls_name* 的新資料類別,欄位在 *fields* 中定義,基底類別在 " -"*bases* 中給出,並使用 *namespace* 中給出的命名空間進行初始化。 ``fields`` 是" -"一個疊代器,其元素分別是 ``name``、``(name, type)`` 或 ``(name, type, " -"Field)``。如果只提供 ``name``,則 ``typing.Any`` 用於 ``type``。 ``init``、" -"``repr``、``eq``、``order``、``unsafe_hash``、``frozen``、``match_args``、" -"``kw_only`` 的值, ``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中" -"的含義相同。" +"建立一個名為 *cls_name* 的新資料類別,欄位定義於 *fields* 中,基底類別由 " +"*bases* 給定,並使用 *namespace* 中給定的命名空間進行初始化。*fields* 是一個" +"可疊代物件,其元素可以是 ``name``、``(name, type)`` 或 ``(name, type, " +"Field)``。如果只提供了 ``name``,則 ``type`` 會使用 :data:`typing.Any`。" +"*init*、*repr*、*eq*、*order*、*unsafe_hash*、*frozen*、*match_args*、" +"*kw_only*、*slots* 和 *weakref_slot* 的值,與它們在 :deco:`dataclass` 中的含" +"義相同。" #: ../../library/dataclasses.rst:445 msgid "" @@ -882,16 +841,15 @@ msgid "" msgstr "" #: ../../library/dataclasses.rst:454 -#, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " "creating a new class with :attr:`~object.__annotations__` can then apply " "the :deco:`dataclass` function to convert that class to a dataclass. This " "function is provided as a convenience. For example::" msgstr "" -"這個函式不是嚴格要求的,因為任何使用 :attr:`~object.__annotations__` 建立新類" -"別的 Python 機制都可以應用 :func:`dataclass` 函式將該類別轉換為資料類別。提供" -"此功能是為了方便。例如: ::" +"這個函式並非嚴格必要,因為任何使用 :attr:`~object.__annotations__` 建立新類別" +"的 Python 機制,都可以接著套用 :deco:`dataclass` 函式,將該類別轉換為資料類" +"別。提供此函式是為了方便起見。例如: ::" #: ../../library/dataclasses.rst:460 msgid "" @@ -947,7 +905,6 @@ msgstr "" "dataclass 的欄位則引發 :exc:`TypeError`。" #: ../../library/dataclasses.rst:487 -#, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " "method of the dataclass. This ensures that :meth:`__post_init__`, if " @@ -957,17 +914,15 @@ msgstr "" "保 :meth:`__post_init__`\\ (如果存在)也被呼叫。" #: ../../library/dataclasses.rst:491 -#, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " "on the call to :func:`!replace` so that they can be passed to :meth:`!" "__init__` and :meth:`__post_init__`." msgstr "" -"沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" -"們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" +"沒有預設值的僅初始化變數(如果存在的話)必須在呼叫 :func:`!replace` 時指定," +"以便它們能被傳遞給 :meth:`!__init__` 和 :meth:`__post_init__`。" #: ../../library/dataclasses.rst:495 -#, fuzzy msgid "" "It is an error for *changes* to contain any fields that are defined as " "having ``init=False``. A :exc:`ValueError` will be raised in this case." @@ -976,7 +931,6 @@ msgstr "" "發 :exc:`ValueError`。" #: ../../library/dataclasses.rst:499 -#, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:`!" "replace`. They are not copied from the source object, but rather are " @@ -1008,7 +962,6 @@ msgstr "" "名 `)或一個實例則回傳 ``True``,否則回傳 ``False``。" #: ../../library/dataclasses.rst:516 -#, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " "dataclass itself), then add a further check for ``not isinstance(obj, " @@ -1026,12 +979,10 @@ msgstr "" " return is_dataclass(obj) and not isinstance(obj, type)" #: ../../library/dataclasses.rst:525 -#, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少 default 或 default_factory 的標記值。" #: ../../library/dataclasses.rst:529 -#, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " "with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note " @@ -1047,7 +998,6 @@ msgstr "" "表示 :meth:`~object.__init__` 參數,在實例化類別時必須將其指定為關鍵字。" #: ../../library/dataclasses.rst:538 -#, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" @@ -1074,29 +1024,26 @@ msgstr "" "p = Point(0, y=1.5, z=2.0)" #: ../../library/dataclasses.rst:549 -#, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`!KW_ONLY`." msgstr "在單個資料類別中,指定多個型別為 :const:`!KW_ONLY` 的欄位是錯誤的。" #: ../../library/dataclasses.rst:556 -#, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" "`~object.__delattr__` is called on a dataclass which was defined with " "``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" -"當在使用 frozen=True 定義的資料類別上呼叫隱式定義的 :meth:`__setattr__` 或 :" -"meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" +"當在以 ``frozen=True`` 定義的資料類別上呼叫隱式定義的 :meth:`~object." +"__setattr__` 或 :meth:`~object.__delattr__` 時,會引發此例外。它是 :exc:" +"`AttributeError` 的子類別。" #: ../../library/dataclasses.rst:563 -#, fuzzy msgid "Post-init processing" msgstr "後初始化處理" #: ../../library/dataclasses.rst:567 -#, fuzzy msgid "" "When defined on the class, it will be called by the generated :meth:`~object." "__init__`, normally as :meth:`!self.__post_init__`. However, if any " @@ -1105,14 +1052,12 @@ msgid "" "__init__` method is generated, then :meth:`!__post_init__` will not " "automatically be called." msgstr "" -"生成的 :meth:`~object.__init__` 程式碼將呼叫一個名為 :meth:`!self." -"__post_init__` 的方法,如果 :meth:`!__post_init__` 是在類別上定義的。它通常被" -"稱為 ``self.!__post_init__()``。但是,如果定義了任何 ``InitVar`` 欄位,它們也" -"將按照它們在類別中定義的順序傳遞給 :meth:`!__post_init__` 。如果沒有生成 :" -"meth:`!__init__` 方法,那麼 :meth:`!__post_init__` 將不會被自動呼叫。" +"當它在類別上被定義時,會被生成的 :meth:`~object.__init__` 呼叫,通常是以 :" +"meth:`!self.__post_init__` 的形式呼叫。但是,如果定義了任何 ``InitVar`` 欄" +"位,它們也會依照在類別中定義的順序被傳遞給 :meth:`!__post_init__`。如果沒有生" +"成 :meth:`!__init__` 方法,那麼 :meth:`!__post_init__` 將不會被自動呼叫。" #: ../../library/dataclasses.rst:574 -#, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" @@ -1139,16 +1084,15 @@ msgstr "" " self.c = self.a + self.b" #: ../../library/dataclasses.rst:586 -#, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :deco:`dataclass` does not " "call base class :meth:`!__init__` methods. If the base class has an :meth:`!" "__init__` method that has to be called, it is common to call this method in " "a :meth:`__post_init__` method::" msgstr "" -":func:`@dataclass ` 生成的 :meth:`~object.__init__` 方法不呼叫基底" -"類別 :meth:`!__init__` 方法。如果基底類別有一個必須呼叫的 :meth:`!__init__` " -"方法,通常在 :meth:`__post_init__` 方法中呼叫此方法: ::" +"由 :deco:`dataclass` 生成的 :meth:`~object.__init__` 方法不會呼叫基底類別的 :" +"meth:`!__init__` 方法。如果基底類別有一個必須被呼叫的 :meth:`!__init__` 方" +"法,通常會在 :meth:`__post_init__` 方法中呼叫此方法: ::" #: ../../library/dataclasses.rst:591 msgid "" @@ -1177,7 +1121,6 @@ msgstr "" " super().__init__(self.side, self.side)" #: ../../library/dataclasses.rst:603 -#, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`!__init__` " "methods don't need to be called, since the derived dataclass will take care " @@ -1187,7 +1130,6 @@ msgstr "" "類別將負責初始化作為資料類別本身的任何基底類別的所有欄位。" #: ../../library/dataclasses.rst:607 -#, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" "meth:`!__post_init__`. Also see the warning about how :func:`replace` " @@ -1201,7 +1143,6 @@ msgid "Class variables" msgstr "類別變數" #: ../../library/dataclasses.rst:616 -#, fuzzy msgid "" "One of the few places where :deco:`dataclass` actually inspects the type of " "a field is to determine if a field is a class variable as defined in :pep:" @@ -1210,19 +1151,17 @@ msgid "" "as a field and is ignored by the dataclass mechanisms. Such ``ClassVar`` " "pseudo-fields are not returned by the module-level :func:`fields` function." msgstr "" -":func:`@dataclass ` 實際檢查欄位型別的少數地方之一是確定欄位是否" -"是 :pep:`526` 中定義的類別變數。它透過檢查欄位的型別是否為 :data:`typing." -"ClassVar` 來做到這一點。如果一個欄位是一個 ``ClassVar``,它就被排除在考慮之" -"外,並被資料類別機制忽略。模組級 :func:`fields` 函式不會回傳此類別 " -"``ClassVar`` 偽欄位。" +":deco:`dataclass` 實際檢查欄位型別的少數幾個地方之一,就是用來判斷欄位是否" +"為 :pep:`526` 中定義的類別變數。它透過檢查欄位的型別是否為 :data:`typing." +"ClassVar` 來達成這一點。如果一個欄位是 ``ClassVar``,它就會被排除在欄位考量之" +"外,並被資料類別機制忽略。這類 ``ClassVar`` 偽欄位不會被模組層級的 :func:" +"`fields` 函式回傳。" #: ../../library/dataclasses.rst:627 -#, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" #: ../../library/dataclasses.rst:629 -#, fuzzy msgid "" "Another place where :deco:`dataclass` inspects a type annotation is to " "determine if a field is an init-only variable. It does this by seeing if " @@ -1233,15 +1172,14 @@ msgid "" "`~object.__init__` method, and are passed to the optional :meth:" "`__post_init__` method. They are not otherwise used by dataclasses." msgstr "" -":func:`dataclass` 檢查型別註解的另一個地方是確定欄位是否是僅初始化變數。它通" -"過查看欄位的型別是否為 ``dataclasses.InitVar`` 型別來執行此操作。如果一個欄位" -"是一個 ``InitVar``,它被認為是一個偽欄位,稱為 init-only 欄位。由於它不是真正" -"的欄位,因此它不會由模組級 fields 函式回傳。 Init-only 欄位作為參數新增到生成" -"的 :meth:`~object.__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。" -"它們不被資料類別使用。" +":deco:`dataclass` 檢查型別註釋的另一個地方,是用來判斷欄位是否為僅初始化變" +"數。它透過檢查欄位的型別是否為 :class:`InitVar` 型別來達成這一點。如果一個欄" +"位是 :class:`InitVar`,則會被視為一個稱為僅初始化欄位的偽欄位。由於它不是真正" +"的欄位,因此不會被模組層級的 :func:`fields` 函式回傳。僅初始化欄位會被新增為" +"生成的 :meth:`~object.__init__` 方法的參數,並傳遞給可選的 :meth:" +"`__post_init__` 方法。除此之外,它們不會被資料類別使用。" #: ../../library/dataclasses.rst:639 -#, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" @@ -1274,7 +1212,6 @@ msgstr "" "c = C(10, database=my_database)" #: ../../library/dataclasses.rst:654 -#, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" "i` and :attr:`!j`, but not for :attr:`!database`." @@ -1287,7 +1224,6 @@ msgid "Frozen instances" msgstr "凍結實例" #: ../../library/dataclasses.rst:662 -#, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :deco:`dataclass` decorator you can emulate " @@ -1295,27 +1231,25 @@ msgid "" "__setattr__` and :meth:`~object.__delattr__` methods to the class. These " "methods will raise a :exc:`FrozenInstanceError` when invoked." msgstr "" -"不可能建立真正不可變的 Python 物件。但是,透過將 ``frozen=True`` 傳遞給 :" -"func:`@dataclass ` 裝飾器,你可以模擬不變性。在這種情況下,資料類" -"別將向類別新增 :meth:`~object.__setattr__` 和 :meth:`~object.__delattr__` 方" -"法。這些方法在叫用時會引發 :exc:`FrozenInstanceError`。" +"建立真正不可變的 Python 物件是不可能的。但是,透過將 ``frozen=True`` 傳遞給 :" +"deco:`dataclass` 裝飾器,你可以模擬不變性。在這種情況下,資料類別會為該類別新" +"增 :meth:`~object.__setattr__` 和 :meth:`~object.__delattr__` 方法。這些方法" +"在被呼叫時會引發 :exc:`FrozenInstanceError`。" #: ../../library/dataclasses.rst:668 -#, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`~object.__init__` cannot use simple assignment to initialize fields, and " "must use :meth:`!object.__setattr__`." msgstr "" -"使用 ``frozen=True`` 時有一個微小的性能損失::meth:`~object.__init__` 不能使" -"用簡單賦值來初始化欄位,必須使用 :meth:`!object.__setattr__`。" +"使用 ``frozen=True`` 時會有微小的效能損失::meth:`~object.__init__` 無法使用" +"簡單賦值來初始化欄位,必須改用 :meth:`!object.__setattr__`。" #: ../../library/dataclasses.rst:677 msgid "Inheritance" msgstr "繼承" #: ../../library/dataclasses.rst:679 -#, fuzzy msgid "" "When the dataclass is being created by the :deco:`dataclass` decorator, it " "looks through all of the class's base classes in reverse MRO (that is, " @@ -1326,11 +1260,11 @@ msgid "" "ordered mapping of fields. Because the fields are in insertion order, " "derived classes override base classes. An example::" msgstr "" -"當 :func:`@dataclass ` 裝飾器建立資料類別時,它會以反向 MRO(即" -"從 :class:`object` 開始)查看該類別的所有基底類別,並且對於它找到的每個資料類" -"別,將該基底類別中的欄位新增到欄位的有序對映中。新增所有基底類別欄位後,它會" -"將自己的欄位新增到有序對映中。所有生成的方法都將使用這種組合的、計算的有序欄" -"位對映。因為欄位是按插入順序排列的,所以衍生類別會覆蓋基底類別。一個例子: ::" +"當 :deco:`dataclass` 裝飾器建立資料類別時,它會以反向 MRO(也就是從 :class:" +"`object` 開始)檢視該類別的所有基底類別,並針對它找到的每個資料類別,將該基底" +"類別的欄位新增到欄位的有序對映中。新增完所有基底類別的欄位後,它會將自己的欄" +"位新增到這個有序對映中。所有生成的方法都會使用這個組合、計算後的有序欄位對" +"映。由於欄位是依插入順序排列,因此衍生類別會覆蓋基底類別。舉例來說: ::" #: ../../library/dataclasses.rst:689 msgid "" @@ -1355,7 +1289,6 @@ msgstr "" " x: int = 15" #: ../../library/dataclasses.rst:699 -#, fuzzy msgid "" "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " "The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!" @@ -1365,7 +1298,6 @@ msgstr "" "型別是 :class:`int`,如類別 :class:`!C` 中指定的那樣。" #: ../../library/dataclasses.rst:702 -#, fuzzy msgid "" "The generated :meth:`~object.__init__` method for :class:`!C` will look " "like::" @@ -1376,24 +1308,21 @@ msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" msgstr "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" #: ../../library/dataclasses.rst:707 -#, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" msgstr ":meth:`!__init__` 中僅關鍵字參數的重新排序" #: ../../library/dataclasses.rst:709 -#, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " "keyword-only parameters are moved to come after all regular (non-keyword-" "only) parameters. This is a requirement of how keyword-only parameters are " "implemented in Python: they must come after non-keyword-only parameters." msgstr "" -"在計算 :meth:`__init__` 所需的參數後,任何僅關鍵字參數都將移動到所有常規(非" -"僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" -"非僅關鍵字參數之後。" +"在計算出 :meth:`~object.__init__` 所需的參數後,任何僅限關鍵字參數都會被移到" +"所有常規(非僅限關鍵字)參數之後。這是 Python 中僅限關鍵字參數實作方式的要" +"求:它們必須排在非僅限關鍵字參數之後。" #: ../../library/dataclasses.rst:715 -#, fuzzy msgid "" "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " "keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " @@ -1429,7 +1358,6 @@ msgstr "" " t: int = field(kw_only=True, default=0)" #: ../../library/dataclasses.rst:730 -#, fuzzy msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "為 :class:`!D` 生成的 :meth:`!__init__` 方法將如下所示: ::" @@ -1442,7 +1370,6 @@ msgstr "" "int = 0):" #: ../../library/dataclasses.rst:734 -#, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " "list of fields: parameters derived from regular fields are followed by " @@ -1452,7 +1379,6 @@ msgstr "" "跟從僅關鍵字欄位衍生的參數。" #: ../../library/dataclasses.rst:738 -#, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`!__init__` parameter list." @@ -1463,21 +1389,19 @@ msgid "Default factory functions" msgstr "預設工廠函式" #: ../../library/dataclasses.rst:745 -#, fuzzy msgid "" "If a :func:`field` specifies a *default_factory*, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" -"如果 :func:`field` 指定了 *default_factory*,當需要該欄位的預設值時,它會以零" -"引數呼叫。例如,要建立列表的新實例,請使用: ::" +"如果 :func:`field` 指定了 *default_factory*,那麼在該欄位需要預設值時,它會以" +"零引數的方式被呼叫。舉例來說,若要建立一個新的 list 實例,可以使用: ::" #: ../../library/dataclasses.rst:749 msgid "mylist: list = field(default_factory=list)" msgstr "mylist: list = field(default_factory=list)" #: ../../library/dataclasses.rst:751 -#, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " "and the field also specifies *default_factory*, then the default factory " @@ -1485,16 +1409,16 @@ msgid "" "function. This happens because there is no other way to give the field an " "initial value." msgstr "" -"如果一個欄位從 :meth:`~object.__init__` 中排除(使用 ``init=False``)並且該欄" -"位還指定了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:" -"`__init__ 中呼叫`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" +"如果某個欄位被排除在 :meth:`~object.__init__` 之外(使用 ``init=False``),且" +"該欄位又指定了 *default_factory*,那麼預設工廠函式就一定會在生成的 :meth:`!" +"__init__` 函式中被呼叫。之所以會這樣,是因為沒有其他方法可以為該欄位提供初始" +"值。" #: ../../library/dataclasses.rst:758 msgid "Mutable default values" msgstr "可變預設值" #: ../../library/dataclasses.rst:760 -#, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" @@ -1528,7 +1452,6 @@ msgstr "" "assert o1.x is o2.x" #: ../../library/dataclasses.rst:775 -#, fuzzy msgid "" "Note that the two instances of class :class:`!C` share the same class " "variable :attr:`!x`, as expected." @@ -1537,7 +1460,6 @@ msgstr "" "那樣。" #: ../../library/dataclasses.rst:778 -#, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類別,*如果*\\ 此程式碼有效: ::" @@ -1580,7 +1502,6 @@ msgstr "" "assert D().x is D().x" #: ../../library/dataclasses.rst:797 -#, fuzzy msgid "" "This has the same issue as the original example using class :class:`!C`. " "That is, two instances of class :class:`!D` that do not specify a value for :" @@ -1592,15 +1513,15 @@ msgid "" "is that if a value is unhashable, it is mutable. This is a partial " "solution, but it does protect against many common errors." msgstr "" -"這與使用類別 :class:`!C` 的原始示例存在相同的問題。也就是說,類別 :class:`!" -"D` 的兩個實例在建立類別實例時沒有為 :attr:`!x` 指定值,它們將共享 :attr:`!x` " -"的同一個副本。因為資料類別只是使用普通的 Python 類別建立,所以它們也有這種行" -"為。資料類別沒有通用的方法來檢測這種情況。相反,如果 :func:`dataclass` 裝飾器" -"檢測到不可雜湊的預設參數,它將引發 :exc:`TypeError`。假設是如果一個值是不可散" -"列的,那麼它就是可變的。這是一個部分解決方案,但它確實可以防止許多常見錯誤。" +"這與使用類別 :class:`!C` 的原始範例有相同的問題。也就是說,類別 :class:`!D` " +"的兩個實例,如果在建立類別實例時沒有為 :attr:`!x` 指定值,將會共享同一份 :" +"attr:`!x` 的副本。因為資料類別只是使用一般的 Python 類別建立方式,所以它們也" +"會有這種行為。Data Classes 沒有通用的方法可以偵測到這種情況。取而代之,如果 :" +"deco:`dataclass` 裝飾器偵測到不可雜湊的預設參數,就會引發 :exc:`ValueError`。" +"這裡的假設是,如果一個值是不可雜湊的,那麼它就是可變的。這只是一個部分解決方" +"案,但確實能防止許多常見錯誤。" #: ../../library/dataclasses.rst:808 -#, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" @@ -1621,7 +1542,6 @@ msgstr "" "assert D().x is not D().x" #: ../../library/dataclasses.rst:817 -#, fuzzy msgid "" "Instead of looking for and disallowing objects of type :class:`list`, :class:" "`dict`, or :class:`set`, unhashable objects are now not allowed as default " @@ -1631,12 +1551,10 @@ msgstr "" "在不允許使用不可雜湊的物件作為預設值。不可雜湊性用於近似可變性。" #: ../../library/dataclasses.rst:824 -#, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" #: ../../library/dataclasses.rst:826 -#, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " "default value have the following special behaviors:" @@ -1644,7 +1562,6 @@ msgstr "" "指定為\\ :ref:`描述器物件 `\\ 作為預設值的欄位具有以下特殊行為:" #: ../../library/dataclasses.rst:829 -#, fuzzy msgid "" "The value for the field passed to the dataclass's :meth:`~object.__init__` " "method is passed to the descriptor's :meth:`~object.__set__` method rather " @@ -1654,7 +1571,6 @@ msgstr "" "`~object.__set__` 方法,而不是覆蓋描述器物件。" #: ../../library/dataclasses.rst:833 -#, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's :meth:" "`~object.__get__` or :meth:`!__set__` method is called rather than returning " @@ -1664,7 +1580,6 @@ msgstr "" "__set__` 方法,而不是回傳或覆蓋描述器物件。" #: ../../library/dataclasses.rst:837 -#, fuzzy msgid "" "To determine whether a field contains a default value, :deco:`dataclass` " "will call the descriptor's :meth:`!__get__` method using its class access " @@ -1673,11 +1588,11 @@ msgid "" "hand, if the descriptor raises :exc:`AttributeError` in this situation, no " "default value will be provided for the field." msgstr "" -"為了確定一個欄位是否包含預設值,:func:`@dataclass ` 將使用其類別存" -"取形式呼叫描述器的 :meth:`!__get__` 方法(即 ``descriptor.__get__(obj=None, " -"type=cls)``。如果在這種情況下,描述器回傳一個值,它將用作欄位的預設值。另一方" -"面,如果描述器在這種情況下引發 :exc:`AttributeError`,則不會為該欄位提供預設" -"值。" +"為了判斷一個欄位是否包含預設值,:deco:`dataclass` 會使用其類別存取形式來呼叫" +"描述器的 :meth:`!__get__` 方法(即 ``descriptor.__get__(obj=None, " +"type=cls)``)。如果在這種情況下描述器回傳了一個值,它就會被用作該欄位的預設" +"值。反之,如果描述器在這種情況下引發 :exc:`AttributeError`,則不會為該欄位提" +"供預設值。" #: ../../library/dataclasses.rst:847 msgid "" @@ -1734,7 +1649,6 @@ msgstr "" "print(i.quantity_on_hand) # 2" #: ../../library/dataclasses.rst:872 -#, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " "assigned a descriptor object as its default value, the field will act like a " diff --git a/library/dialog.po b/library/dialog.po index 12921fe86bb..1345374e23a 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -39,6 +39,7 @@ msgid "" "Prompt the user to enter a value of the desired type and return it, or " "``None`` if the dialog is cancelled." msgstr "" +"提示使用者輸入所需型別的值並回傳該值,如果對話框被取消則回傳 ``None``。" #: ../../library/dialog.rst:25 msgid "" @@ -49,6 +50,11 @@ msgid "" "value. :func:`askstring` also accepts *show*, a character used to mask the " "entered text, for example ``'*'`` to hide a password." msgstr "" +"*title* 為對話框標題,*prompt* 為顯示在輸入欄位上方的訊息。*initialvalue* 為" +"輸入欄位中最初放置的值。*parent* 為顯示對話框的父視窗。:func:`askinteger` " +"和 :func:`askfloat` 也接受 *minvalue* 和 *maxvalue*,用於限制可接受值的範" +"圍。:func:`askstring` 還接受 *show*,這是一個用於遮蔽輸入文字的字元,例如用 " +"``'*'`` 來隱藏密碼。" #: ../../library/dialog.rst:35 msgid "" @@ -56,11 +62,13 @@ msgid "" "and returns once the user closes it; the entered value is then available in " "the :attr:`!result` attribute." msgstr "" +"自訂對話框的基底類別。將其實例化後會以互動 (modal) 方式顯示對話框,並在使用者" +"關閉對話框後才回傳;使用者輸入的值隨後可透過 :attr:`!result` 屬性取得。" #: ../../library/dialog.rst:41 msgid "" "The value produced by :meth:`apply`, or ``None`` if the dialog was cancelled." -msgstr "" +msgstr ":meth:`apply` 所產生的值,如果對話框被取消則為 ``None``。" #: ../../library/dialog.rst:46 msgid "" @@ -81,6 +89,9 @@ msgid "" "open. The default implementation always returns true; override it to check " "the input." msgstr "" +"驗證使用者輸入的資料。如果資料有效則回傳 true,此時對話框會繼續執行 :meth:" +"`apply`;回傳 false 則保持對話框開啟。預設實作總是回傳 true;覆寫此方法以檢查" +"輸入內容。" #: ../../library/dialog.rst:64 msgid "" @@ -89,12 +100,15 @@ msgid "" "the dialog is destroyed. The default implementation does nothing; override " "it to act on or store the result." msgstr "" +"處理使用者輸入的資料,例如將其儲存到 :attr:`!result` 屬性中。此方法會在 :" +"meth:`validate` 成功之後、對話框被銷毀之前呼叫。預設實作不執行任何動作;覆寫" +"此方法以處理或儲存結果。" #: ../../library/dialog.rst:73 msgid "" "Destroy the dialog window, clearing the reference to the widget that had the " "initial focus." -msgstr "" +msgstr "銷毀對話框視窗,並清除對最初獲得焦點之元件的參照。" #: ../../library/dialog.rst:79 msgid "" @@ -105,12 +119,16 @@ msgid "" "through the window manager, *title* the window title, and *class_* the Tk " "class name of the window." msgstr "" +"一個簡單的互動 (modal) 對話框,會在一列按鈕上方顯示訊息 *text*,這些按鈕的標" +"籤由 *buttons* 給定,並回傳使用者按下之按鈕的索引。*default* 為按下 Return 鍵" +"時所啟動按鈕的索引,*cancel* 為透過視窗管理員關閉視窗時回傳的索引,*title* 為" +"視窗標題,*class_* 為該視窗的 Tk 類別名稱。" #: ../../library/dialog.rst:88 msgid "" "Display the dialog, wait until the user presses a button or closes the " "window, and return the index of the chosen button." -msgstr "" +msgstr "顯示對話框,等待使用者按下按鈕或關閉視窗,然後回傳所選按鈕的索引。" #: ../../library/dialog.rst:94 msgid ":mod:`!tkinter.filedialog` --- File selection dialogs" @@ -128,7 +146,7 @@ msgstr "" #: ../../library/dialog.rst:107 msgid "Native load/save dialogs" -msgstr "" +msgstr "原生的載入/儲存對話框" #: ../../library/dialog.rst:109 msgid "" @@ -180,6 +198,10 @@ msgid "" "vary between platforms and Tk versions, so test the result for truth rather " "than comparing it with a specific value." msgstr "" +"以下函式被呼叫時,會建立一個互動 (modal)、具原生外觀風格的對話框,等待使用者" +"做出選擇後回傳該選擇。實際的回傳值依函式而定(詳見下文);當對話框被取消時," +"回傳值為空字串、空 tuple 或 ``None``。這個空值的確切型別可能因平台和 Tk 版本" +"而有所不同,因此請以真值測試結果,而不要與特定值進行比較。" #: ../../library/dialog.rst:142 msgid "" @@ -188,6 +210,10 @@ msgid "" "a list of the opened file objects, or an empty tuple if cancelled. The files " "are opened in mode *mode* (read-only ``'r'`` by default)." msgstr "" +"建立一個 :class:`Open` 對話框。:func:`askopenfile` 會回傳已開啟的檔案物件,如" +"果對話框被取消則回傳 ``None``。:func:`askopenfiles` 會回傳已開啟檔案物件的 " +"list,如果取消則回傳空 tuple。這些檔案會以模式 *mode* 開啟(預設為唯讀的 " +"``'r'``)。" #: ../../library/dialog.rst:151 msgid "" @@ -195,6 +221,8 @@ msgid "" "``None`` if the dialog is cancelled. The file is opened in mode *mode* " "(``'w'`` by default)." msgstr "" +"建立一個 :class:`SaveAs` 對話框,並回傳已開啟的檔案物件,如果對話框被取消則回" +"傳 ``None``。此檔案會以模式 *mode* 開啟(預設為 ``'w'``)。" #: ../../library/dialog.rst:158 msgid "" @@ -203,12 +231,17 @@ msgid "" "`askopenfilenames` returns a tuple of the selected filenames, or an empty " "tuple if cancelled." msgstr "" +"建立一個 :class:`Open` 對話框。:func:`askopenfilename` 會以字串形式回傳所選取" +"的檔案名稱,如果對話框被取消則回傳空字串。:func:`askopenfilenames` 會回傳所選" +"取檔案名稱的 tuple,如果取消則回傳空 tuple。" #: ../../library/dialog.rst:166 msgid "" "Create a :class:`SaveAs` dialog and return the selected filename as a " "string, or an empty string if the dialog is cancelled." msgstr "" +"建立一個 :class:`SaveAs` 對話框,並以字串形式回傳所選取的檔案名稱,如果對話框" +"被取消則回傳空字串。" #: ../../library/dialog.rst:171 msgid "" @@ -217,6 +250,9 @@ msgid "" "*mustexist* - if true, the user may only select an existing directory (false " "by default)." msgstr "" +"提示使用者選擇一個目錄,並以字串形式回傳其路徑,如果對話框被取消則回傳空字" +"串。額外的關鍵字選項:*mustexist* - 如果為 true,使用者只能選擇已存在的目錄" +"(預設為 false)。" #: ../../library/dialog.rst:179 msgid "" @@ -294,6 +330,8 @@ msgid "" "accepts the selection and closes the dialog; :class:`LoadFileDialog` and :" "class:`SaveFileDialog` override it to check the selection first." msgstr "" +"當使用者確認目前的選擇時呼叫。基底實作會接受該選擇並關閉對話框;:class:" +"`LoadFileDialog` 和 :class:`SaveFileDialog` 會覆寫此方法以先檢查選擇內容。" #: ../../library/dialog.rst:247 msgid "Exit dialog returning filename, if any." @@ -362,12 +400,14 @@ msgid "" "The :mod:`!tkinter.dialog` module provides a simple modal dialog box built " "on the classic (non-themed) Tk widgets." msgstr "" +":mod:`!tkinter.dialog` 模組提供一個簡單的互動 (modal) 對話框,其建構於傳統" +"(非主題化)Tk 元件之上。" #: ../../library/dialog.rst:314 msgid "" "The name of the default bitmap (``'questhead'``) displayed by a :class:" "`Dialog`." -msgstr "" +msgstr "由 :class:`Dialog` 顯示的預設點陣圖 (``'questhead'``) 的名稱。" #: ../../library/dialog.rst:319 msgid "" @@ -379,10 +419,15 @@ msgid "" "button labels). After construction, the :attr:`!num` attribute holds the " "index of the button the user pressed." msgstr "" +"顯示一個由傳統(非主題化)Tk 元件建立的互動 (modal) 對話框,並等待使用者按下" +"其中一個按鈕。透過 *cnf* 或關鍵字引數提供的選項包括:*title*(視窗標題)、" +"*text*(訊息內容)、*bitmap*(圖示,預設為 :data:`DIALOG_ICON`)、*default*" +"(預設按鈕的索引)和 *strings*(按鈕標籤的序列)。建構完成後,:attr:`!num` 屬" +"性會保存使用者按下之按鈕的索引。" #: ../../library/dialog.rst:330 msgid "Destroy the dialog window." -msgstr "" +msgstr "銷毀對話框視窗。" #: ../../library/dialog.rst:335 msgid "Modules :mod:`tkinter.messagebox`, :ref:`tut-files`" diff --git a/library/imaplib.po b/library/imaplib.po index bfa50b7f233..55ac0cf1049 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -139,6 +139,9 @@ msgid "" "certificate and hostname are not verified. To verify them, pass a context " "created by :func:`ssl.create_default_context`." msgstr "" +"在使用預設的 *ssl_context* 時,連線會被加密,但伺服器憑證與主機名稱不會被驗" +"證。若要驗證它們,請傳入由 :func:`ssl.create_default_context` 所建立的 " +"context。" #: ../../library/imaplib.rst:107 msgid "" @@ -872,6 +875,9 @@ msgid "" "`3501`, section 7.4.2), so production code should inspect the whole response " "rather than rely on ``data[0][1]``." msgstr "" +"一個 ``FETCH`` 回應可能會包含額外或未經請求的資料(參閱\\ :rfc:`3501`\\ 第 " +"7.4.2 節),因此正式環境中的程式碼應該檢查整個回應,而不是僅依賴 ``data[0]" +"[1]``。" #: ../../library/imaplib.rst:17 msgid "IMAP4" diff --git a/library/numbers.po b/library/numbers.po index 040dd7e9d20..e72e9a00f47 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -145,15 +145,13 @@ msgid "Notes for type implementers" msgstr "給型別實作者的註記" #: ../../library/numbers.rst:91 -#, fuzzy msgid "" "Implementers should be careful to make equal numbers equal and hash them to " "the same values. This may be subtle if there are two different extensions of " "the real numbers. See also :ref:`numeric-hash`." msgstr "" -"實作者需注意,相等的數值除了大小相等外,還必須擁有同樣的雜湊值。當使用兩個不" -"同的實數擴充時,這可能是很微妙的。例如,:class:`fractions.Fraction` 底下的 :" -"func:`hash` 實作如下: ::" +"實作者應謹慎地讓相等的數值相等,並將它們雜湊為相同的值。若存在兩種不同的實數" +"擴充,這可能會很微妙。另請參閱 :ref:`numeric-hash`。" #: ../../library/numbers.rst:97 msgid "Adding More Numeric ABCs" diff --git a/library/os.po b/library/os.po index ab140bd3ce6..2fccd45be60 100644 --- a/library/os.po +++ b/library/os.po @@ -926,7 +926,7 @@ msgstr "" msgid "" "Returns information identifying the current operating system. The return " "value is a :class:`uname_result`." -msgstr "" +msgstr "回傳識別目前作業系統的資訊,回傳值是一個 :class:`uname_result`。" #: ../../library/os.rst:796 msgid "" @@ -938,7 +938,7 @@ msgstr "" #: ../../library/os.rst:802 msgid ":data:`sys.platform` which has finer granularity." -msgstr "" +msgstr ":data:`sys.platform`,其粒度更精細。" #: ../../library/os.rst:809 ../../library/os.rst:5236 msgid "" @@ -951,6 +951,8 @@ msgid "" "Name and information about the system returned by :func:`os.uname`. These " "attributes correspond to the members described in :manpage:`uname(2)`." msgstr "" +"由 :func:`os.uname` 回傳的系統名稱與相關資訊。這些屬性對應於 :manpage:" +"`uname(2)` 中描述的成員。" #: ../../library/os.rst:819 msgid "" @@ -959,11 +961,14 @@ msgid "" "nodename`, :attr:`~uname_result.release`, :attr:`~uname_result.version`, " "and :attr:`~uname_result.machine` in that order." msgstr "" +"為了向後相容,此物件也是可疊代的,其行為就像一個依序包含 :attr:" +"`~uname_result.sysname`、:attr:`~uname_result.nodename`、:attr:" +"`~uname_result.release`、:attr:`~uname_result.version` 和 :attr:" +"`~uname_result.machine` 的五元組。" #: ../../library/os.rst:827 -#, fuzzy msgid "Operating system name." -msgstr ":attr:`sysname` - 作業系統名稱" +msgstr "作業系統名稱。" #: ../../library/os.rst:831 msgid "" @@ -972,19 +977,21 @@ msgid "" "the hostname is :func:`socket.gethostname` or even ``socket." "gethostbyaddr(socket.gethostname())``." msgstr "" +"網路上的機器名稱。有些系統會將 :attr:`~uname_result.nodename` 截斷為 8 個字元" +"或僅保留開頭的部分;取得主機名稱較好的方式是使用 :func:`socket.gethostname`," +"甚至是 ``socket.gethostbyaddr(socket.gethostname())``。" #: ../../library/os.rst:838 msgid "Operating system release." -msgstr "" +msgstr "作業系統發行版本。" #: ../../library/os.rst:842 -#, fuzzy msgid "Operating system version." -msgstr ":attr:`version` - 作業系統版本" +msgstr "作業系統版本。" #: ../../library/os.rst:846 msgid "Hardware identifier." -msgstr "" +msgstr "硬體識別碼。" #: ../../library/os.rst:853 msgid "" @@ -1298,6 +1305,9 @@ msgid "" "file descriptor *fd* in a :class:`statvfs_result`, like :func:`statvfs`. As " "of Python 3.3, this is equivalent to ``os.statvfs(fd)``." msgstr "" +"以 :class:`statvfs_result` 回傳檔案描述器 *fd* 所關聯檔案所在檔案系統的相關資" +"訊,就像 :func:`statvfs` 一樣。自 Python 3.3 起,這等同於 ``os." +"statvfs(fd)``。" #: ../../library/os.rst:1136 msgid "" @@ -3860,46 +3870,51 @@ msgid "" "on the given path and correspond to the members of the :c:struct:`statvfs` " "structure." msgstr "" +"對給定的路徑執行 :manpage:`statvfs(3)` 系統呼叫。回傳值是一個 :class:" +"`statvfs_result`,其屬性描述給定路徑所在的檔案系統,並對應到 :c:struct:" +"`statvfs` 結構的成員。" #: ../../library/os.rst:3417 msgid "" "Filesystem statistics returned by :func:`os.statvfs` and :func:`os." "fstatvfs`. See :manpage:`statvfs(3)` for more details." msgstr "" +"由 :func:`os.statvfs` 和 :func:`os.fstatvfs` 回傳的檔案系統統計資訊。更多細節" +"請見 :manpage:`statvfs(3)`。" #: ../../library/os.rst:3422 msgid "Block size." -msgstr "" +msgstr "區塊大小。" #: ../../library/os.rst:3426 msgid "Fragment size." -msgstr "" +msgstr "片段大小。" #: ../../library/os.rst:3430 msgid "" "Number of :attr:`~statvfs_result.f_frsize` sized blocks the filesystem can " "contain." -msgstr "" +msgstr "檔案系統可容納的 :attr:`~statvfs_result.f_frsize` 大小區塊數量。" #: ../../library/os.rst:3435 msgid "Number of free blocks." -msgstr "" +msgstr "可用區塊數量。" #: ../../library/os.rst:3439 msgid "Number of free blocks for unprivileged users." -msgstr "" +msgstr "非特權使用者可用的區塊數量。" #: ../../library/os.rst:3443 msgid "Number of file entries, inodes, the filesystem can contain." -msgstr "" +msgstr "檔案系統可容納的檔案項目(inode)數量。" #: ../../library/os.rst:3447 msgid "Number of free files entries." -msgstr "" +msgstr "可用檔案項目數量。" #: ../../library/os.rst:3451 msgid "Number of free file entries for unprivileged users." -msgstr "" +msgstr "非特權使用者可用的檔案項目數量。" #: ../../library/os.rst:3455 msgid "" @@ -3909,6 +3924,10 @@ msgid "" "data:`ST_IMMUTABLE`, :data:`ST_NOATIME`, :data:`ST_NODIRATIME`, and :data:" "`ST_RELATIME`." msgstr "" +"掛載旗標的位元遮罩。定義了以下旗標::data:`ST_RDONLY`、:data:`ST_NOSUID`、:" +"data:`ST_NODEV`、:data:`ST_NOEXEC`、:data:`ST_SYNCHRONOUS`、:data:" +"`ST_MANDLOCK`、:data:`ST_WRITE`、:data:`ST_APPEND`、:data:`ST_IMMUTABLE`、:" +"data:`ST_NOATIME`、:data:`ST_NODIRATIME` 和 :data:`ST_RELATIME`。" #: ../../library/os.rst:3463 msgid "" @@ -3916,62 +3935,64 @@ msgid "" "`Windows MAX_PATH ` and those described in Linux :manpage:" "`pathname(7)` may exist." msgstr "" +"檔案系統的最大檔名長度。可能會有作業系統特定的限制,例如 :ref:`Windows " +"MAX_PATH ` 以及 Linux :manpage:`pathname(7)` 中所描述的限制。" #: ../../library/os.rst:3469 msgid "Filesystem ID." -msgstr "" +msgstr "檔案系統 ID。" #: ../../library/os.rst:3474 msgid "The following flags are used in :attr:`statvfs_result.f_flag`." -msgstr "" +msgstr "以下旗標用於 :attr:`statvfs_result.f_flag`。" #: ../../library/os.rst:3478 msgid "Read-only filesystem." -msgstr "" +msgstr "唯讀檔案系統。" #: ../../library/os.rst:3484 msgid "Setuid/setgid bits are disabled or not supported." -msgstr "" +msgstr "Setuid/setgid 位元被停用或不受支援。" #: ../../library/os.rst:3490 msgid "Disallow access to device special files." -msgstr "" +msgstr "不允許存取裝置特殊檔案。" #: ../../library/os.rst:3498 msgid "Disallow program execution." -msgstr "" +msgstr "不允許執行程式。" #: ../../library/os.rst:3506 msgid "Writes are synced at once." -msgstr "" +msgstr "寫入會立即同步。" #: ../../library/os.rst:3514 msgid "Allow mandatory locks on an FS." -msgstr "" +msgstr "允許在檔案系統上使用強制鎖。" #: ../../library/os.rst:3522 msgid "Write on file/directory/symlink." -msgstr "" +msgstr "可對檔案、目錄或符號連結進行寫入。" #: ../../library/os.rst:3530 msgid "Append-only file." -msgstr "" +msgstr "僅附加檔案。" #: ../../library/os.rst:3538 msgid "Immutable file." -msgstr "" +msgstr "不可變檔案。" #: ../../library/os.rst:3546 msgid "Do not update access times." -msgstr "" +msgstr "不更新存取時間。" #: ../../library/os.rst:3554 msgid "Do not update directory access times." -msgstr "" +msgstr "不更新目錄存取時間。" #: ../../library/os.rst:3562 msgid "Update atime relative to mtime/ctime." -msgstr "" +msgstr "相對於 mtime/ctime 更新 atime。" #: ../../library/os.rst:3571 msgid "" diff --git a/library/pyexpat.po b/library/pyexpat.po index c93cd0e02cf..bd859e3f587 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -292,19 +292,21 @@ msgstr ":class:`!xmlparser` 物件擁有以下方法來調整對一些常見 XML msgid "" "Sets the number of output bytes needed to activate protection against " "`billion laughs`_ attacks." -msgstr "" +msgstr "設定啟用\\ `billion laughs`_ 攻擊防護所需的輸出位元組數。" #: ../../library/pyexpat.rst:249 msgid "" "The number of output bytes includes amplification from entity expansion and " "reading DTD files." -msgstr "" +msgstr "此輸出位元組數包含了由實體擴展和讀取 DTD 檔案所產生的放大量。" #: ../../library/pyexpat.rst:252 msgid "" "Parser objects usually have a protection activation threshold of 8 MiB, but " "the actual default value depends on the underlying Expat library." msgstr "" +"剖析器物件通常具有 8 MiB 的防護啟用閾值,但實際的預設值取決於底層的 Expat 函" +"式庫。" #: ../../library/pyexpat.rst:255 ../../library/pyexpat.rst:307 msgid "" @@ -318,12 +320,14 @@ msgid "" "Activation thresholds below 4 MiB are known to break support for DITA 1.3 " "payload and are hence not recommended." msgstr "" +"已知低於 4 MiB 的啟用閾值會破壞對 DITA 1.3 酬載(payload)的支援,因此不建議" +"使用。" #: ../../library/pyexpat.rst:269 msgid "" "Sets the maximum tolerated amplification factor for protection against " "`billion laughs`_ attacks." -msgstr "" +msgstr "設定\\ `billion laughs`_ 攻擊防護所能容許的最大放大係數。" #: ../../library/pyexpat.rst:272 msgid "" @@ -332,6 +336,9 @@ msgid "" "document in parsing and ``indirect`` is the number of bytes added by " "expanding entities and reading of external DTD files." msgstr "" +"放大係數在剖析過程中以 ``(direct + indirect) / direct`` 計算,其中 " +"``direct`` 是剖析主要文件時所讀取的位元組數,``indirect`` 則是展開實體和讀取" +"外部 DTD 檔案所增加的位元組數。" #: ../../library/pyexpat.rst:277 msgid "" @@ -341,12 +348,17 @@ msgid "" "benign files in practice. In particular, the activation threshold should be " "carefully chosen to avoid false positives." msgstr "" +"*max_factor* 值必須是大於或等於 1.0 且非 NaN 的\\ :class:`float` 值。實務上," +"即使是良性的小型檔案,也曾觀察到整個酬載的峰值放大係數達到 15,000,而在剖析過" +"程中甚至曾達到 30,000。因此,應謹慎選擇啟用閾值以避免誤判。" #: ../../library/pyexpat.rst:283 ../../library/pyexpat.rst:329 msgid "" "Parser objects usually have a maximum amplification factor of 100, but the " "actual default value depends on the underlying Expat library." msgstr "" +"剖析器物件通常具有 100 的最大放大係數,但實際的預設值取決於底層的 Expat 函式" +"庫。" #: ../../library/pyexpat.rst:286 ../../library/pyexpat.rst:332 msgid "" @@ -362,6 +374,9 @@ msgid "" "can be adjusted by :meth:`." "SetBillionLaughsAttackProtectionActivationThreshold` is exceeded." msgstr "" +"只有在超過可透過 :meth:`." +"SetBillionLaughsAttackProtectionActivationThreshold` 調整的閾值時,才會考慮最" +"大放大係數。" #: ../../library/pyexpat.rst:301 msgid "" @@ -374,6 +389,8 @@ msgid "" "Parser objects usually have an allocation activation threshold of 64 MiB, " "but the actual default value depends on the underlying Expat library." msgstr "" +"剖析器物件通常具有 64 MiB 的記憶體分配啟用閾值,但實際的預設值取決於底層的 " +"Expat 函式庫。" #: ../../library/pyexpat.rst:316 msgid "" diff --git a/library/shutil.po b/library/shutil.po index 7d987d1731e..a152a8ae5d4 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -514,12 +514,18 @@ msgid "" "*copy_function*, in which case *src* is copied to the destination using " "*copy_function* and then removed." msgstr "" +"當 *src* 與目的地位於同一個檔案系統時,內部會優先使用 :func:`os.rename`。如" +"果 :func:`os.rename` 因 :exc:`OSError` 而失敗(例如:使用者對目的地檔案有寫入" +"權限,但對其父目錄沒有),此方法會改用 *copy_function* 作為後備方案;在這種情" +"況下,*src* 會使用 *copy_function* 被複製到目的地,然後再被移除。" #: ../../library/shutil.rst:397 msgid "" "In case of symlinks, a new symlink pointing to the target of *src* will be " "created in or as the destination, and *src* will be removed." msgstr "" +"如果是符號連結,會在目的地中(或作為目的地本身)建立一個指向 *src* 目標的新符" +"號連結,然後 *src* 會被移除。" #: ../../library/shutil.rst:400 msgid "" diff --git a/library/socket.po b/library/socket.po index aa4ba04189e..6fb4987a04a 100644 --- a/library/socket.po +++ b/library/socket.po @@ -955,6 +955,8 @@ msgid "" "The :class:`socket ` class constructor creates a new socket " "directly; see :ref:`socket-objects` for its parameters and full description." msgstr "" +":class:`socket ` 類別建構函式會直接建立一個新的 socket;其參數" +"和完整說明請參閱 :ref:`socket-objects`。" #: ../../library/socket.rst:846 msgid "" @@ -1811,7 +1813,7 @@ msgstr "" msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`!close` call is made." -msgstr "" +msgstr "現在如果呼叫底層 :c:func:`!close` 時發生錯誤,會引發 :exc:`OSError`。" #: ../../library/socket.rst:1580 msgid "" @@ -1861,6 +1863,10 @@ msgid "" "of the :c:data:`errno` variable. This is useful to support, for example, " "asynchronous connects." msgstr "" +"與 ``connect(address)`` 類似,但在 C 層級的 :c:func:`!connect` 呼叫回傳錯誤" +"時,會回傳錯誤指示值而不是引發例外(其他問題,例如「host not found」,仍然可" +"能引發例外)。若操作成功,錯誤指示值為 ``0``,否則為 :c:data:`errno` 變數的" +"值。這對於支援非同步連線等情況相當有用。" #: ../../library/socket.rst:1624 msgid "" @@ -2081,6 +2087,9 @@ msgid "" "conditions such as unrelated control messages being received). See also :" "meth:`sendmsg`. ::" msgstr "" +"在支援 :const:`!SCM_RIGHTS` 機制的系統上,以下函式最多可以接收 *maxfds* 個檔" +"案描述符,並回傳訊息資料和包含這些描述符的串列(同時忽略如收到不相關控制訊息" +"等非預期情況)。另請參閱 :meth:`sendmsg`。 ::" #: ../../library/socket.rst:1848 msgid "" @@ -2239,6 +2248,8 @@ msgid "" "const:`AF_UNIX` socket, on systems which support the :const:`!SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" +"以下函式會在支援 :const:`!SCM_RIGHTS` 機制的系統上,透過 :const:`AF_UNIX` " +"socket 傳送檔案描述符串列 *fds*。另請參閱 :meth:`recvmsg`。 ::" #: ../../library/socket.rst:2006 msgid "" @@ -2323,6 +2334,10 @@ msgid "" "completed. If zero is given, the socket is put in non-blocking mode. If " "``None`` is given, the socket is put in blocking mode." msgstr "" +"為阻塞的 socket 操作設定超時時間。*value* 引數可以是表示秒數的非負實數,或 " +"``None``。如果給定非零值,當操作尚未完成而超過超時期間 *value* 時,後續的 " +"socket 操作將引發 :exc:`timeout` 例外。如果給定零,則 socket 會被設為非阻塞模" +"式。如果給定 ``None``,則 socket 會被設為阻塞模式。" #: ../../library/socket.rst:2082 msgid "" @@ -2348,6 +2363,13 @@ msgid "" "*optlen* argument is required. It's equivalent to calling :c:func:`!" "setsockopt` C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" +"設定給定 socket 選項的值(請參閱 Unix 使用手冊 :manpage:`setsockopt(2)`)。所" +"需的符號常數已在此模組中定義(:ref:`!SO_\\* etc. `)。" +"此值可以是整數、``None``,或表示緩衝區的\\ :term:`類位元組串物件 `。在後者的情況下,呼叫者需自行確保該位元組字串包含正確的位元(可選的" +"內建模組 :mod:`struct` 提供了將 C 結構編碼為位元組字串的方法)。當 *value* 設" +"為 ``None`` 時,需提供 *optlen* 引數。這相當於以 ``optval=NULL`` 和 " +"``optlen=optlen`` 呼叫 C 函式 :c:func:`!setsockopt`。" #: ../../library/socket.rst:2107 msgid "setsockopt(level, optname, None, optlen: int) form added." @@ -2377,6 +2399,8 @@ msgid "" "Note that there are no methods :meth:`!read` or :meth:`!write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" +"請注意,這裡沒有 :meth:`!read` 或 :meth:`!write` 方法;請改用不帶 *flags* 引" +"數的 :meth:`~socket.recv` 和 :meth:`~socket.send`。" #: ../../library/socket.rst:2140 msgid "" @@ -2403,6 +2427,10 @@ msgid "" "is true, but ``SocketType`` is not the same as ``type(socket(...))``, which " "is :class:`~socket.socket` itself." msgstr "" +":class:`~socket.socket` 型別的基底類別,從 :mod:`!_socket` 重新匯出。諸如 " +"``isinstance(socket(...), SocketType)`` 這樣的實例檢查會為真,但 " +"``SocketType`` 和 ``type(socket(...))`` 並不相同,後者即為 :class:`~socket." +"socket` 本身。" #: ../../library/socket.rst:2170 msgid "Notes on socket timeouts" diff --git a/library/stdtypes.po b/library/stdtypes.po index fd8667e25b1..b515fc4a372 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -3560,6 +3560,11 @@ msgid "" "Kharosthi#Numerals>`__. Formally, a digit is a character that has the " "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" +"如果字串中所有字元皆為數字,且至少有一個字元,則回傳 ``True``,否則回傳 " +"``False``。數字包括十進位字元,以及需要特殊處理的數字,例如相容性上標數字。這" +"涵蓋了無法用來組成十進位數字的數字,例如\\ `佉盧文數字 `__\\ 。正式來說,數字是指具有 " +"Numeric_Type=Digit 或 Numeric_Type=Decimal 屬性值的字元。" #: ../../library/stdtypes.rst:2181 ../../library/stdtypes.rst:2262 #: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:2306 @@ -8568,6 +8573,8 @@ msgid "" "Instances of ``GenericAlias`` are not classes at runtime, even though they " "behave like classes (they can be instantiated and subclassed)::" msgstr "" +"``GenericAlias`` 的實例在執行期並不是類別,儘管它們的行為與類別相似(它們可以" +"被實例化及子類別化): ::" #: ../../library/stdtypes.rst:5876 msgid "" @@ -8575,6 +8582,9 @@ msgid "" ">>> inspect.isclass(list[int])\n" "False" msgstr "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" #: ../../library/stdtypes.rst:5880 msgid "" diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index d7ff30aa1ac..dacb97836a3 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -42,6 +42,8 @@ msgid "" "use the :func:`askcolor` convenience function rather than instantiating this " "class directly." msgstr "" +"實作互動式顏色選擇對話框的類別。大多數應用程式會使用 :func:`askcolor` 這個便" +"利函式,而不是直接將此類別實例化。" #: ../../library/tkinter.colorchooser.rst:24 msgid "" @@ -52,12 +54,16 @@ msgid "" "color string, such as ``'#ff8000'``. If the user cancels the dialog, " "``(None, None)`` is returned." msgstr "" +"顯示一個互動式顏色選擇對話框,並回傳所選擇的顏色。*color* 是對話框開啟時所選" +"取的顏色。回傳值是一個元組 ``((r, g, b), hexstr)``,其中 ``r``、``g`` 和 " +"``b`` 是紅、綠、藍分量,為範圍 0 到 255 的整數,而 *hexstr* 則是等價的 Tk 顏" +"色字串,例如 ``'#ff8000'``。如果使用者取消對話框,則會回傳 ``(None, None)``。" #: ../../library/tkinter.colorchooser.rst:31 msgid "" "The RGB values in the returned color are now integers in the range 0–255 " "instead of floats." -msgstr "" +msgstr "回傳顏色中的 RGB 值現在是範圍 0 到 255 的整數,而不是浮點數。" #: ../../library/tkinter.colorchooser.rst:38 msgid "Module :mod:`tkinter.commondialog`" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 85d10d41d94..7b4a3ac7ae2 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -116,6 +116,8 @@ msgid "" "`DndHandler` instance managing the drag, or ``None`` if a drag could not be " "started." msgstr "" +"用於拖放過程的工廠函式。回傳管理該次拖放的 :class:`DndHandler` 實例,如果無法" +"啟動拖放則回傳 ``None``。" #: ../../library/tkinter.dnd.rst:66 msgid ":ref:`Bindings-and-Events`" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 342f4a85f6f..5739e83b842 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -53,6 +53,8 @@ msgid "" "Two fonts now compare equal (``==``) only when both are :class:`Font` " "instances with the same name belonging to the same Tcl interpreter." msgstr "" +"現在只有當兩個字型都是屬於同一個 Tcl 直譯器且名稱相同的 :class:`Font` 實例" +"時,兩者才會比較相等 (``==``)。" #: ../../library/tkinter.font.rst:33 msgid "arguments:" @@ -117,6 +119,9 @@ msgid "" "dictionary of all the attributes; if *option* is given, return the value of " "that single attribute." msgstr "" +"回傳字型的實際屬性,這可能會因為平台限制而與所要求的不同。若沒有指定 " +"*option*,則回傳包含所有屬性的 dictionary;若有指定 *option*,則回傳該單一屬" +"性的值。" #: ../../library/tkinter.font.rst:60 msgid "Retrieve an attribute of the font." @@ -127,10 +132,11 @@ msgid "" "Modify one or more attributes of the font. With no arguments, return a " "dictionary of the current attributes." msgstr "" +"修改字型的一個或多個屬性。若沒有引數,則回傳包含目前屬性的 dictionary。" #: ../../library/tkinter.font.rst:70 msgid ":meth:`config` is an alias of :meth:`!configure`." -msgstr "" +msgstr ":meth:`config` 是 :meth:`!configure` 的別名。" #: ../../library/tkinter.font.rst:74 msgid "Return new instance of the current font." @@ -151,6 +157,8 @@ msgid "" "metric name to its integer value; if one option name is given, return that " "metric's value as an integer. Options include:" msgstr "" +"回傳字型特定的資料。若沒有指定選項,則回傳將每個度量名稱對映至其整數值的 " +"dictionary;若有指定一個選項名稱,則以整數回傳該度量的值。其選項包含:" #: ../../library/tkinter.font.rst:90 msgid "*ascent* - distance between baseline and highest point that a" @@ -190,6 +198,8 @@ msgid "" "*root* is the widget whose Tcl interpreter owns the font; if omitted, the " "default root window is used." msgstr "" +"回傳一個 :class:`Font`,代表現有已命名字型 *name*。*root* 為擁有該字型所屬 " +"Tcl 直譯器的元件;若省略,則使用預設的根視窗。" #: ../../library/tkinter.font.rst:115 msgid "The *root* parameter was added." diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 366ddf4123c..4881212d658 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -156,7 +156,7 @@ msgstr "安排一組需顯示的\\ :ref:`預先定義的按鈕組合 ` and :class:`ttk.Treeview `, which provide " "their own :meth:`!bbox` method." msgstr "" +":meth:`bbox` 是 :meth:`!grid_bbox` 的別名,但 :class:`Canvas`、:class:" +"`Listbox`、:class:`Spinbox`、:class:`Text`、:class:`ttk.Entry ` 和 :class:`ttk.Treeview ` 除外,它們提供了自己" +"的 :meth:`!bbox` 方法。" #: ../../library/tkinter.rst:1184 msgid "" @@ -2376,14 +2438,17 @@ msgid "" "affect every column, or a child widget whose occupied columns are affected. " "The supported options are:" msgstr "" +"查詢或設定此容器所管理格線中欄(或多欄)*index* 的屬性。*index* 可以是一個欄" +"編號;在設定選項時,它也可以是一個欄編號的串列、字串 ``'all'``\\ (表示影響每" +"一欄),或一個子元件(表示影響其所占用的欄)。支援的選項有:" #: ../../library/tkinter.rst:1191 msgid "*minsize*" -msgstr "" +msgstr "*minsize*" #: ../../library/tkinter.rst:1192 msgid "The column's minimum size, in pixels." -msgstr "" +msgstr "該欄的最小尺寸,以像素為單位。" #: ../../library/tkinter.rst:1194 msgid "*weight*" @@ -2395,36 +2460,41 @@ msgid "" "A weight of ``0`` keeps the column at its requested size, and a column of " "weight two grows twice as fast as a column of weight one." msgstr "" +"一個整數,設定多餘空間要分配給該欄多少比例。權重為 ``0`` 會讓該欄維持其要求的" +"大小,權重為 2 的欄的成長速度會是權重為 1 的欄的兩倍。" #: ../../library/tkinter.rst:1200 msgid "*uniform*" -msgstr "" +msgstr "*uniform*" #: ../../library/tkinter.rst:1201 msgid "" "The name of a uniform group. Columns sharing a non-empty group name are kept " "in sizes that are strictly proportional to their weights." msgstr "" +"統一群組的名稱。共享相同非空群組名稱的欄,其大小會嚴格按照其權重成比例保持。" #: ../../library/tkinter.rst:1205 msgid "*pad*" -msgstr "" +msgstr "*pad*" #: ../../library/tkinter.rst:1206 msgid "" "Extra space, in pixels, added to the largest widget in the column when " "computing the column's size." -msgstr "" +msgstr "在計算欄的大小時,加到該欄中最大元件上的額外空間,以像素為單位。" #: ../../library/tkinter.rst:1209 msgid "" "With a single option name, return that option's value; with no options, " "return a dictionary of all of them." msgstr "" +"若給出單一選項名稱,則回傳該選項的值;若不給出任何選項,則回傳所有選項組成的" +"字典。" #: ../../library/tkinter.rst:1212 msgid ":meth:`columnconfigure` is an alias of :meth:`!grid_columnconfigure`." -msgstr "" +msgstr ":meth:`columnconfigure` 是 :meth:`!grid_columnconfigure` 的別名。" #: ../../library/tkinter.rst:1219 msgid "" @@ -2433,10 +2503,13 @@ msgid "" "`grid_columnconfigure`, and the supported options (*minsize*, *weight*, " "*uniform* and *pad*) are the same, applied to a row instead of a column." msgstr "" +"查詢或設定此容器所管理格線中列(或多列)*index* 的屬性。*index* 的解釋方式" +"與 :meth:`grid_columnconfigure` 相同,支援的選項(*minsize*、*weight*、" +"*uniform* 和 *pad*)也相同,只是套用於列而非欄。" #: ../../library/tkinter.rst:1225 msgid ":meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." -msgstr "" +msgstr ":meth:`rowconfigure` 是 :meth:`!grid_rowconfigure` 的別名。" #: ../../library/tkinter.rst:1229 msgid "" @@ -2445,6 +2518,8 @@ msgid "" "locations above or to the left of the grid, ``-1`` is returned for the " "corresponding coordinate." msgstr "" +"回傳包含位置 (*x*, *y*)(以相對於此容器的像素給出)的格線儲存格之 ``(column, " +"row)``。對於格線上方或左方的位置,對應的座標會回傳 ``-1``。" #: ../../library/tkinter.rst:1237 msgid "" @@ -2454,18 +2529,23 @@ msgid "" "is false, its size is left under your control. Called with no argument, " "return the current setting as a boolean." msgstr "" +"當此容器使用 grid 佈局管理器管理其子元件時,啟用或停用佈局傳播。當 *flag* 為" +"真時,容器會調整自身大小以符合其子元件要求的大小;當為假時,其大小則由你自行" +"控制。若不帶引數呼叫,則以布林值回傳目前的設定。" #: ../../library/tkinter.rst:1249 msgid "" "Return the size of the grid managed by this container as a ``(columns, " "rows)`` tuple." -msgstr "" +msgstr "以 ``(columns, rows)`` tuple 的形式,回傳此容器所管理格線的大小。" #: ../../library/tkinter.rst:1252 msgid "" ":meth:`size` is an alias of :meth:`!grid_size`, except on the :class:" "`Listbox` widget, which provides its own :meth:`!size` method." msgstr "" +":meth:`size` 是 :meth:`!grid_size` 的別名,但 :class:`Listbox` 元件除外,它提" +"供了自己的 :meth:`!size` 方法。" #: ../../library/tkinter.rst:1258 msgid "" @@ -2473,6 +2553,8 @@ msgid "" "recently managed first. If *row* or *column* is given, only the children in " "that row or column are returned." msgstr "" +"回傳此容器格線中所管理子元件的串列,最近被管理的排在最前面。如果給出了 *row* " +"或 *column*,則只回傳該列或該欄中的子元件。" #: ../../library/tkinter.rst:1270 msgid "" @@ -2482,31 +2564,34 @@ msgid "" "is false, its size is left under your control. Called with no argument, " "return the current setting as a boolean." msgstr "" +"當此容器使用 pack 佈局管理器管理其子元件時,啟用或停用佈局傳播。當 *flag* 為" +"真時,容器會調整自身大小以符合其子元件要求的大小;當為假時,其大小則由你自行" +"控制。若不帶引數呼叫,則以布林值回傳目前的設定。" #: ../../library/tkinter.rst:1277 msgid ":meth:`propagate` is an alias of :meth:`!pack_propagate`." -msgstr "" +msgstr ":meth:`propagate` 是 :meth:`!pack_propagate` 的別名。" #: ../../library/tkinter.rst:1284 msgid "" "Return a list of the child widgets managed by this container with the pack " "geometry manager, in packing order." -msgstr "" +msgstr "以 packing 的順序,回傳此容器透過 pack 佈局管理器所管理子元件的串列。" #: ../../library/tkinter.rst:1287 msgid ":meth:`slaves` is an alias of :meth:`!pack_slaves`." -msgstr "" +msgstr ":meth:`slaves` 是 :meth:`!pack_slaves` 的別名。" #: ../../library/tkinter.rst:1291 msgid "" "Return a list of the child widgets managed by this container with the place " "geometry manager." -msgstr "" +msgstr "回傳此容器透過 place 佈局管理器所管理子元件的串列。" #: ../../library/tkinter.rst:1296 msgid "" "Bind the event pattern *sequence* on this widget to the callable *func*." -msgstr "" +msgstr "將此元件上的事件模式 *sequence* 繫結到可呼叫物件 *func*。" #: ../../library/tkinter.rst:1298 msgid "" @@ -2517,6 +2602,10 @@ msgid "" "if *func* returns the string ``'break'``, no further bindings for the event " "are invoked." msgstr "" +"*sequence* 是一個事件模式,例如 ``''``\\ (滑鼠點擊)或 " +"``''``,也可以是數個必須在短時間內接連發生的此類模式的串接。當事" +"件發生時,會以描述該事件的 :class:`Event` 實例作為唯一引數呼叫 *func*;如果 " +"*func* 回傳字串 ``'break'``,則不會再呼叫該事件的其他繫結。" #: ../../library/tkinter.rst:1305 msgid "" @@ -2524,6 +2613,8 @@ msgid "" "*sequence*; otherwise it replaces them. The binding applies only to this " "widget." msgstr "" +"如果 *add* 為真,*func* 會被新增到已繫結到 *sequence* 的函式中;否則它會取代" +"它們。此繫結僅適用於此元件。" #: ../../library/tkinter.rst:1309 msgid "" @@ -2531,6 +2622,8 @@ msgid "" "passed to :meth:`unbind` to remove the binding without leaking the " "associated Tcl command." msgstr "" +":meth:`!bind` 會回傳一個字串識別碼(*funcid*),之後可以將其傳遞給 :meth:" +"`unbind`,以移除該繫結而不會洩漏相關聯的 Tcl 指令。" #: ../../library/tkinter.rst:1313 msgid "" @@ -2538,6 +2631,8 @@ msgid "" "*sequence*; if *sequence* is also omitted, return a list of all the " "sequences for which bindings exist on this widget." msgstr "" +"如果省略 *func*,則回傳目前與 *sequence* 關聯的繫結;如果同時省略 " +"*sequence*,則回傳此元件上所有存在繫結的事件序列串列。" #: ../../library/tkinter.rst:1319 msgid "" @@ -2548,20 +2643,26 @@ msgid "" "The set of binding tags for a widget can be inspected and changed with :meth:" "`bindtags`." msgstr "" +"與 :meth:`bind` 類似,但將 *func* 繫結到繫結標籤 *className*,而不是單一元" +"件,使該繫結適用於具有該標籤的每個元件。*className* 通常是元件類別的名稱,例" +"如 ``'Button'``,此時該繫結會影響該類別的所有元件。可以使用 :meth:`bindtags` " +"檢查和變更元件的繫結標籤集合。" #: ../../library/tkinter.rst:1327 ../../library/tkinter.rst:1334 msgid "The remaining arguments and the return value are as for :meth:`bind`." -msgstr "" +msgstr "其餘的引數和回傳值與 :meth:`bind` 相同。" #: ../../library/tkinter.rst:1331 msgid "" "Like :meth:`bind`, but bind *func* to the special binding tag ``'all'``, so " "that the binding applies to every widget in the application." msgstr "" +"與 :meth:`bind` 類似,但將 *func* 繫結到特殊的繫結標籤 ``'all'``,使該繫結適" +"用於應用程式中的每個元件。" #: ../../library/tkinter.rst:1338 msgid "Remove bindings for the event pattern *sequence* on this widget." -msgstr "" +msgstr "移除此元件上事件模式 *sequence* 的繫結。" #: ../../library/tkinter.rst:1340 msgid "" @@ -2570,24 +2671,33 @@ msgid "" "command is deleted. Otherwise all bindings for *sequence* are destroyed, " "leaving it unbound." msgstr "" +"如果給出了 *funcid*,則只會移除由它識別的函式(先前呼叫 :meth:`bind` 所回傳的" +"值),並刪除其相關聯的 Tcl 指令。否則,*sequence* 的所有繫結都會被銷毀,使其" +"變為未繫結狀態。" #: ../../library/tkinter.rst:1345 msgid "" "If *funcid* is given, only that callback is unbound; other callbacks bound " "to *sequence* are kept." msgstr "" +"如果給出了 *funcid*,則只會解除該回呼的繫結;其他繫結到 *sequence* 的回呼會被" +"保留。" #: ../../library/tkinter.rst:1352 msgid "" "Remove all bindings for the event pattern *sequence* from the binding tag " "*className*. See :meth:`bind_class`." msgstr "" +"從繫結標籤 *className* 中移除事件模式 *sequence* 的所有繫結。請參閱 :meth:" +"`bind_class`。" #: ../../library/tkinter.rst:1358 msgid "" "Remove all bindings for the event pattern *sequence* from the special " "binding tag ``'all'``. See :meth:`bind_all`." msgstr "" +"從特殊繫結標籤 ``'all'`` 中移除事件模式 *sequence* 的所有繫結。請參閱 :meth:" +"`bind_all`。" #: ../../library/tkinter.rst:1364 msgid "" @@ -2598,6 +2708,10 @@ msgid "" "pathname, its widget class, the pathname of its nearest toplevel ancestor, " "and ``'all'``, in that order." msgstr "" +"如果省略 *tagList*,則回傳與此元件關聯的繫結標籤 tuple。當元件上發生事件時," +"會依序套用到該元件的每個繫結標籤,並針對每個標籤執行最符合的繫結。預設情況" +"下,一個元件有四個繫結標籤:它自己的路徑名稱、它的元件類別、其最近的頂層祖先" +"的路徑名稱,以及 ``'all'``,順序如上所述。" #: ../../library/tkinter.rst:1373 msgid "" @@ -2605,12 +2719,14 @@ msgid "" "binding tags are set to its elements, which determines the order in which " "bindings are evaluated." msgstr "" +"如果給出了 *tagList*,它必須是一個字串序列;元件的繫結標籤會被設定為其元素," +"這決定了繫結被評估的順序。" #: ../../library/tkinter.rst:1377 msgid "" "The methods with the ``event_`` prefix define virtual events and generate " "events programmatically." -msgstr "" +msgstr "帶有 ``event_`` 前綴的方法用於定義虛擬事件,以及以程式化方式產生事件。" #: ../../library/tkinter.rst:1382 msgid "" @@ -2620,6 +2736,9 @@ msgid "" "If *virtual* is already defined, the new sequences are added to its existing " "ones." msgstr "" +"將名稱形式為 ``'<>'`` 的虛擬事件 *virtual*,與由 *sequences* 給出的每" +"個實體事件模式建立關聯,使虛擬事件在其中任何一個發生時都會觸發。如果 " +"*virtual* 已經被定義,則新的事件序列會被新增到其現有的序列中。" #: ../../library/tkinter.rst:1391 msgid "" @@ -2628,6 +2747,9 @@ msgid "" "ignored. If no *sequences* are given, all physical event sequences are " "removed, so that *virtual* no longer triggers." msgstr "" +"從與虛擬事件 *virtual* 關聯的事件序列中移除 *sequences* 中的每一個。目前未與 " +"*virtual* 關聯的序列會被忽略。如果沒有給出 *sequences*,則會移除所有實體事件" +"序列,使 *virtual* 不再觸發。" #: ../../library/tkinter.rst:1399 msgid "" @@ -2639,6 +2761,11 @@ msgid "" "control when the event is processed; refer to the Tk ``event`` manual page " "for the full list." msgstr "" +"在此元件上產生事件 *sequence*,並安排將其處理得如同它來自視窗系統一般。" +"*sequence* 必須是單一事件模式,例如 ``''`` 或 ``'<>'``,而不" +"是數個模式的串接。關鍵字引數用於指定事件的其他欄位,例如以 *x* 和 *y* 表示指" +"標位置,或以 *when* 控制事件何時被處理;完整清單請參閱 Tk 的 ``event`` 手冊頁" +"面。" #: ../../library/tkinter.rst:1409 msgid "" @@ -2647,12 +2774,17 @@ msgid "" "event sequences currently associated with it, or an empty tuple if it is not " "defined." msgstr "" +"如果省略 *virtual*,則回傳目前已定義的所有虛擬事件的 tuple。如果給出了 " +"*virtual*,則回傳目前與其關聯的實體事件序列 tuple,如果尚未定義,則回傳空 " +"tuple。" #: ../../library/tkinter.rst:1414 msgid "" "The methods with the ``after`` prefix schedule callbacks to run after a " "delay or when the application is idle." msgstr "" +"帶有 ``after`` 前綴的方法用於排程回呼,使其在延遲一段時間後或應用程式閒置時執" +"行。" #: ../../library/tkinter.rst:1419 msgid "" @@ -2660,20 +2792,25 @@ msgid "" "*args* and *kw* passed to it as positional and keyword arguments. Return an " "identifier that can be passed to :meth:`after_cancel` to cancel the call." msgstr "" +"排程在 *ms* 毫秒後呼叫可呼叫物件 *func*,並將 *args* 和 *kw* 作為位置引數和關" +"鍵字引數傳遞給它。回傳一個識別碼,可將其傳遞給 :meth:`after_cancel` 以取消該" +"次呼叫。" #: ../../library/tkinter.rst:1424 msgid "" "If *func* is omitted, sleep for *ms* milliseconds instead, processing no " "events during that time, and return ``None``." msgstr "" +"如果省略 *func*,則改為休眠 *ms* 毫秒,在此期間不處理任何事件,並回傳 " +"``None``。" #: ../../library/tkinter.rst:1427 msgid "*func* can now be any callable object, not only a function." -msgstr "" +msgstr "*func* 現在可以是任何可呼叫物件,而不僅限於函式。" #: ../../library/tkinter.rst:1430 ../../library/tkinter.rst:1455 msgid "Keyword arguments are now passed to *func*." -msgstr "" +msgstr "關鍵字引數現在會被傳遞給 *func*。" #: ../../library/tkinter.rst:1436 msgid "" @@ -2682,11 +2819,15 @@ msgid "" "passing a value that is not such an identifier raises :exc:`ValueError`. If " "the callback has already run or been cancelled, this has no effect." msgstr "" +"取消先前透過 :meth:`after` 或 :meth:`after_idle` 排程的回呼。*id* 必須是這些" +"方法之一所回傳的識別碼;傳入非此類識別碼的值會引發 :exc:`ValueError`。如果該" +"回呼已經執行過或已被取消,此方法不會有任何作用。" #: ../../library/tkinter.rst:1442 msgid "" "Passing ``None`` (or any false value) as *id* now raises :exc:`ValueError`." msgstr "" +"現在,將 ``None``\\ (或任何假值)作為 *id* 傳入會引發 :exc:`ValueError`。" #: ../../library/tkinter.rst:1449 msgid "" @@ -2695,6 +2836,9 @@ msgid "" "events to process. Return an identifier that can be passed to :meth:" "`after_cancel` to cancel the call." msgstr "" +"排程在 Tk 主迴圈下一次變為閒置時(即它沒有其他事件需要處理時),呼叫可呼叫物" +"件 *func*,並將 *args* 和 *kw* 傳遞給它。回傳一個識別碼,可將其傳遞給 :meth:" +"`after_cancel` 以取消該次呼叫。" #: ../../library/tkinter.rst:1461 msgid "" @@ -2702,6 +2846,8 @@ msgid "" "currently scheduled with :meth:`after` and :meth:`after_idle` for this " "interpreter." msgstr "" +"如果省略 *id*,則回傳目前透過 :meth:`after` 和 :meth:`after_idle` 為此直譯器" +"排程的所有回呼識別碼組成的 tuple。" #: ../../library/tkinter.rst:1465 msgid "" @@ -2710,6 +2856,9 @@ msgid "" "*script* refers to the function to be called and *type* is either ``'idle'`` " "or ``'timer'``. A :exc:`TclError` is raised if *id* does not exist." msgstr "" +"如果給出了 *id*,它必須識別一個尚未執行或尚未被取消的回呼,回傳值是一個 " +"tuple ``(script, type)``,其中 *script* 指向要被呼叫的函式,*type* 則是 " +"``'idle'`` 或 ``'timer'`` 之一。如果 *id* 不存在,則會引發 :exc:`TclError`。" #: ../../library/tkinter.rst:1476 msgid "" @@ -2717,10 +2866,12 @@ msgid "" "destroyed. This is normally called once, on the root window, to run the " "application." msgstr "" +"進入 Tk 事件迴圈,處理事件直到所有視窗都被銷毀為止。通常會在根視窗上呼叫一次" +"此方法,以執行應用程式。" #: ../../library/tkinter.rst:1482 msgid "Quit the Tcl interpreter, causing :meth:`mainloop` to return." -msgstr "" +msgstr "結束 Tcl 直譯器,使 :meth:`mainloop` 回傳。" #: ../../library/tkinter.rst:1486 msgid "" @@ -2728,6 +2879,8 @@ msgid "" "have been processed. This brings the display up to date and handles any " "events that are already queued, then returns." msgstr "" +"進入事件迴圈,直到所有待處理的事件(包括閒置回呼)都已處理完畢。此方法會更新" +"顯示畫面並處理任何已經排入佇列的事件,然後回傳。" #: ../../library/tkinter.rst:1493 msgid "" @@ -2735,6 +2888,8 @@ msgid "" "updates the display of windows, for example after geometry changes, but does " "not process events caused by the user." msgstr "" +"進入事件迴圈,直到所有待處理的閒置回呼都已被呼叫。此方法會更新視窗的顯示,例" +"如在佈局變更之後,但不會處理由使用者引起的事件。" #: ../../library/tkinter.rst:1502 msgid "" @@ -2743,10 +2898,13 @@ msgid "" "a :class:`Variable` instance, such as an :class:`IntVar` or :class:" "`StringVar`." msgstr "" +"等待直到 Tcl 變數 *name* 被修改,期間會持續處理事件,使應用程式保持回應。" +"*name* 通常是一個 :class:`Variable` 實例,例如 :class:`IntVar` 或 :class:" +"`StringVar`。" #: ../../library/tkinter.rst:1507 msgid ":meth:`waitvar` is an alias of :meth:`!wait_variable`." -msgstr "" +msgstr ":meth:`waitvar` 是 :meth:`!wait_variable` 的別名。" #: ../../library/tkinter.rst:1511 msgid "" @@ -2754,6 +2912,8 @@ msgid "" "meantime. If *window* is omitted, this widget is used. This is typically " "used to wait for the user to finish interacting with a dialog box." msgstr "" +"等待直到 *window* 被銷毀,期間會持續處理事件。如果省略 *window*,則使用此元" +"件。這通常用於等待使用者完成與對話方塊的互動。" #: ../../library/tkinter.rst:1519 msgid "" @@ -2762,10 +2922,13 @@ msgid "" "If *window* is omitted, this widget is used. This is typically used to wait " "for a newly created window to become visible before acting on it." msgstr "" +"等待直到 *window* 的可見性狀態發生變化,例如它首次出現在螢幕上時,期間會持續" +"處理事件。如果省略 *window*,則使用此元件。這通常用於在對新建立的視窗進行操作" +"之前,等待它變為可見。" #: ../../library/tkinter.rst:1526 msgid "The methods with the ``focus_`` prefix manage the keyboard focus." -msgstr "" +msgstr "帶有 ``focus_`` 前綴的方法用於管理鍵盤焦點。" #: ../../library/tkinter.rst:1533 msgid "" @@ -2777,6 +2940,11 @@ msgid "" "except on the :class:`Canvas` and :class:`ttk.Treeview ` widgets, which provide their own :meth:`!focus` method." msgstr "" +"將此元件所在顯示器的鍵盤輸入焦點導向此元件。如果應用程式目前在此元件所在的顯" +"示器上沒有輸入焦點,則此元件會被記住為其頂層視窗的焦點視窗,並在視窗管理器下" +"次將焦點給予該頂層視窗時,把焦點重新導向到它。:meth:`focus` 是 :meth:`!" +"focus_set` 的別名,但 :class:`Canvas` 和 :class:`ttk.Treeview ` 元件除外,它們提供了自己的 :meth:`!focus` 方法。" #: ../../library/tkinter.rst:1545 msgid "" @@ -2785,6 +2953,9 @@ msgid "" "should be used sparingly, if at all; normally an application should wait for " "the window manager to give it the focus rather than claiming it." msgstr "" +"即使應用程式目前在此元件所在的顯示器上沒有輸入焦點,也將鍵盤輸入焦點導向此元" +"件。應謹慎使用此方法,甚至盡量避免使用;通常應用程式應該等待視窗管理器賦予其" +"焦點,而不是主動取得焦點。" #: ../../library/tkinter.rst:1553 msgid "" @@ -2792,6 +2963,8 @@ msgid "" "or ``None`` if no widget in the application has the focus. Use :meth:" "`focus_displayof` to work correctly with several displays." msgstr "" +"回傳目前在應用程式中擁有鍵盤焦點的元件,如果應用程式中沒有任何元件擁有焦點," +"則回傳 ``None``。若要在多個顯示器下正確運作,請使用 :meth:`focus_displayof`。" #: ../../library/tkinter.rst:1559 msgid "" @@ -2799,6 +2972,8 @@ msgid "" "this widget is located, or ``None`` if no widget in the application has the " "focus on that display." msgstr "" +"回傳目前在此元件所在顯示器上擁有鍵盤焦點的元件,如果應用程式中沒有任何元件在" +"該顯示器上擁有焦點,則回傳 ``None``。" #: ../../library/tkinter.rst:1565 msgid "" @@ -2808,6 +2983,9 @@ msgid "" "top level. If no widget in that top level has ever had the focus, or if the " "most recent focus widget has been deleted, the top level itself is returned." msgstr "" +"回傳與此元件位於同一頂層視窗的所有元件中,最近曾擁有鍵盤焦點的元件;這是視窗" +"管理器下次將焦點給予該頂層視窗時,將會接收焦點的元件。如果該頂層視窗中沒有任" +"何元件曾經擁有焦點,或者最近擁有焦點的元件已被刪除,則會回傳該頂層視窗本身。" #: ../../library/tkinter.rst:1574 msgid "" @@ -2815,6 +2993,8 @@ msgid "" "widget whenever the mouse pointer enters it. This cannot easily be disabled " "once enabled." msgstr "" +"重新設定 Tk 以使用隱含的焦點模型,即每當滑鼠指標進入某個元件時,焦點就會被設" +"定到該元件。一旦啟用,就無法輕易停用。" #: ../../library/tkinter.rst:1580 msgid "" @@ -2825,6 +3005,10 @@ msgid "" "option is set to ``0``. This method is used in the default bindings for the :" "kbd:`Tab` key." msgstr "" +"回傳鍵盤遍歷順序中,此元件之後的下一個元件,如果沒有則回傳 ``None``。遍歷順序" +"首先前往下一個子元件,然後遞迴前往該子元件的子元件,接著前往堆疊順序中較高的" +"下一個同層元件。如果一個元件的 ``takefocus`` 選項設為 ``0``,則會跳過該元件。" +"此方法用於 :kbd:`Tab` 鍵的預設繫結中。" #: ../../library/tkinter.rst:1590 msgid "" @@ -2833,12 +3017,17 @@ msgid "" "defined. This method is used in the default bindings for the :kbd:`Shift-" "Tab` key." msgstr "" +"回傳鍵盤遍歷順序中,此元件之前的上一個元件,如果沒有則回傳 ``None``。關於順序" +"如何定義,請參閱 :meth:`tk_focusNext`。此方法用於 :kbd:`Shift-Tab` 鍵的預設繫" +"結中。" #: ../../library/tkinter.rst:1595 msgid "" "The methods with the ``grab_`` prefix set and query the input grab, which " "directs all input events to a single widget." msgstr "" +"帶有 ``grab_`` 前綴的方法用於設定和查詢輸入捕獲(grab),它會將所有輸入事件導" +"向單一元件。" #: ../../library/tkinter.rst:1600 msgid "" @@ -2852,6 +3041,12 @@ msgid "" "modal: while the grab is in effect the user cannot interact with the other " "windows of the application." msgstr "" +"在此元件上設定一個區域捕獲(local grab)。捕獲會將指標事件限制在此元件及其子" +"孫元件之內:當指標位於此元件子樹之外時,按鍵按下和放開以及指標移動都會回報給" +"捕獲該元件,而子樹之外的視窗會變得無法感應輸入,直到捕獲被釋放為止。區域捕獲" +"只會影響進行捕獲的應用程式本身。此應用程式先前在此元件所在顯示器上設定的任何" +"捕獲都會被自動釋放。設定捕獲是讓對話方塊變為強制回應(modal)的常見方式:在捕" +"獲有效期間,使用者無法與應用程式的其他視窗互動。" #: ../../library/tkinter.rst:1614 msgid "" @@ -2862,28 +3057,36 @@ msgid "" "unusable with a global grab, since other applications stop receiving events " "until it is released." msgstr "" +"在此元件上設定一個全域捕獲(global grab)。全域捕獲類似於 :meth:`grab_set` 所" +"設定的區域捕獲,但它會鎖定螢幕上所有其他應用程式,使得只有此元件的子樹能感應" +"指標事件,同時它也會捕獲鍵盤。請謹慎使用:全域捕獲很容易讓顯示器變得無法使" +"用,因為其他應用程式在捕獲被釋放之前都會停止接收事件。" #: ../../library/tkinter.rst:1625 msgid "Release the grab on this widget if there is one; otherwise do nothing." -msgstr "" +msgstr "如果此元件上有捕獲,則將其釋放;否則不做任何事。" #: ../../library/tkinter.rst:1629 msgid "" "Return the widget that currently holds the grab in this application for this " "widget's display, or ``None`` if there is no such widget." msgstr "" +"回傳目前在此應用程式中,為此元件所在顯示器持有捕獲的元件,如果沒有這樣的元" +"件,則回傳 ``None``。" #: ../../library/tkinter.rst:1634 msgid "" "Return ``None`` if no grab is currently set on this widget, ``\"local\"`` if " "a local grab is set, or ``\"global\"`` if a global grab is set." msgstr "" +"如果此元件目前沒有設定捕獲,則回傳 ``None``;如果設定了區域捕獲,則回傳 " +"``\"local\"``;如果設定了全域捕獲,則回傳 ``\"global\"``。" #: ../../library/tkinter.rst:1637 msgid "" "The methods with the ``selection_`` prefix retrieve and manage the X " "selection." -msgstr "" +msgstr "帶有 ``selection_`` 前綴的方法用於取得和管理 X 選取範圍(selection)。" #: ../../library/tkinter.rst:1642 msgid "" @@ -2893,6 +3096,10 @@ msgid "" "*displayof* keyword argument names a widget that determines the display on " "which to operate, and defaults to this widget." msgstr "" +"清除 X 選取範圍,使其不再被任何視窗擁有。要清除的選取範圍由關鍵字引數 " +"*selection* 給定,這是一個 atom 名稱,例如 ``'PRIMARY'`` 或 ``'CLIPBOARD'``;" +"預設為 ``PRIMARY``。關鍵字引數 *displayof* 用於指名一個元件,決定要在哪個顯示" +"器上操作,預設為此元件。" #: ../../library/tkinter.rst:1649 msgid "" @@ -2900,6 +3107,8 @@ msgid "" "`Spinbox` widgets, where :meth:`!selection_clear` clears the widget's own " "selection instead." msgstr "" +"此方法在 :class:`Entry`、:class:`Listbox` 和 :class:`Spinbox` 元件中被覆寫," +"其 :meth:`!selection_clear` 改為清除元件自身的選取範圍。" #: ../../library/tkinter.rst:1655 msgid "" @@ -2912,6 +3121,11 @@ msgid "" "*displayof* keyword argument names a widget that determines the display from " "which to retrieve the selection, and defaults to this widget." msgstr "" +"回傳目前 X 選取範圍的內容。關鍵字引數 *selection* 用於指名選取範圍,預設為 " +"``PRIMARY``。關鍵字引數 *type* 指定資料要以何種形式回傳(期望的轉換目標),這" +"是一個 atom 名稱,例如 ``'STRING'`` 或 ``'FILE_NAME'``;預設為 ``STRING``,但" +"在 X11 上會先嘗試 ``UTF8_STRING``,並以 ``STRING`` 作為備援。關鍵字引數 " +"*displayof* 用於指名一個元件,決定要從哪個顯示器取得選取範圍,預設為此元件。" #: ../../library/tkinter.rst:1669 msgid "" @@ -2925,6 +3139,12 @@ msgid "" "keyword argument *type* gives the form of the selection that the handler " "supplies (such as ``'STRING'`` or ``'FILE_NAME'``, default ``STRING``)." msgstr "" +"將 *command* 註冊為處理常式,用於在其他應用程式請求時,提供由此元件擁有的 X " +"選取範圍。當選取範圍被取得時,會以兩個引數呼叫 *command*:起始字元偏移量和要" +"回傳的最大字元數,且它最多必須回傳從該偏移量開始的那麼多個選取範圍字元;對於" +"非常長的選取範圍,會以遞增的偏移量重複呼叫它。關鍵字引數 *selection* 用於指名" +"選取範圍(預設為 ``PRIMARY``),關鍵字引數 *type* 則給出處理常式所提供選取範" +"圍的形式(例如 ``'STRING'`` 或 ``'FILE_NAME'``,預設為 ``STRING``)。" #: ../../library/tkinter.rst:1683 msgid "" @@ -2932,6 +3152,9 @@ msgid "" "owner, if any, is notified that it has lost the selection. The keyword " "argument *selection* names the selection and defaults to ``PRIMARY``." msgstr "" +"使此元件成為其所在顯示器上 X 選取範圍的擁有者。先前的擁有者(如果有的話)會被" +"通知它已經失去了該選取範圍。關鍵字引數 *selection* 用於指名選取範圍,預設為 " +"``PRIMARY``。" #: ../../library/tkinter.rst:1690 msgid "" @@ -2941,10 +3164,14 @@ msgid "" "defaults to ``PRIMARY``. The *displayof* keyword argument names a widget " "that determines the display to query, and defaults to this widget." msgstr "" +"回傳此應用程式中,在包含此元件的顯示器上擁有 X 選取範圍的元件,如果此應用程式" +"中沒有任何元件擁有該選取範圍,則回傳 ``None``。關鍵字引數 *selection* 用於指" +"名選取範圍,預設為 ``PRIMARY``。關鍵字引數 *displayof* 用於指名一個元件,決定" +"要查詢哪個顯示器,預設為此元件。" #: ../../library/tkinter.rst:1698 msgid "The methods with the ``clipboard_`` prefix manage the clipboard." -msgstr "" +msgstr "帶有 ``clipboard_`` 前綴的方法用於管理剪貼簿。" #: ../../library/tkinter.rst:1702 msgid "" @@ -2959,6 +3186,13 @@ msgid "" "the target display, and defaults to this widget. The contents can be " "retrieved with :meth:`clipboard_get` or :meth:`selection_get`." msgstr "" +"將 *string* 附加到 Tk 剪貼簿,並在此元件所在的顯示器上取得剪貼簿的擁有權。在" +"附加之前,應先使用 :meth:`clipboard_clear` 清空剪貼簿;所有附加操作都應該在返" +"回事件迴圈之前完成,以確保剪貼簿以原子方式更新。關鍵字引數 *type* 指定資料的" +"形式,這是一個 atom 名稱,例如 ``'STRING'`` 或 ``'FILE_NAME'``\\ (預設為 " +"``STRING``),關鍵字引數 *format* 則指定用於傳輸它的表示法(預設為 " +"``STRING``)。關鍵字引數 *displayof* 用於指名一個元件,決定目標顯示器,預設為" +"此元件。內容可以使用 :meth:`clipboard_get` 或 :meth:`selection_get` 取得。" #: ../../library/tkinter.rst:1718 msgid "" @@ -2966,6 +3200,8 @@ msgid "" "previous contents. The *displayof* keyword argument names a widget that " "determines the target display, and defaults to this widget." msgstr "" +"在此元件所在的顯示器上取得剪貼簿的擁有權,並移除任何先前的內容。關鍵字引數 " +"*displayof* 用於指名一個元件,決定目標顯示器,預設為此元件。" #: ../../library/tkinter.rst:1725 msgid "" @@ -2977,12 +3213,17 @@ msgid "" "widget that determines the display, and defaults to the root window of the " "application. This is equivalent to ``selection_get(selection='CLIPBOARD')``." msgstr "" +"從此元件所在的顯示器上取得剪貼簿的資料。關鍵字引數 *type* 指定資料要以何種形" +"式回傳,這是一個 atom 名稱,例如 ``'STRING'`` 或 ``'FILE_NAME'``;預設為 " +"``STRING``,但在 X11 上會先嘗試 ``UTF8_STRING``,並以 ``STRING`` 作為備援。關" +"鍵字引數 *displayof* 用於指名一個元件,決定顯示器,預設為應用程式的根視窗。這" +"相當於 ``selection_get(selection='CLIPBOARD')``。" #: ../../library/tkinter.rst:1734 msgid "" "The methods with the ``option_`` prefix query and modify the Tk option " "database." -msgstr "" +msgstr "帶有 ``option_`` 前綴的方法用於查詢和修改 Tk 選項資料庫。" #: ../../library/tkinter.rst:1739 msgid "" @@ -2993,6 +3234,11 @@ msgid "" "(40), ``'userDefault'`` (60), or ``'interactive'`` (80); it defaults to " "``interactive``." msgstr "" +"在 Tk 選項資料庫中新增一個選項,將 *value* 與 *pattern* 建立關聯。*pattern* " +"由以星號或點號分隔的名稱和/或類別組成,採用一般的 X 格式。*priority* 是介於 " +"0 到 100 之間的整數,或是符號名稱 ``'widgetDefault'``\\ (20)、" +"``'startupFile'``\\ (40)、``'userDefault'``\\ (60)或 ``'interactive'``\\ " +"(80)之一;預設為 ``interactive``。" #: ../../library/tkinter.rst:1749 msgid "" @@ -3001,6 +3247,8 @@ msgid "" "automatically the next time an option is added to or removed from the " "database." msgstr "" +"清除 Tk 選項資料庫。下次向資料庫新增或移除選項時,來自 :envvar:`!" +"RESOURCE_MANAGER` 屬性或 :file:`.Xdefaults` 檔案的預設選項會被自動重新載入。" #: ../../library/tkinter.rst:1756 msgid "" @@ -3010,6 +3258,9 @@ msgid "" "priority is returned, and among entries of equal priority the most recently " "added one." msgstr "" +"從 Tk 選項資料庫中,回傳在 *name* 和 *className* 下與此元件相符的選項值,如果" +"沒有相符的項目,則回傳空字串。當有多個項目相符時,會回傳優先權最高的那一個;" +"在優先權相同的項目中,則回傳最近新增的那一個。" #: ../../library/tkinter.rst:1765 msgid "" @@ -3018,6 +3269,9 @@ msgid "" "specifies to the Tk option database. *priority* is interpreted as for :meth:" "`option_add` and defaults to ``interactive``." msgstr "" +"讀取名為 *fileName* 的檔案,該檔案應具有 X 資源資料庫的標準格式,例如 :file:" +"`.Xdefaults`,並將其指定的所有選項新增到 Tk 選項資料庫中。*priority* 的解釋方" +"式與 :meth:`option_add` 相同,預設為 ``interactive``。" #: ../../library/tkinter.rst:1773 msgid "" @@ -3026,6 +3280,9 @@ msgid "" "*displayof* is given as a widget, the bell is rung on that widget's display " "instead." msgstr "" +"在此元件所在的顯示器上響鈴,使用該顯示器目前與鈴聲相關的設定,並重設該螢幕的" +"螢幕保護程式。如果將 *displayof* 指定為一個元件,則改為在該元件所在的顯示器上" +"響鈴。" #: ../../library/tkinter.rst:1781 msgid "" @@ -3041,12 +3298,23 @@ msgid "" "``selectForeground``, and ``troughColor``; reasonable defaults are computed " "for any that are not specified." msgstr "" +"為所有 Tk 元件元素設定一個新的配色方案。現有的元件會被更新,且選項資料庫也會" +"被變更,使未來的元件使用新的顏色。單一顏色引數會被視為一般背景顏色,並依此計" +"算出一整套調色盤。或者,也可以將引數以關鍵字 *name*/*value* 對的形式給出,指" +"名選項資料庫中的個別選項。可辨識的選項名稱有 ``activeBackground``、" +"``activeForeground``、``background``、``disabledForeground``、" +"``foreground``、``highlightBackground``、``highlightColor``、" +"``insertBackground``、``selectColor``、``selectBackground``、" +"``selectForeground`` 和 ``troughColor``;對於未指定的選項,會計算出合理的預設" +"值。" #: ../../library/tkinter.rst:1797 msgid "" "Restore the application's colors to the light brown (bisque) color scheme " "used in Tk 3.6 and earlier versions. Provided for backward compatibility." msgstr "" +"將應用程式的顏色還原為 Tk 3.6 及更早版本中所使用的淺棕色(bisque)配色方案。" +"此方法為了向後相容而提供。" #: ../../library/tkinter.rst:1803 msgid "" @@ -3054,12 +3322,16 @@ msgid "" "true *boolean* value enables strict Motif compliance (for example, no color " "change when the mouse passes over a slider). Return the resulting setting." msgstr "" +"查詢或設定 Tk 的外觀和風格是否應嚴格遵循 Motif。真值的 *boolean* 會啟用嚴格" +"的 Motif 相容模式(例如,當滑鼠經過滑桿時不會變更顏色)。回傳結果設定。" #: ../../library/tkinter.rst:1808 msgid "" "The methods with the ``busy_`` prefix manage the busy state of a window, " "which shows a busy cursor and ignores user input." msgstr "" +"帶有 ``busy_`` 前綴的方法用於管理視窗的忙碌狀態,這會顯示忙碌游標並忽略使用者" +"輸入。" #: ../../library/tkinter.rst:1822 msgid "" @@ -3069,6 +3341,9 @@ msgid "" "`update` should be called immediately afterwards to ensure that the hold " "operation is in effect before the application starts its processing." msgstr "" +"使此元件顯示為忙碌狀態。一個透明視窗會被放置在此元件的前面,使其及其在元件階" +"層中的所有子孫元件都無法接收指標事件,並顯示忙碌游標。通常應在此之後立即呼" +"叫 :meth:`update`,以確保在應用程式開始處理之前,持有(hold)操作已經生效。" #: ../../library/tkinter.rst:1830 msgid "" @@ -3076,12 +3351,16 @@ msgid "" "displayed while the widget is busy; it may have any of the values accepted " "by :meth:`!configure`." msgstr "" +"唯一支援的設定選項是 *cursor*,即元件忙碌時要顯示的游標;它可以是 :meth:`!" +"configure` 所接受的任何值。" #: ../../library/tkinter.rst:1834 msgid "" ":meth:`busy_hold`, :meth:`busy` and :meth:`tk_busy` are aliases of :meth:`!" "tk_busy_hold`." msgstr "" +":meth:`busy_hold`、:meth:`busy` 和 :meth:`tk_busy` 是 :meth:`!tk_busy_hold` " +"的別名。" #: ../../library/tkinter.rst:1851 msgid "" @@ -3092,6 +3371,10 @@ msgid "" "Otherwise set the given options to the given values. Options may have any of " "the values accepted by :meth:`tk_busy_hold`." msgstr "" +"查詢或修改忙碌視窗的設定選項。該元件必須先前已透過 :meth:`tk_busy_hold` 被設" +"為忙碌狀態。若不帶引數,則回傳描述所有可用選項的字典;如果 *cnf* 是一個選項的" +"名稱,則回傳描述該選項的 tuple。否則,將給定的選項設定為給定的值。選項的值可" +"以是 :meth:`tk_busy_hold` 所接受的任何值。" #: ../../library/tkinter.rst:1859 msgid "" @@ -3099,18 +3382,24 @@ msgid "" "example, if a :class:`Frame` widget named ``frame`` is to be made busy, the " "busy cursor can be specified for it by either of the calls::" msgstr "" +"選項資料庫是透過元件名稱或類別來參照的。例如,如果要將名為 ``frame`` 的 :" +"class:`Frame` 元件設為忙碌狀態,可以透過以下任一呼叫來為其指定忙碌游標: ::" #: ../../library/tkinter.rst:1863 msgid "" "w.option_add('*frame.busyCursor', 'gumby')\n" "w.option_add('*Frame.BusyCursor', 'gumby')" msgstr "" +"w.option_add('*frame.busyCursor', 'gumby')\n" +"w.option_add('*Frame.BusyCursor', 'gumby')" #: ../../library/tkinter.rst:1866 msgid "" ":meth:`busy_configure`, :meth:`busy_config` and :meth:`tk_busy_config` are " "aliases of :meth:`!tk_busy_configure`." msgstr "" +":meth:`busy_configure`、:meth:`busy_config` 和 :meth:`tk_busy_config` 是 :" +"meth:`!tk_busy_configure` 的別名。" #: ../../library/tkinter.rst:1877 msgid "" @@ -3118,10 +3407,12 @@ msgid "" "have been previously made busy by :meth:`tk_busy_hold`, and *option* may " "have any of the values accepted by that method." msgstr "" +"回傳忙碌設定選項 *option* 目前的值。該元件必須先前已透過 :meth:" +"`tk_busy_hold` 被設為忙碌狀態,*option* 可以是該方法所接受的任何值。" #: ../../library/tkinter.rst:1881 msgid ":meth:`busy_cget` is an alias of :meth:`!tk_busy_cget`." -msgstr "" +msgstr ":meth:`busy_cget` 是 :meth:`!tk_busy_cget` 的別名。" #: ../../library/tkinter.rst:1891 msgid "" @@ -3130,34 +3421,38 @@ msgid "" "be received by the widget. These resources are also released when the widget " "is destroyed." msgstr "" +"使此元件不再處於忙碌狀態,釋放在其被設為忙碌狀態時所配置的資源(包括透明視" +"窗)。元件將再次接收使用者事件。當元件被銷毀時,這些資源也會被釋放。" #: ../../library/tkinter.rst:1896 msgid ":meth:`busy_forget` is an alias of :meth:`!tk_busy_forget`." -msgstr "" +msgstr ":meth:`busy_forget` 是 :meth:`!tk_busy_forget` 的別名。" #: ../../library/tkinter.rst:1906 msgid "Return ``True`` if the widget is currently busy, ``False`` otherwise." -msgstr "" +msgstr "如果元件目前為忙碌狀態則回傳 ``True``,否則回傳 ``False``。" #: ../../library/tkinter.rst:1908 msgid ":meth:`busy_status` is an alias of :meth:`!tk_busy_status`." -msgstr "" +msgstr ":meth:`busy_status` 是 :meth:`!tk_busy_status` 的別名。" #: ../../library/tkinter.rst:1918 msgid "" "Return a list of widgets that are currently busy. If *pattern* is given, " "only busy widgets whose path names match the pattern are returned." msgstr "" +"回傳目前為忙碌狀態的元件列表。如果有給定 *pattern*,則只會回傳路徑名稱與該模" +"式相符的忙碌元件。" #: ../../library/tkinter.rst:1922 msgid ":meth:`busy_current` is an alias of :meth:`!tk_busy_current`." -msgstr "" +msgstr ":meth:`busy_current` 是 :meth:`!tk_busy_current` 的別名。" #: ../../library/tkinter.rst:1926 msgid "" "The methods with the ``winfo_`` prefix retrieve information about windows " "managed by Tk." -msgstr "" +msgstr "帶有 ``winfo_`` 前綴的方法會取得由 Tk 管理的視窗的相關資訊。" #: ../../library/tkinter.rst:1931 msgid "" @@ -3166,6 +3461,9 @@ msgid "" "the display of that window; otherwise it is looked up on the display of the " "application's main window." msgstr "" +"回傳名稱為 *name* 的 atom 的整數識別碼,如果該 atom 不存在則會建立一個新的。" +"如果有給定 *displayof*,則會在該視窗所在的顯示器上查找該 atom;否則會在應用程" +"式主視窗所在的顯示器上查找。" #: ../../library/tkinter.rst:1939 msgid "" @@ -3174,10 +3472,13 @@ msgid "" "identifier is looked up on the display of that window; otherwise it is " "looked up on the display of the application's main window." msgstr "" +"回傳整數識別碼為 *id* 的 atom 的文字名稱。這與 :meth:`winfo_atom` 互為反向操" +"作。如果有給定 *displayof*,則會在該視窗所在的顯示器上查找該識別碼;否則會在" +"應用程式主視窗所在的顯示器上查找。" #: ../../library/tkinter.rst:1947 msgid "Return the number of cells in the colormap for the widget." -msgstr "" +msgstr "回傳元件的色彩對映表中的單元數量。" #: ../../library/tkinter.rst:1951 msgid "" @@ -3185,16 +3486,18 @@ msgid "" "stacking order from lowest to highest. Toplevel windows are returned as " "children of their logical parents." msgstr "" +"回傳一個列表,內容是元件的子元件,依由下到上的堆疊順序排列。頂層視窗會作為其" +"邏輯父元件的子元件被回傳。" #: ../../library/tkinter.rst:1957 msgid "Return the class name of the widget." -msgstr "" +msgstr "回傳元件的類別名稱。" #: ../../library/tkinter.rst:1961 msgid "" "Return ``True`` if the colormap for the widget is known to be full, " "``False`` otherwise." -msgstr "" +msgstr "如果元件的色彩對映表已知已滿則回傳 ``True``,否則回傳 ``False``。" #: ../../library/tkinter.rst:1966 msgid "" @@ -3204,14 +3507,17 @@ msgid "" "If *displayof* is given, the coordinates refer to the screen containing that " "window; otherwise they refer to the screen of the application's main window." msgstr "" +"回傳包含由 *rootX* 和 *rootY* 給定之點的元件,如果本應用程式中沒有視窗包含該" +"點則回傳 ``None``。座標是以根視窗座標系統中的螢幕單位表示。如果有給定 " +"*displayof*,座標會參照該視窗所在的螢幕;否則會參照應用程式主視窗所在的螢幕。" #: ../../library/tkinter.rst:1976 msgid "Return the depth of the widget, that is, the number of bits per pixel." -msgstr "" +msgstr "回傳元件的深度,也就是每個像素的位元數。" #: ../../library/tkinter.rst:1980 msgid "Return ``1`` if the widget exists, ``0`` otherwise." -msgstr "" +msgstr "如果元件存在則回傳 ``1``,否則回傳 ``0``。" #: ../../library/tkinter.rst:1984 msgid "" @@ -3220,12 +3526,16 @@ msgid "" "``\"1i\"``). The result may be fractional; for a rounded integer value use :" "meth:`winfo_pixels`." msgstr "" +"回傳一個浮點數值,表示元件中對應於螢幕距離 *number*\\ (例如 ``\"2.0c\"`` 或 " +"``\"1i\"``)的像素數。結果可能是小數;若要取得四捨五入後的整數值,請使用 :" +"meth:`winfo_pixels`。" #: ../../library/tkinter.rst:1992 msgid "" "Return the geometry of the widget, in the form ``widthxheight+x+y``. All " "dimensions are in pixels." msgstr "" +"回傳元件的 geometry,格式為 ``widthxheight+x+y``。所有維度單位皆為像素。" #: ../../library/tkinter.rst:1997 msgid "" @@ -3233,12 +3543,16 @@ msgid "" "its height is 1 pixel; it is eventually changed by a geometry manager. See " "also :meth:`winfo_reqheight`." msgstr "" +"回傳元件的高度(以像素為單位)。視窗剛建立時高度為 1 像素,之後會由佈局管理器" +"變更。另請參閱 :meth:`winfo_reqheight`。" #: ../../library/tkinter.rst:2004 msgid "" "Return a low-level platform-specific identifier for the widget. On Unix this " "is the X window identifier, and on Windows it is the window handle." msgstr "" +"回傳元件的低階、平台特定的識別碼。在 Unix 上這是 X 視窗識別碼,在 Windows 上" +"則是視窗控制代碼。" #: ../../library/tkinter.rst:2010 msgid "" @@ -3247,27 +3561,32 @@ msgid "" "the display of that window; otherwise it refers to the display of the " "application's main window." msgstr "" +"回傳一個元組,內容為目前為特定顯示器註冊的所有 Tcl 直譯器的名稱。如果有給定 " +"*displayof*,回傳值會參照該視窗所在的顯示器;否則會參照應用程式主視窗所在的顯" +"示器。" #: ../../library/tkinter.rst:2018 msgid "Return ``1`` if the widget is currently mapped, ``0`` otherwise." -msgstr "" +msgstr "如果元件目前已被映射(mapped)則回傳 ``1``,否則回傳 ``0``。" #: ../../library/tkinter.rst:2022 msgid "" "Return the name of the geometry manager currently responsible for the " "widget, or an empty string if it is not managed by any geometry manager." msgstr "" +"回傳目前負責該元件的佈局管理器名稱,如果沒有任何佈局管理器管理該元件則回傳空" +"字串。" #: ../../library/tkinter.rst:2027 msgid "" "Return the widget's name within its parent, as opposed to its full path name." -msgstr "" +msgstr "回傳元件在其父元件中的名稱,而非其完整路徑名稱。" #: ../../library/tkinter.rst:2032 msgid "" "Return the path name of the widget's parent, or an empty string if the " "widget is the main window of the application." -msgstr "" +msgstr "回傳元件之父元件的路徑名稱,如果該元件是應用程式的主視窗則回傳空字串。" #: ../../library/tkinter.rst:2037 msgid "" @@ -3275,6 +3594,8 @@ msgid "" "is given, the identifier is looked up on the display of that window; " "otherwise it is looked up on the display of the application's main window." msgstr "" +"回傳識別碼為 *id* 的視窗的路徑名稱。如果有給定 *displayof*,則會在該視窗所在" +"的顯示器上查找該識別碼;否則會在應用程式主視窗所在的顯示器上查找。" #: ../../library/tkinter.rst:2044 msgid "" @@ -3283,6 +3604,9 @@ msgid "" "rounded to the nearest integer; for a fractional result use :meth:" "`winfo_fpixels`." msgstr "" +"回傳元件中對應於螢幕距離 *number*\\ (例如 ``\"2.0c\"`` 或 ``\"1i\"``)的像素" +"數。結果會四捨五入為最接近的整數;若要取得含小數的結果,請使用 :meth:" +"`winfo_fpixels`。" #: ../../library/tkinter.rst:2051 msgid "" @@ -3290,6 +3614,8 @@ msgid "" "root window (or virtual root, if one is in use). Return ``-1`` if the " "pointer is not on the same screen as the widget." msgstr "" +"回傳指標的 *x* 座標(以像素為單位),相對於螢幕的根視窗(若有使用虛擬根視窗則" +"相對於虛擬根視窗)。如果指標不在與元件相同的螢幕上,則回傳 ``-1``。" #: ../../library/tkinter.rst:2057 msgid "" @@ -3298,6 +3624,9 @@ msgid "" "coordinates are ``-1`` if the pointer is not on the same screen as the " "widget." msgstr "" +"回傳指標的座標,為一個 ``(x, y)`` 元組(以像素為單位),相對於螢幕的根視窗" +"(若有使用虛擬根視窗則相對於虛擬根視窗)。如果指標不在與元件相同的螢幕上,則" +"兩個座標皆為 ``-1``。" #: ../../library/tkinter.rst:2064 msgid "" @@ -3305,18 +3634,24 @@ msgid "" "root window (or virtual root, if one is in use). Return ``-1`` if the " "pointer is not on the same screen as the widget." msgstr "" +"回傳指標的 *y* 座標(以像素為單位),相對於螢幕的根視窗(若有使用虛擬根視窗則" +"相對於虛擬根視窗)。如果指標不在與元件相同的螢幕上,則回傳 ``-1``。" #: ../../library/tkinter.rst:2070 msgid "" "Return the widget's requested height in pixels. This is the value used by " "the widget's geometry manager to compute its geometry." msgstr "" +"回傳元件請求的高度(以像素為單位)。這是元件的佈局管理器用來計算其 geometry " +"的值。" #: ../../library/tkinter.rst:2076 msgid "" "Return the widget's requested width in pixels. This is the value used by the " "widget's geometry manager to compute its geometry." msgstr "" +"回傳元件請求的寬度(以像素為單位)。這是元件的佈局管理器用來計算其 geometry " +"的值。" #: ../../library/tkinter.rst:2082 msgid "" @@ -3324,6 +3659,8 @@ msgid "" "the range 0 to 65535, that correspond to *color* in the widget. *color* may " "be specified in any of the forms acceptable for a color option." msgstr "" +"回傳一個 ``(r, g, b)`` 元組,內容為與元件中 *color* 對應的紅、綠、藍強度值," +"範圍為 0 到 65535。*color* 可以用任何色彩選項可接受的形式指定。" #: ../../library/tkinter.rst:2089 msgid "" @@ -3331,6 +3668,7 @@ msgid "" "left corner of the widget's border (or of the widget itself if it has no " "border)." msgstr "" +"回傳元件邊框左上角(若無邊框則為元件本身左上角)在螢幕根視窗中的 *x* 座標。" #: ../../library/tkinter.rst:2095 msgid "" @@ -3338,35 +3676,36 @@ msgid "" "left corner of the widget's border (or of the widget itself if it has no " "border)." msgstr "" +"回傳元件邊框左上角(若無邊框則為元件本身左上角)在螢幕根視窗中的 *y* 座標。" #: ../../library/tkinter.rst:2101 msgid "" "Return the name of the screen associated with the widget, in the form " "``displayName.screenIndex``." -msgstr "" +msgstr "回傳與元件關聯之螢幕的名稱,格式為 ``displayName.screenIndex``。" #: ../../library/tkinter.rst:2106 msgid "" "Return the number of cells in the default colormap for the widget's screen." -msgstr "" +msgstr "回傳元件所在螢幕之預設色彩對映表中的單元數量。" #: ../../library/tkinter.rst:2111 msgid "" "Return the depth of the root window of the widget's screen, that is, the " "number of bits per pixel." -msgstr "" +msgstr "回傳元件所在螢幕的根視窗深度,也就是每個像素的位元數。" #: ../../library/tkinter.rst:2116 msgid "Return the height of the widget's screen in pixels." -msgstr "" +msgstr "回傳元件所在螢幕的高度(以像素為單位)。" #: ../../library/tkinter.rst:2120 msgid "Return the height of the widget's screen in millimeters." -msgstr "" +msgstr "回傳元件所在螢幕的高度(以毫米為單位)。" #: ../../library/tkinter.rst:2124 msgid "Return the width of the widget's screen in millimeters." -msgstr "" +msgstr "回傳元件所在螢幕的寬度(以毫米為單位)。" #: ../../library/tkinter.rst:2128 msgid "" @@ -3374,28 +3713,37 @@ msgid "" "``\"directcolor\"``, ``\"grayscale\"``, ``\"pseudocolor\"``, " "``\"staticcolor\"``, ``\"staticgray\"``, or ``\"truecolor\"``." msgstr "" +"回傳元件所在螢幕的預設視覺類別,為 ``\"directcolor\"``、``\"grayscale\"``、" +"``\"pseudocolor\"``、``\"staticcolor\"``、``\"staticgray\"`` 或 " +"``\"truecolor\"`` 之一。" #: ../../library/tkinter.rst:2134 msgid "Return the width of the widget's screen in pixels." -msgstr "" +msgstr "回傳元件所在螢幕的寬度(以像素為單位)。" #: ../../library/tkinter.rst:2138 msgid "" "Return a string containing information about the server for the widget's " "display. The exact format of this string may vary from platform to platform." msgstr "" +"回傳一個字串,內容為元件所在顯示器之伺服器的相關資訊。此字串的確切格式可能因" +"平台而異。" #: ../../library/tkinter.rst:2144 msgid "" "Return the top-of-hierarchy window containing the widget. In standard Tk " "this is always a :class:`Toplevel` widget." msgstr "" +"回傳包含該元件的最上層階層視窗。在標準 Tk 中,這永遠是一個 :class:`Toplevel` " +"元件。" #: ../../library/tkinter.rst:2149 msgid "" "Return ``1`` if the widget and all of its ancestors up through the nearest " "toplevel window are mapped, ``0`` otherwise." msgstr "" +"如果元件及其一直到最接近的頂層視窗為止的所有祖先都已被映射,則回傳 ``1``,否" +"則回傳 ``0``。" #: ../../library/tkinter.rst:2154 msgid "" @@ -3403,10 +3751,13 @@ msgid "" "``\"grayscale\"``, ``\"pseudocolor\"``, ``\"staticcolor\"``, " "``\"staticgray\"``, or ``\"truecolor\"``." msgstr "" +"回傳元件的視覺類別,為 ``\"directcolor\"``、``\"grayscale\"``、" +"``\"pseudocolor\"``、``\"staticcolor\"``、``\"staticgray\"`` 或 " +"``\"truecolor\"`` 之一。" #: ../../library/tkinter.rst:2160 msgid "Return the X identifier for the visual for the widget." -msgstr "" +msgstr "回傳元件之視覺的 X 識別碼。" #: ../../library/tkinter.rst:2164 msgid "" @@ -3415,18 +3766,25 @@ msgid "" "integer depth. If *includeids* is true, the X identifier for the visual is " "also included." msgstr "" +"回傳一個列表,描述元件所在螢幕可用的視覺。每個項目由一個視覺類別(見 :meth:" +"`winfo_visual`)加上一個整數深度組成。如果 *includeids* 為 true,則也會包含該" +"視覺的 X 識別碼。" #: ../../library/tkinter.rst:2172 msgid "" "Return the height of the virtual root window associated with the widget if " "there is one; otherwise return the height of the widget's screen." msgstr "" +"如果元件有關聯的虛擬根視窗,則回傳該虛擬根視窗的高度;否則回傳元件所在螢幕的" +"高度。" #: ../../library/tkinter.rst:2177 msgid "" "Return the width of the virtual root window associated with the widget if " "there is one; otherwise return the width of the widget's screen." msgstr "" +"如果元件有關聯的虛擬根視窗,則回傳該虛擬根視窗的寬度;否則回傳元件所在螢幕的" +"寬度。" #: ../../library/tkinter.rst:2182 msgid "" @@ -3434,6 +3792,8 @@ msgid "" "relative to the root window of its screen. This is normally zero or " "negative, and is ``0`` if there is no virtual root window." msgstr "" +"回傳元件關聯之虛擬根視窗相對於其所在螢幕根視窗的 *x* 偏移量。此值通常為零或負" +"數,如果沒有虛擬根視窗則為 ``0``。" #: ../../library/tkinter.rst:2189 msgid "" @@ -3441,6 +3801,8 @@ msgid "" "relative to the root window of its screen. This is normally zero or " "negative, and is ``0`` if there is no virtual root window." msgstr "" +"回傳元件關聯之虛擬根視窗相對於其所在螢幕根視窗的 *y* 偏移量。此值通常為零或負" +"數,如果沒有虛擬根視窗則為 ``0``。" #: ../../library/tkinter.rst:2196 msgid "" @@ -3448,18 +3810,22 @@ msgid "" "width is 1 pixel; it is eventually changed by a geometry manager. See also :" "meth:`winfo_reqwidth`." msgstr "" +"回傳元件的寬度(以像素為單位)。視窗剛建立時寬度為 1 像素,之後會由佈局管理器" +"變更。另請參閱 :meth:`winfo_reqwidth`。" #: ../../library/tkinter.rst:2203 msgid "" "Return the *x* coordinate, in the widget's parent, of the upper-left corner " "of the widget's border (or of the widget itself if it has no border)." msgstr "" +"回傳元件邊框左上角(若無邊框則為元件本身左上角)在其父元件中的 *x* 座標。" #: ../../library/tkinter.rst:2209 msgid "" "Return the *y* coordinate, in the widget's parent, of the upper-left corner " "of the widget's border (or of the widget itself if it has no border)." msgstr "" +"回傳元件邊框左上角(若無邊框則為元件本身左上角)在其父元件中的 *y* 座標。" #: ../../library/tkinter.rst:2215 msgid "" @@ -3469,6 +3835,11 @@ msgid "" "Converting it to a string gives the version in the usual Tcl/Tk notation, " "for example ``'9.0.3'`` for a final release or ``'9.1b2'`` for a pre-release." msgstr "" +"以附名元組回傳 Tcl/Tk 的修補等級,其欄位與 :data:`sys.version_info` 相同的五" +"個欄位:*major*、*minor*、*micro*、*releaselevel* 和 *serial*。" +"*releaselevel* 為 ``'alpha'``、``'beta'`` 或 ``'final'``。將其轉換為字串會得" +"到常見 Tcl/Tk 表示法的版本,例如正式版為 ``'9.0.3'``,預先發布版則為 " +"``'9.1b2'``。" #: ../../library/tkinter.rst:2229 msgid "" @@ -3480,6 +3851,11 @@ msgid "" "equivalent spellings: a short name and a ``wm_``-prefixed name (for " "example, :meth:`title` and :meth:`wm_title`)." msgstr "" +":class:`!Wm` mixin 提供了對視窗管理器的存取,讓應用程式得以控制頂層視窗的標" +"題、geometry 和圖示等項目,以及它被調整大小的方式,還有它如何回應視窗管理器通" +"訊協定。它被混入 :class:`Tk` 和 :class:`Toplevel` 中,因此其方法在每個頂層視" +"窗上皆可使用。每個方法都有兩種相同效果的寫法:一個簡短名稱和一個 ``wm_`` 前綴" +"的名稱(例如 :meth:`title` 和 :meth:`wm_title`)。" #: ../../library/tkinter.rst:2243 msgid "" @@ -3490,6 +3866,10 @@ msgid "" "four current values, or an empty string if no aspect restriction is in " "effect. :meth:`wm_aspect` is an alias of :meth:`!aspect`." msgstr "" +"限制視窗的長寬比(寬度與高度的比例)。如果四個引數都有給定,視窗管理器會將比" +"例保持在 ``minNumer/minDenom`` 和 ``maxNumer/maxDenom`` 之間;傳入空字串會移" +"除任何現有的限制。不傳入引數時,回傳目前四個值組成的元組,如果沒有生效中的長" +"寬比限制則回傳空字串。:meth:`wm_aspect` 是 :meth:`!aspect` 的別名。" #: ../../library/tkinter.rst:2256 msgid "" @@ -3499,30 +3879,38 @@ msgid "" "name such as ``'alpha'`` returns the value of that option, and options are " "set using keyword arguments (``alpha=0.5``)." msgstr "" +"查詢或設定視窗的平台特定屬性。不傳入引數時,回傳平台特定的旗標及其值;將 " +"*return_python_dict* 傳入 true 可以將其取得為 dictionary。傳入單一選項名稱" +"(例如 ``'alpha'``)會回傳該選項的值,而選項則是使用關鍵字引數設定的" +"(``alpha=0.5``)。" #: ../../library/tkinter.rst:2262 msgid "The available attributes differ by platform. All platforms support:" -msgstr "" +msgstr "各平台支援的屬性有所不同。所有平台皆支援:" #: ../../library/tkinter.rst:2265 msgid "*alpha*" -msgstr "" +msgstr "*alpha*" #: ../../library/tkinter.rst:2266 msgid "" "The window's opacity, from ``0.0`` (fully transparent) to ``1.0`` (opaque). " "Where transparency is unsupported the value stays at ``1.0``." msgstr "" +"視窗的不透明度,範圍從 ``0.0``\\ (完全透明)到 ``1.0``\\ (不透明)。在不支" +"援透明度的地方,此值會保持在 ``1.0``。" #: ../../library/tkinter.rst:2270 msgid "*appearance*" -msgstr "" +msgstr "*appearance*" #: ../../library/tkinter.rst:2271 msgid "" "Whether the window is rendered in dark mode on Windows and macOS: " "``'auto'``, ``'light'`` or ``'dark'`` (this has no effect on X11)." msgstr "" +"視窗是否以深色模式在 Windows 和 macOS 上呈現:``'auto'``、``'light'`` 或 " +"``'dark'``\\ (這在 X11 上沒有作用)。" #: ../../library/tkinter.rst:2274 msgid "*fullscreen*" @@ -3530,47 +3918,47 @@ msgstr "*fullscreen*" #: ../../library/tkinter.rst:2275 msgid "Whether the window takes up the entire screen and has no borders." -msgstr "" +msgstr "視窗是否佔滿整個螢幕且沒有邊框。" #: ../../library/tkinter.rst:2277 msgid "*topmost*" -msgstr "" +msgstr "*topmost*" #: ../../library/tkinter.rst:2278 msgid "Whether the window is displayed above all other windows." -msgstr "" +msgstr "視窗是否顯示於所有其他視窗之上。" #: ../../library/tkinter.rst:2280 msgid "Windows additionally supports:" -msgstr "" +msgstr "Windows 額外支援:" #: ../../library/tkinter.rst:2282 msgid "*disabled*" -msgstr "" +msgstr "*disabled*" #: ../../library/tkinter.rst:2283 msgid "Whether the window is in a disabled state." -msgstr "" +msgstr "視窗是否處於停用狀態。" #: ../../library/tkinter.rst:2285 msgid "*toolwindow*" -msgstr "" +msgstr "*toolwindow*" #: ../../library/tkinter.rst:2286 msgid "Whether the window uses the tool window style." -msgstr "" +msgstr "視窗是否使用工具視窗樣式。" #: ../../library/tkinter.rst:2288 msgid "*transparentcolor*" -msgstr "" +msgstr "*transparentcolor*" #: ../../library/tkinter.rst:2289 msgid "The color that is made fully transparent, or an empty string for none." -msgstr "" +msgstr "被設為完全透明的顏色,如果沒有則為空字串。" #: ../../library/tkinter.rst:2291 msgid "macOS additionally supports:" -msgstr "" +msgstr "macOS 額外支援:" #: ../../library/tkinter.rst:2293 msgid "*class*" @@ -3581,72 +3969,77 @@ msgid "" "Whether the underlying Aqua window is an ``nswindow`` or an ``nspanel``; " "this can only be set before the window is created." msgstr "" +"底層的 Aqua 視窗是 ``nswindow`` 還是 ``nspanel``;此項只能在視窗建立之前設" +"定。" #: ../../library/tkinter.rst:2297 msgid "*modified*" -msgstr "" +msgstr "*modified*" #: ../../library/tkinter.rst:2298 msgid "" "The modification state shown by the window's close button and proxy icon." -msgstr "" +msgstr "由視窗的關閉按鈕和代理圖示顯示的修改狀態。" #: ../../library/tkinter.rst:2301 msgid "*notify*" -msgstr "" +msgstr "*notify*" #: ../../library/tkinter.rst:2302 msgid "Whether the application's dock icon bounces to request attention." -msgstr "" +msgstr "應用程式的 Dock 圖示是否會跳動以要求關注。" #: ../../library/tkinter.rst:2304 msgid "*stylemask*" -msgstr "" +msgstr "*stylemask*" #: ../../library/tkinter.rst:2305 msgid "" "The style mask of the underlying Aqua window, given as a list of bit names " "such as ``titled`` or ``resizable``." msgstr "" +"底層 Aqua 視窗的樣式遮罩,以位元名稱列表的形式給出,例如 ``titled`` 或 " +"``resizable``。" #: ../../library/tkinter.rst:2308 msgid "*tabbingid*" -msgstr "" +msgstr "*tabbingid*" #: ../../library/tkinter.rst:2309 msgid "The identifier of the tab group that the window belongs to." -msgstr "" +msgstr "視窗所屬分頁群組的識別碼。" #: ../../library/tkinter.rst:2311 msgid "*tabbingmode*" -msgstr "" +msgstr "*tabbingmode*" #: ../../library/tkinter.rst:2312 msgid "" "Whether the window may be opened as a tab: ``'auto'``, ``'preferred'`` or " "``'disallowed'``." msgstr "" +"視窗是否可以作為分頁開啟:``'auto'``、``'preferred'`` 或 ``'disallowed'``。" #: ../../library/tkinter.rst:2315 msgid "*titlepath*" -msgstr "" +msgstr "*titlepath*" #: ../../library/tkinter.rst:2316 msgid "The path of the file represented by the window's proxy icon." -msgstr "" +msgstr "視窗代理圖示所代表之檔案的路徑。" #: ../../library/tkinter.rst:2318 msgid "*transparent*" -msgstr "" +msgstr "*transparent*" #: ../../library/tkinter.rst:2319 msgid "" "Whether the content area is transparent and the window shadow is turned off." -msgstr "" +msgstr "內容區域是否透明,以及視窗陰影是否關閉。" #: ../../library/tkinter.rst:2322 msgid "X11 additionally supports:" -msgstr "" +msgstr "X11 額外支援:" #: ../../library/tkinter.rst:2324 msgid "*type*" @@ -3658,20 +4051,24 @@ msgid "" "manager should use to interpret the window, such as ``'dialog'`` or " "``'splash'``." msgstr "" +"視窗管理器應用來解讀該視窗的視窗類型,或依偏好順序排列的類型列表,例如 " +"``'dialog'`` 或 ``'splash'``。" #: ../../library/tkinter.rst:2329 msgid "*zoomed*" -msgstr "" +msgstr "*zoomed*" #: ../../library/tkinter.rst:2330 msgid "Whether the window is maximized." -msgstr "" +msgstr "視窗是否已最大化。" #: ../../library/tkinter.rst:2334 msgid "" "Tk 8.6 added the *type* attribute, and Tk 9.0 added the *appearance*, " "*class*, *stylemask*, *tabbingid* and *tabbingmode* attributes." msgstr "" +"Tk 8.6 新增了 *type* 屬性,Tk 9.0 新增了 *appearance*、*class*、*stylemask*、" +"*tabbingid* 和 *tabbingmode* 屬性。" #: ../../library/tkinter.rst:2337 msgid "" @@ -3679,6 +4076,8 @@ msgid "" "reflect the most recent request. :meth:`wm_attributes` is an alias of :meth:" "`!attributes`." msgstr "" +"在 X11 上,變更是非同步套用的,因此查詢到的值可能尚未反映最近的請求。:meth:" +"`wm_attributes` 是 :meth:`!attributes` 的別名。" #: ../../library/tkinter.rst:2341 msgid "" @@ -3686,6 +4085,8 @@ msgid "" "attributes may be set using keyword arguments. The *return_python_dict* " "parameter was added." msgstr "" +"現在可以透過不含開頭 ``-`` 的名稱來查詢單一屬性,且屬性可以使用關鍵字引數設" +"定。新增了 *return_python_dict* 參數。" #: ../../library/tkinter.rst:2346 msgid "" @@ -3693,6 +4094,8 @@ msgid "" "its value as two positional arguments, as in ``w.attributes('-alpha', " "0.5)``, is deprecated; use keyword arguments instead." msgstr "" +"透過傳入選項名稱(帶有開頭的 ``-``)及其值作為兩個位置引數來設定屬性,如 ``w." +"attributes('-alpha', 0.5)`` 這樣的用法已被棄用;請改用關鍵字引數。" #: ../../library/tkinter.rst:2358 msgid "" @@ -3702,6 +4105,10 @@ msgid "" "argument, return the last name set, or an empty string. :meth:`wm_client` is " "an alias of :meth:`!client`." msgstr "" +"將 *name*(應為執行該應用程式之主機的名稱)儲存到視窗的 " +"``WM_CLIENT_MACHINE`` 屬性中,供視窗或工作階段管理器使用。空字串會刪除該屬" +"性。不傳入引數時,回傳最後設定的名稱,或空字串。:meth:`wm_client` 是 :meth:`!" +"client` 的別名。" #: ../../library/tkinter.rst:2370 msgid "" @@ -3712,6 +4119,10 @@ msgid "" "currently named in the property. :meth:`wm_colormapwindows` is an alias of :" "meth:`!colormapwindows`." msgstr "" +"操作 ``WM_COLORMAP_WINDOWS`` 屬性,此屬性會告知視窗管理器哪些視窗擁有私有色彩" +"對映表。如果有給定 *wlist*,則會用這些視窗覆寫該屬性(其順序為安裝色彩對映表" +"的優先順序)。不傳入引數時,回傳目前在該屬性中列出的視窗列表。:meth:" +"`wm_colormapwindows` 是 :meth:`!colormapwindows` 的別名。" #: ../../library/tkinter.rst:2383 msgid "" @@ -3721,6 +4132,10 @@ msgid "" "argument, return the last value set, or an empty string. :meth:`wm_command` " "is an alias of :meth:`!command`." msgstr "" +"將 *value* 儲存到視窗的 ``WM_COMMAND`` 屬性中,供視窗或工作階段管理器使用;它" +"應該是一個列表,內容為用來呼叫該應用程式之指令的各個字詞。空字串會刪除該屬" +"性。不傳入引數時,回傳最後設定的值,或空字串。:meth:`wm_command` 是 :meth:`!" +"command` 的別名。" #: ../../library/tkinter.rst:2395 msgid "" @@ -3729,6 +4144,10 @@ msgid "" "is first mapped. On Windows the window is also raised and given the focus. :" "meth:`wm_deiconify` is an alias of :meth:`!deiconify`." msgstr "" +"以映射的方式,將視窗以正常(未圖示化)的形式顯示出來。如果該視窗從未被映射" +"過,這會確保它在第一次被映射時就以取消圖示化的狀態出現。在 Windows 上,該視窗" +"也會被提升到最上層並取得焦點。:meth:`wm_deiconify` 是 :meth:`!deiconify` 的別" +"名。" #: ../../library/tkinter.rst:2406 msgid "" @@ -3740,6 +4159,11 @@ msgid "" "focus` command assumes. :meth:`wm_focusmodel` is an alias of :meth:`!" "focusmodel`." msgstr "" +"設定或查詢視窗的焦點模型。*model* 是 ``'active'``\\ (視窗會為自己或其子代宣" +"告輸入焦點,即使焦點目前在其他應用程式中)或 ``'passive'``\\ (視窗依賴視窗管" +"理器將焦點給予它)兩者之一。不傳入引數時,回傳目前的模型。預設值為 " +"``'passive'``,這也是 :meth:`!focus` 指令所假定的模型。:meth:`wm_focusmodel` " +"是 :meth:`!focusmodel` 的別名。" #: ../../library/tkinter.rst:2421 msgid "" @@ -3748,10 +4172,14 @@ msgid "" "its ``-menu`` configuration is remembered and the menu reappears if the " "widget is managed again. :meth:`wm_forget` is an alias of :meth:`!forget`." msgstr "" +"將 *window* 從螢幕上取消映射,使其不再由視窗管理器管理。此後 :class:" +"`Toplevel` 會被當作 :class:`Frame` 對待,不過其 ``-menu`` 設定仍會被記住,且" +"該元件再次被管理時選單會重新出現。:meth:`wm_forget` 是 :meth:`!forget` 的別" +"名。" #: ../../library/tkinter.rst:2428 msgid "Not to be confused with :meth:`Pack.forget`." -msgstr "" +msgstr "請勿與 :meth:`Pack.forget` 混淆。" #: ../../library/tkinter.rst:2437 msgid "" @@ -3760,6 +4188,9 @@ msgid "" "such a frame; otherwise return the identifier of the window itself. :meth:" "`wm_frame` is an alias of :meth:`!frame`." msgstr "" +"回傳包含該視窗之最外層裝飾框架的平台特定視窗識別碼,前提是視窗管理器已將其重" +"新設定父視窗至該框架中;否則回傳該視窗本身的識別碼。:meth:`wm_frame` 是 :" +"meth:`!frame` 的別名。" #: ../../library/tkinter.rst:2448 msgid "" @@ -3773,6 +4204,13 @@ msgid "" "geometry as a string of the form ``'200x200+10+10'``. :meth:`wm_geometry` is " "an alias of :meth:`!geometry`." msgstr "" +"設定或查詢視窗的 geometry。*newGeometry* 的格式為 ``=widthxheight+x+y``,其" +"中 ``=``、``widthxheight`` 和 ``+x+y`` 位置皆可省略。*width* 和 *height* 的單" +"位為像素(若視窗為網格化視窗則為網格單位);以 ``+`` 開頭的位置是從螢幕左邊或" +"上邊測量,以 ``-`` 開頭的位置則是從螢幕右邊或下邊測量。空字串會取消任何使用者" +"指定的 geometry,讓視窗回復到自然大小。不傳入引數時,回傳目前的 geometry,格" +"式如 ``'200x200+10+10'`` 的字串。:meth:`wm_geometry` 是 :meth:`!geometry` 的" +"別名。" #: ../../library/tkinter.rst:2465 msgid "" @@ -3784,10 +4222,15 @@ msgid "" "of the four current values, or an empty string if the window is not " "gridded. :meth:`wm_grid` is an alias of :meth:`!grid`." msgstr "" +"將視窗管理為網格化視窗,並定義網格單位與像素之間的關係。*baseWidth* 和 " +"*baseHeight* 是視窗內部請求大小所對應的網格單位數,*widthInc* 和 *heightInc* " +"則是水平和垂直網格單位的像素大小。傳入空字串會關閉網格化管理。不傳入引數時," +"回傳目前四個值組成的元組,如果視窗未網格化則回傳空字串。:meth:`wm_grid` 是 :" +"meth:`!grid` 的別名。" #: ../../library/tkinter.rst:2475 msgid "Not to be confused with the grid geometry manager :meth:`Grid.grid`." -msgstr "" +msgstr "請勿與網格佈局管理器 :meth:`Grid.grid` 混淆。" #: ../../library/tkinter.rst:2482 msgid "" @@ -3798,6 +4241,10 @@ msgid "" "the current group leader, or an empty string. :meth:`wm_group` is an alias " "of :meth:`!group`." msgstr "" +"設定或查詢一組相關視窗的領導者。*pathName* 給定群組領導者的路徑名稱;例如,當" +"領導者被圖示化時,視窗管理器可能會將群組中的所有視窗取消映射。空字串會將該視" +"窗從任何群組中移除。不傳入引數時,回傳目前群組領導者的路徑名稱,或空字串。:" +"meth:`wm_group` 是 :meth:`!group` 的別名。" #: ../../library/tkinter.rst:2496 msgid "" @@ -3809,6 +4256,11 @@ msgid "" "all top-level windows that have no icon of their own. :meth:`wm_iconbitmap` " "is an alias of :meth:`!iconbitmap`." msgstr "" +"設定或查詢視窗管理器用於該視窗圖示的點陣圖。*bitmap* 以 Tk 接受的標準形式之一" +"指定一個點陣圖;空字串會取消目前的圖示點陣圖。不傳入引數時,回傳目前圖示點陣" +"圖的名稱,或空字串。在 Windows 上,*default* 引數指定一個圖示(例如一個 ``." +"ico`` 檔案),套用到所有沒有自己圖示的頂層視窗。:meth:`wm_iconbitmap` 是 :" +"meth:`!iconbitmap` 的別名。" #: ../../library/tkinter.rst:2510 msgid "" @@ -3816,6 +4268,8 @@ msgid "" "time, arrange for it to appear in the iconified state when it is eventually " "mapped. :meth:`wm_iconify` is an alias of :meth:`!iconify`." msgstr "" +"將視窗圖示化。如果該視窗尚未第一次被映射過,則安排它在最終被映射時以圖示化狀" +"態出現。:meth:`wm_iconify` 是 :meth:`!iconify` 的別名。" #: ../../library/tkinter.rst:2520 msgid "" @@ -3826,6 +4280,10 @@ msgid "" "mask, or an empty string. :meth:`wm_iconmask` is an alias of :meth:`!" "iconmask`." msgstr "" +"設定或查詢用作圖示遮罩的點陣圖(見 :meth:`iconbitmap`)。遮罩中為零的地方不會" +"顯示圖示;為一的地方,則會顯示圖示點陣圖對應的位元。空字串會取消目前的遮罩。" +"不傳入引數時,回傳目前圖示遮罩的名稱,或空字串。:meth:`wm_iconmask` 是 :meth:" +"`!iconmask` 的別名。" #: ../../library/tkinter.rst:2534 msgid "" @@ -3834,6 +4292,9 @@ msgid "" "none has been set (in which case the window manager normally displays the " "window's title). :meth:`wm_iconname` is an alias of :meth:`!iconname`." msgstr "" +"設定或查詢視窗管理器在視窗圖示內顯示的名稱。不傳入引數時,回傳目前的圖示名" +"稱,如果尚未設定則回傳空字串(此時視窗管理器通常會顯示視窗的標題)。:meth:" +"`wm_iconname` 是 :meth:`!iconname` 的別名。" #: ../../library/tkinter.rst:2546 msgid "" @@ -3846,6 +4307,11 @@ msgid "" "macOS only the first image is used. :meth:`wm_iconphoto` is an alias of :" "meth:`!iconphoto`." msgstr "" +"從 *images* 中給定的一個或多個 :class:`PhotoImage` 物件設定視窗的標題列圖示。" +"可以提供多張不同大小的圖片(例如 16x16 和 32x32),讓視窗管理器可以選擇合適的" +"一張。圖片資料是在呼叫當下擷取的快照;之後對圖片的變更不會反映出來。如果 " +"*default* 為 true,該圖示也會套用到未來建立的所有頂層視窗。在 macOS 上只會使" +"用第一張圖片。:meth:`wm_iconphoto` 是 :meth:`!iconphoto` 的別名。" #: ../../library/tkinter.rst:2564 msgid "" @@ -3855,6 +4321,9 @@ msgid "" "no hint is in effect. :meth:`wm_iconposition` is an alias of :meth:`!" "iconposition`." msgstr "" +"設定或查詢提示視窗管理器該視窗圖示應放置於何處的提示值。空字串會取消現有的提" +"示值。不傳入引數時,回傳目前兩個值組成的元組,如果沒有生效中的提示值則回傳空" +"字串。:meth:`wm_iconposition` 是 :meth:`!iconposition` 的別名。" #: ../../library/tkinter.rst:2576 msgid "" @@ -3866,6 +4335,11 @@ msgid "" "meaningless on non-X11 platforms. :meth:`wm_iconwindow` is an alias of :meth:" "`!iconwindow`." msgstr "" +"設定或查詢用作該視窗圖示的視窗。當該視窗被圖示化時,*pathName* 會被映射以作為" +"其圖示,並在其取消圖示化時再次取消映射。空字串會取消此關聯。不傳入引數時,回" +"傳目前圖示視窗的路徑名稱,或空字串。並非所有視窗管理器都支援圖示視窗,且此概" +"念在非 X11 平台上沒有意義。:meth:`wm_iconwindow` 是 :meth:`!iconwindow` 的別" +"名。" #: ../../library/tkinter.rst:2591 msgid "" @@ -3875,6 +4349,10 @@ msgid "" "are **not** accepted); passing any other widget type raises an error. :meth:" "`wm_manage` is an alias of :meth:`!manage`." msgstr "" +"使 *widget* 成為一個獨立的頂層視窗,並由視窗管理器加上標題列等裝飾。只能使" +"用 :class:`Frame`、:class:`LabelFrame` 和 :class:`Toplevel` 元件(**不**\\ 接" +"受 :mod:`tkinter.ttk` 版本);傳入任何其他元件類型都會引發錯誤。:meth:" +"`wm_manage` 是 :meth:`!manage` 的別名。" #: ../../library/tkinter.rst:2605 msgid "" @@ -3884,6 +4362,10 @@ msgid "" "the current maximum width and height. The maximum size defaults to the size " "of the screen. :meth:`wm_maxsize` is an alias of :meth:`!maxsize`." msgstr "" +"設定或查詢視窗的最大允許尺寸,以像素為單位(若視窗為網格化視窗則為網格單" +"位)。視窗管理器會限制視窗不得大於 *width* 和 *height*。不傳入引數時,回傳目" +"前最大寬度和高度組成的元組。最大尺寸預設為螢幕的大小。:meth:`wm_maxsize` 是 :" +"meth:`!maxsize` 的別名。" #: ../../library/tkinter.rst:2619 msgid "" @@ -3893,6 +4375,10 @@ msgid "" "of the current minimum width and height. The minimum size defaults to one " "pixel in each dimension. :meth:`wm_minsize` is an alias of :meth:`!minsize`." msgstr "" +"設定或查詢視窗的最小允許尺寸,以像素為單位(若視窗為網格化視窗則為網格單" +"位)。視窗管理器會限制視窗不得小於 *width* 和 *height*。不傳入引數時,回傳目" +"前最小寬度和高度組成的元組。最小尺寸預設為每個維度 1 像素。:meth:" +"`wm_minsize` 是 :meth:`!minsize` 的別名。" #: ../../library/tkinter.rst:2633 msgid "" @@ -3904,6 +4390,11 @@ msgid "" "is first mapped or remapped from the withdrawn state. :meth:" "`wm_overrideredirect` is an alias of :meth:`!overrideredirect`." msgstr "" +"設定或查詢視窗的 override-redirect 旗標。設定此旗標時,視窗管理器會忽略該視" +"窗:它不會被重新設定父視窗到裝飾框架中,使用者也無法透過一般的視窗管理器控制" +"項來操作它。不傳入引數時,回傳一個布林值,表示該旗標是否已設定。此旗標只有在" +"視窗第一次被映射或從撤回狀態重新映射時才會可靠地被遵循。:meth:" +"`wm_overrideredirect` 是 :meth:`!overrideredirect` 的別名。" #: ../../library/tkinter.rst:2647 msgid "" @@ -3915,6 +4406,11 @@ msgid "" "`geometry` is called, unless it has been set explicitly to ``'program'``. :" "meth:`wm_positionfrom` is an alias of :meth:`!positionfrom`." msgstr "" +"設定或查詢視窗目前位置的來源。*who* 是 ``'program'`` 或 ``'user'`` 兩者之一," +"表示該位置是由程式還是由使用者所要求的;空字串會取消目前的來源。不傳入引數" +"時,回傳目前的來源,如果尚未設定則回傳空字串。當 :meth:`geometry` 被呼叫時," +"Tk 會自動將來源設為 ``'user'``,除非它已明確設為 ``'program'``。:meth:" +"`wm_positionfrom` 是 :meth:`!positionfrom` 的別名。" #: ../../library/tkinter.rst:2662 msgid "" @@ -3929,6 +4425,14 @@ msgid "" "arguments, return a tuple of the protocols that currently have handlers. :" "meth:`wm_protocol` is an alias of :meth:`!protocol`." msgstr "" +"將 *func* 註冊為視窗管理器通訊協定 *name*\\ (一個 atom,例如 " +"``'WM_DELETE_WINDOW'``、``'WM_SAVE_YOURSELF'`` 或 ``'WM_TAKE_FOCUS'``)的處理" +"常式;每當視窗管理器傳送該通訊協定的訊息時,就會呼叫 *func*。Tk 安裝了一個預" +"設的 ``WM_DELETE_WINDOW`` 處理常式來銷毀該視窗,這個方法可以取代它。如果 " +"*func* 為空字串,則會移除該處理常式。只傳入 *name* 時,回傳其已註冊之處理常式" +"指令的名稱,如果沒有設定則回傳空字串(不會回報預設的 ``WM_DELETE_WINDOW`` 處" +"理常式);不傳入引數時,回傳目前有處理常式的通訊協定組成的元組。:meth:" +"`wm_protocol` 是 :meth:`!protocol` 的別名。" #: ../../library/tkinter.rst:2680 msgid "" @@ -3939,6 +4443,10 @@ msgid "" "a window is resizable in both dimensions. :meth:`wm_resizable` is an alias " "of :meth:`!resizable`." msgstr "" +"控制使用者是否可以互動式地調整視窗大小。*width* 和 *height* 是布林值,決定視" +"窗的寬度和高度是否可以變更。不傳入引數時,回傳一個由兩個 ``0``/``1`` 值組成的" +"元組,表示每個維度目前是否可調整大小。預設情況下,視窗在兩個維度上都可調整大" +"小。:meth:`wm_resizable` 是 :meth:`!resizable` 的別名。" #: ../../library/tkinter.rst:2693 msgid "" @@ -3948,6 +4456,10 @@ msgid "" "no argument, return the current source, or an empty string if none has been " "set. :meth:`wm_sizefrom` is an alias of :meth:`!sizefrom`." msgstr "" +"設定或查詢視窗目前大小的來源。*who* 是 ``'program'`` 或 ``'user'`` 兩者之一," +"表示該大小是由程式還是由使用者所要求的;空字串會取消目前的來源。不傳入引數" +"時,回傳目前的來源,如果尚未設定則回傳空字串。:meth:`wm_sizefrom` 是 :meth:`!" +"sizefrom` 的別名。" #: ../../library/tkinter.rst:2706 msgid "" @@ -3958,11 +4470,16 @@ msgid "" "for another window (see :meth:`iconwindow`); the ``'icon'`` state cannot be " "set. :meth:`wm_state` is an alias of :meth:`!state`." msgstr "" +"設定或查詢視窗的狀態。不傳入引數時,回傳目前的狀態:``'normal'``、" +"``'iconic'``、``'withdrawn'``、``'icon'`` 之一,或者僅限 Windows 和 macOS 的 " +"``'zoomed'``。``'iconic'`` 指的是已被圖示化的視窗,而 ``'icon'`` 指的是作為另" +"一個視窗之圖示的視窗(見 :meth:`iconwindow`);``'icon'`` 狀態無法被設定。:" +"meth:`wm_state` 是 :meth:`!state` 的別名。" #: ../../library/tkinter.rst:2715 msgid "" "Not to be confused with :meth:`ttk.Widget.state `." -msgstr "" +msgstr "請勿與 :meth:`ttk.Widget.state ` 混淆。" #: ../../library/tkinter.rst:2723 msgid "" @@ -3971,6 +4488,9 @@ msgid "" "title. The title defaults to the window's name. :meth:`wm_title` is an alias " "of :meth:`!title`." msgstr "" +"設定或查詢視窗的標題,視窗管理器應在視窗的標題列中顯示此標題。不傳入引數時," +"回傳目前的標題。標題預設為視窗的名稱。:meth:`wm_title` 是 :meth:`!title` 的別" +"名。" #: ../../library/tkinter.rst:2734 msgid "" @@ -3982,6 +4502,11 @@ msgid "" "manager; it is an error to make a window a transient of itself. :meth:" "`wm_transient` is an alias of :meth:`!transient`." msgstr "" +"將視窗標記為一個代表 *master*(另一個頂層視窗的路徑名稱)運作的暫時性視窗(例" +"如下拉選單或對話方塊)。空字串會清除暫時性狀態。不傳入引數時,回傳目前主控視" +"窗的路徑名稱,或空字串。暫時性視窗會鏡射其主控視窗的狀態變化,且視窗管理器可" +"能會以不同方式裝飾它;將視窗設為自己的暫時性視窗會是一個錯誤。:meth:" +"`wm_transient` 是 :meth:`!transient` 的別名。" #: ../../library/tkinter.rst:2750 msgid "" @@ -3992,6 +4517,10 @@ msgid "" "some window managers notice changes to window attributes. :meth:" "`wm_withdraw` is an alias of :meth:`!withdraw`." msgstr "" +"將視窗從螢幕上撤回,取消其映射並使視窗管理器忘記它。如果該視窗從未被映射過," +"則會改為以撤回狀態映射。有時必須撤回視窗然後重新映射它(例如使用 :meth:" +"`deiconify`),才能讓某些視窗管理器注意到視窗屬性的變化。:meth:`wm_withdraw` " +"是 :meth:`!withdraw` 的別名。" #: ../../library/tkinter.rst:2762 msgid "" @@ -4000,6 +4529,9 @@ msgid "" "(through :class:`Widget`) and provides the methods for managing a widget " "with the *pack* geometry manager. See also :ref:`pack-the-packer`." msgstr "" +"透過將元件緊靠其容器的邊來排列元件的佈局管理器。:class:`!Pack` mix-in 由所有" +"元件所繼承(透過 :class:`Widget`),並提供使用 *pack* 佈局管理器管理元件的方" +"法。另請參閱 :ref:`pack-the-packer`。" #: ../../library/tkinter.rst:2771 msgid "" @@ -4013,12 +4545,22 @@ msgid "" "``pack_*``, ``grid_*`` and ``place_*`` methods (and ``pack``, ``grid``, " "``place`` for geometry configuration) to act on a specific geometry manager." msgstr "" +":class:`Pack`、:class:`Place` 和 :class:`Grid` 都定義了相同的簡短方法名稱 :" +"meth:`!forget`、:meth:`!info`、:meth:`!slaves`、:meth:`!content` 和 :meth:`!" +"propagate`。在元件上,這些簡短名稱會解析為 *pack* 管理器的版本,因為無論實際" +"上是哪個管理器在管理該元件,:class:`Pack` 和 :class:`Misc` 在方法解析順序中都" +"排在 :class:`Place` 和 :class:`Grid` 之前;而 :meth:`!configure`/:meth:`!" +"config` 設定的是元件的選項,而非其 geometry。請使用明確的 ``pack_*``、" +"``grid_*`` 和 ``place_*`` 方法(以及用於 geometry 設定的 ``pack``、``grid``、" +"``place``)來針對特定的佈局管理器進行操作。" #: ../../library/tkinter.rst:2793 msgid "" "Pack the widget inside its container, positioning it relative to the " "siblings already packed there. The supported options are:" msgstr "" +"在元件的容器內排列它,使其相對於已經 pack 在該處的同層元件定位。支援的選項" +"有:" #: ../../library/tkinter.rst:2797 msgid "*side*" @@ -4029,6 +4571,8 @@ msgid "" "Which side of the container to pack the widget against: ``'top'`` (the " "default), ``'bottom'``, ``'left'`` or ``'right'``." msgstr "" +"要將元件緊靠容器的哪一側:``'top'``\\ (預設值)、``'bottom'``、``'left'`` " +"或 ``'right'``。" #: ../../library/tkinter.rst:2801 ../../library/tkinter.rst:3423 msgid "*fill*" @@ -4039,6 +4583,8 @@ msgid "" "Whether to stretch the widget to fill its parcel: ``'none'`` (the default), " "``'x'``, ``'y'`` or ``'both'``." msgstr "" +"是否要拉伸元件以填滿它的位置:``'none'``\\ (預設值)、``'x'``、``'y'`` 或 " +"``'both'``。" #: ../../library/tkinter.rst:2805 msgid "*expand*" @@ -4048,7 +4594,7 @@ msgstr "*expand*" msgid "" "Whether the widget should expand to consume any extra space in its container " "(a boolean, default false)." -msgstr "" +msgstr "元件是否應該擴展以消耗其容器中任何額外的空間(布林值,預設為 false)。" #: ../../library/tkinter.rst:2809 ../../library/tkinter.rst:2914 #: ../../library/tkinter.rst:3533 ../../library/tkinter.rst:3552 @@ -4061,6 +4607,8 @@ msgid "" "Where to position the widget in its parcel when the parcel is larger than " "the widget: an anchor such as ``'n'`` or ``'sw'`` (default ``'center'``)." msgstr "" +"當元件所在的位置比元件本身大時,元件在該位置中要放在哪裡:一個錨點,例如 " +"``'n'`` 或 ``'sw'``\\ (預設為 ``'center'``)。" #: ../../library/tkinter.rst:2814 ../../library/tkinter.rst:3007 msgid "*ipadx*, *ipady*" @@ -4071,6 +4619,8 @@ msgid "" "Internal padding added on the left and right (*ipadx*) or top and bottom " "(*ipady*) of the widget, as a screen distance (default ``0``)." msgstr "" +"在元件的左右(*ipadx*)或上下(*ipady*)新增的內部填充,以螢幕距離表示(預設" +"為 ``0``)。" #: ../../library/tkinter.rst:2818 ../../library/tkinter.rst:3011 msgid "*padx*, *pady*" @@ -4082,42 +4632,46 @@ msgid "" "(*pady*) of the widget, as a screen distance or a pair of two distances for " "the two sides (default ``0``)." msgstr "" +"在元件的左右(*padx*)或上下(*pady*)留出的外部填充,以螢幕距離或兩側各自距" +"離組成的一對值表示(預設為 ``0``)。" #: ../../library/tkinter.rst:2823 msgid "*after*" -msgstr "" +msgstr "*after*" #: ../../library/tkinter.rst:2824 msgid "" "Pack the widget after the given widget in the packing order, using the same " "container." -msgstr "" +msgstr "在排列順序中,將元件排在指定元件之後,並使用相同的容器。" #: ../../library/tkinter.rst:2827 msgid "*before*" -msgstr "" +msgstr "*before*" #: ../../library/tkinter.rst:2828 msgid "" "Pack the widget before the given widget in the packing order, using the same " "container." -msgstr "" +msgstr "在排列順序中,將元件排在指定元件之前,並使用相同的容器。" #: ../../library/tkinter.rst:2831 ../../library/tkinter.rst:2934 #: ../../library/tkinter.rst:3016 msgid "*in_*" -msgstr "" +msgstr "*in_*" #: ../../library/tkinter.rst:2832 msgid "" "The container in which to pack the widget; it defaults to the parent widget." -msgstr "" +msgstr "要將元件排列於其中的容器;預設為父元件。" #: ../../library/tkinter.rst:2835 msgid "" ":meth:`pack`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" "pack_configure`." msgstr "" +":meth:`pack`、:meth:`configure` 和 :meth:`config` 都是 :meth:`!" +"pack_configure` 的別名。" #: ../../library/tkinter.rst:2843 msgid "" @@ -4128,16 +4682,23 @@ msgid "" "PanedWindow `, which provide their own :meth:`!" "forget` method." msgstr "" +"取消映射該元件並將其從排列順序中移除,忘記其排列選項。之後可以再次用 :meth:" +"`pack_configure` 排列它。:meth:`forget` 是 :meth:`!pack_forget` 的別名,但 :" +"class:`PanedWindow`、:class:`ttk.Notebook ` 和 :class:" +"`ttk.PanedWindow ` 除外,它們提供了自己的 :meth:`!" +"forget` 方法。" #: ../../library/tkinter.rst:2852 msgid "Not to be confused with :meth:`Wm.forget`." -msgstr "" +msgstr "請勿與 :meth:`Wm.forget` 混淆。" #: ../../library/tkinter.rst:2859 msgid "" "Return a dictionary of the widget's current packing options. :meth:`info` is " "an alias of :meth:`!pack_info`." msgstr "" +"回傳一個 dictionary,內容為元件目前的排列選項。:meth:`info` 是 :meth:`!" +"pack_info` 的別名。" #: ../../library/tkinter.rst:2869 msgid "" @@ -4145,12 +4706,16 @@ msgid "" "enable or disable geometry propagation. :meth:`propagate` is an alias of :" "meth:`!pack_propagate`." msgstr "" +"與 :meth:`Misc.pack_propagate` 相同,將此元件視為一個容器:啟用或停用 " +"geometry 傳播。:meth:`propagate` 是 :meth:`!pack_propagate` 的別名。" #: ../../library/tkinter.rst:2878 msgid "" "Same as :meth:`Misc.pack_slaves`: return the list of widgets packed in this " "widget. :meth:`slaves` is an alias of :meth:`!pack_slaves`." msgstr "" +"與 :meth:`Misc.pack_slaves` 相同:回傳排列在此元件中的元件列表。:meth:" +"`slaves` 是 :meth:`!pack_slaves` 的別名。" #: ../../library/tkinter.rst:2885 msgid "" @@ -4158,26 +4723,28 @@ msgid "" "their container. The :class:`!Place` mix-in is inherited by all widgets " "(through :class:`Widget`)." msgstr "" +"佈局管理器,在容器內以明確的位置與大小放置元件。:class:`!Place` mix-in 由所有" +"元件(透過 :class:`Widget`)繼承。" #: ../../library/tkinter.rst:2899 msgid "" "Place the widget inside its container at an absolute or relative position. " "The supported options are:" -msgstr "" +msgstr "將元件以絕對或相對位置放置在其容器內。支援的選項如下:" #: ../../library/tkinter.rst:2903 msgid "*x*, *y*" -msgstr "" +msgstr "*x*, *y*" #: ../../library/tkinter.rst:2904 msgid "" "The absolute horizontal and vertical position of the widget's anchor point, " "as a screen distance (default ``0``)." -msgstr "" +msgstr "元件錨點的絕對水平與垂直位置,以螢幕距離表示(預設為 ``0``)。" #: ../../library/tkinter.rst:2907 msgid "*relx*, *rely*" -msgstr "" +msgstr "*relx*, *rely*" #: ../../library/tkinter.rst:2908 msgid "" @@ -4186,26 +4753,30 @@ msgid "" "top edge and ``1.0`` is the right or bottom edge. If both the absolute and " "the relative option are given, their values are summed." msgstr "" +"元件錨點的水平與垂直位置,以容器寬度與高度的分數表示,其中 ``0.0`` 為左邊或上" +"邊,``1.0`` 為右邊或下邊。若同時給定絕對與相對選項,則會將兩者的值相加。" #: ../../library/tkinter.rst:2915 msgid "" "Which point of the widget is placed at the given position: an anchor such as " "``'n'`` or ``'se'`` (default ``'nw'``)." msgstr "" +"元件的哪一點會被放置在給定位置:一個錨點,例如 ``'n'`` 或 ``'se'``\\ (預設" +"為 ``'nw'``)。" #: ../../library/tkinter.rst:2918 ../../library/tkinter.rst:3583 msgid "*width*, *height*" -msgstr "" +msgstr "*width*, *height*" #: ../../library/tkinter.rst:2919 msgid "" "The absolute width and height of the widget, as a screen distance. By " "default the widget's requested size is used." -msgstr "" +msgstr "元件的絕對寬度與高度,以螢幕距離表示。預設會使用元件所要求的大小。" #: ../../library/tkinter.rst:2922 msgid "*relwidth*, *relheight*" -msgstr "" +msgstr "*relwidth*, *relheight*" #: ../../library/tkinter.rst:2923 msgid "" @@ -4213,10 +4784,12 @@ msgid "" "and height. If both the absolute and the relative option are given, their " "values are summed." msgstr "" +"元件的寬度與高度,以容器寬度與高度的分數表示。若同時給定絕對與相對選項,則會" +"將兩者的值相加。" #: ../../library/tkinter.rst:2928 msgid "*bordermode*" -msgstr "" +msgstr "*bordermode*" #: ../../library/tkinter.rst:2929 msgid "" @@ -4224,34 +4797,39 @@ msgid "" "measures the area inside the border, ``'outside'`` measures the area " "including the border, and ``'ignore'`` uses the official X area." msgstr "" +"容器的邊框如何影響放置:``'inside'``\\ (預設)會測量邊框內部的區域," +"``'outside'`` 會測量包含邊框的區域,而 ``'ignore'`` 則使用官方的 X 區域。" #: ../../library/tkinter.rst:2935 msgid "" "The container relative to which the widget is placed; it must be the " "widget's parent or a descendant of the parent, and defaults to the parent." msgstr "" +"元件放置所相對的容器;它必須是元件的父元件,或父元件的子代,預設為父元件。" #: ../../library/tkinter.rst:2939 msgid "" ":meth:`place`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" "place_configure`." msgstr "" +":meth:`place`、:meth:`configure` 和 :meth:`config` 是 :meth:`!" +"place_configure` 的別名。" #: ../../library/tkinter.rst:2947 msgid "" "Unmap the widget and remove it from the placement, forgetting its place " "options." -msgstr "" +msgstr "取消映射該元件並將其從放置中移除,並捨棄其 place 選項。" #: ../../library/tkinter.rst:2955 msgid "Return a dictionary of the widget's current place options." -msgstr "" +msgstr "回傳一個字典,內容為該元件目前的 place 選項。" #: ../../library/tkinter.rst:2962 msgid "" "Same as :meth:`Misc.place_slaves`: return the list of widgets placed in this " "widget." -msgstr "" +msgstr "與 :meth:`Misc.place_slaves` 相同:回傳放置在此元件中的元件串列。" #: ../../library/tkinter.rst:2968 msgid "" @@ -4259,22 +4837,24 @@ msgid "" "columns within their container. The :class:`!Grid` mix-in is inherited by " "all widgets (through :class:`Widget`)." msgstr "" +"佈局管理器,在容器內以列與欄組成的二維格線排列元件。:class:`!Grid` mix-in 由" +"所有元件(透過 :class:`Widget`)繼承。" #: ../../library/tkinter.rst:2982 msgid "Position the widget in a cell of its container's grid." -msgstr "" +msgstr "將元件放置在其容器格線的某個儲存格中。" #: ../../library/tkinter.rst:2984 msgid "Not to be confused with :meth:`Wm.grid`." -msgstr "" +msgstr "請勿與 :meth:`Wm.grid` 混淆。" #: ../../library/tkinter.rst:2986 msgid "The supported options are:" -msgstr "" +msgstr "支援的選項如下:" #: ../../library/tkinter.rst:2988 msgid "*row*, *column*" -msgstr "" +msgstr "*row*, *column*" #: ../../library/tkinter.rst:2989 msgid "" @@ -4283,18 +4863,21 @@ msgid "" "same :meth:`!grid_configure` call (or ``0``), and *row* defaults to the next " "empty row." msgstr "" +"要放置元件的儲存格所在的列與欄,從 ``0`` 開始計算。*column* 預設為同一次 :" +"meth:`!grid_configure` 呼叫中前一個放置元件之後的欄(或 ``0``),而 *row* 預" +"設為下一個空的列。" #: ../../library/tkinter.rst:2995 msgid "*rowspan*, *columnspan*" -msgstr "" +msgstr "*rowspan*, *columnspan*" #: ../../library/tkinter.rst:2996 msgid "The number of rows and columns the widget should span (default ``1``)." -msgstr "" +msgstr "元件應跨越的列數與欄數(預設為 ``1``)。" #: ../../library/tkinter.rst:2998 msgid "*sticky*" -msgstr "" +msgstr "*sticky*" #: ../../library/tkinter.rst:2999 msgid "" @@ -4305,33 +4888,41 @@ msgid "" "fill the height (or width) of the cell. The default is ``''``, which centers " "the widget at its requested size." msgstr "" +"當儲存格大於元件時,如何定位或伸展元件:一個包含零或多個字元 ``'n'``、" +"``'s'``、``'e'`` 和 ``'w'`` 的字串,用以命名元件所貼齊的儲存格邊。同時指定 " +"``'n'`` 和 ``'s'``\\ (或 ``'e'`` 和 ``'w'``)會將元件伸展以填滿儲存格的高度" +"(或寬度)。預設值為 ``''``,此時元件會以其所要求的大小置中。" #: ../../library/tkinter.rst:3017 msgid "" "The container in whose grid to place the widget; it defaults to the parent " "widget." -msgstr "" +msgstr "要在其格線中放置元件的容器;預設為父元件。" #: ../../library/tkinter.rst:3020 msgid "" ":meth:`grid`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" "grid_configure`." msgstr "" +":meth:`grid`、:meth:`configure` 和 :meth:`config` 是 :meth:`!grid_configure` " +"的別名。" #: ../../library/tkinter.rst:3028 msgid "" "Unmap the widget and remove it from the grid, forgetting its grid options." -msgstr "" +msgstr "取消映射該元件並將其從格線中移除,並捨棄其 grid 選項。" #: ../../library/tkinter.rst:3033 msgid "" "Unmap the widget and remove it from the grid, but remember its grid options " "so that it is restored to the same cell if it is gridded again." msgstr "" +"取消映射該元件並將其從格線中移除,但保留其 grid 選項,以便再次進行 grid 設定" +"時可還原到相同的儲存格。" #: ../../library/tkinter.rst:3041 msgid "Return a dictionary of the widget's current grid options." -msgstr "" +msgstr "回傳一個字典,內容為該元件目前的 grid 選項。" #: ../../library/tkinter.rst:3048 msgid "" @@ -4341,6 +4932,10 @@ msgid "" "Treeview `, which provide their own :meth:`!bbox` " "method." msgstr "" +"與 :meth:`Misc.grid_bbox` 相同。:meth:`bbox` 是 :meth:`!grid_bbox` 的別名," +"但 :class:`Canvas`、:class:`Listbox`、:class:`Spinbox`、:class:`Text`、:" +"class:`ttk.Entry ` 和 :class:`ttk.Treeview ` 除外,這些元件提供了自己的 :meth:`!bbox` 方法。" #: ../../library/tkinter.rst:3060 msgid "" @@ -4348,12 +4943,17 @@ msgid "" "*weight*, *minsize*, *pad* and *uniform*) of a grid column. :meth:" "`columnconfigure` is an alias of :meth:`!grid_columnconfigure`." msgstr "" +"與 :meth:`Misc.grid_columnconfigure` 相同:查詢或設定格線欄的選項(例如 " +"*weight*、*minsize*、*pad* 和 *uniform*)。:meth:`columnconfigure` 是 :meth:" +"`!grid_columnconfigure` 的別名。" #: ../../library/tkinter.rst:3069 msgid "" "Same as :meth:`Misc.grid_rowconfigure`: query or set the options of a grid " "row. :meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." msgstr "" +"與 :meth:`Misc.grid_rowconfigure` 相同:查詢或設定格線列的選項。:meth:" +"`rowconfigure` 是 :meth:`!grid_rowconfigure` 的別名。" #: ../../library/tkinter.rst:3078 msgid "" @@ -4361,6 +4961,8 @@ msgid "" "that covers the pixel at *x*, *y*. :meth:`location` is an alias of :meth:`!" "grid_location`." msgstr "" +"與 :meth:`Misc.grid_location` 相同:回傳涵蓋位於 *x*、*y* 像素之儲存格的 " +"``(column, row)``。:meth:`location` 是 :meth:`!grid_location` 的別名。" #: ../../library/tkinter.rst:3087 msgid "" @@ -4368,16 +4970,21 @@ msgid "" "the size of the grid. :meth:`size` is an alias of :meth:`!grid_size`, except " "on the :class:`Listbox` widget, which provides its own :meth:`!size` method." msgstr "" +"與 :meth:`Misc.grid_size` 相同:回傳一個 ``(columns, rows)`` 元組,給出格線的" +"大小。:meth:`size` 是 :meth:`!grid_size` 的別名,但 :class:`Listbox` 元件除" +"外,它提供了自己的 :meth:`!size` 方法。" #: ../../library/tkinter.rst:3100 msgid "Same as :meth:`Misc.grid_propagate`." -msgstr "" +msgstr "與 :meth:`Misc.grid_propagate` 相同。" #: ../../library/tkinter.rst:3107 msgid "" "Same as :meth:`Misc.grid_slaves`: return the widgets managed in the grid, " "optionally restricted to a *row* and/or *column*." msgstr "" +"與 :meth:`Misc.grid_slaves` 相同:回傳在格線中被管理的元件,可選擇限制於特定" +"的 *row* 和/或 *column*。" #: ../../library/tkinter.rst:3113 msgid "" @@ -4386,6 +4993,9 @@ msgid "" "class:`Spinbox`. A widget's :meth:`xview` method is registered as the " "*command* of a horizontal :class:`Scrollbar`." msgstr "" +"提供水平捲動介面的 mix-in,由 :class:`Entry`、:class:`Canvas`、:class:" +"`Listbox`、:class:`Text` 和 :class:`Spinbox` 等元件共用。元件的 :meth:" +"`xview` 方法會被註冊為水平 :class:`Scrollbar` 的 *command*。" #: ../../library/tkinter.rst:3121 msgid "" @@ -4396,12 +5006,18 @@ msgid "" "scrollbar; :meth:`xview_moveto` and :meth:`xview_scroll` provide a more " "convenient interface." msgstr "" +"查詢或變更視圖的水平位置。若不帶引數,則回傳一個由介於 0 和 1 之間的兩個分數" +"組成的元組 ``(first, last)``,表示目前可見的文件部分。否則,引數會被傳遞給 " +"Tk 的 ``xview`` 元件指令,通常由捲軸產生;:meth:`xview_moveto` 和 :meth:" +"`xview_scroll` 提供了更方便的介面。" #: ../../library/tkinter.rst:3131 msgid "" "Adjust the view so that *fraction* of the total width of the document is off-" "screen to the left. *fraction* is a number between 0 and 1." msgstr "" +"調整視圖,使文件總寬度中 *fraction* 的部分位於畫面左側之外。*fraction* 是一個" +"介於 0 和 1 之間的數字。" #: ../../library/tkinter.rst:3137 msgid "" @@ -4409,6 +5025,8 @@ msgid "" "or ``'pages'``; a negative *number* scrolls left and a positive one scrolls " "right." msgstr "" +"將視圖向左或向右移動 *number* 個單位。*what* 為 ``'units'`` 或 ``'pages'`` 其" +"中之一;*number* 為負數時向左捲動,為正數時向右捲動。" #: ../../library/tkinter.rst:3144 msgid "" @@ -4416,6 +5034,9 @@ msgid "" "class:`Canvas`, :class:`Listbox` and :class:`Text`. A widget's :meth:`yview` " "method is registered as the *command* of a vertical :class:`Scrollbar`." msgstr "" +"提供垂直捲動介面的 mix-in,由 :class:`Canvas`、:class:`Listbox` 和 :class:" +"`Text` 等元件共用。元件的 :meth:`yview` 方法會被註冊為垂直 :class:" +"`Scrollbar` 的 *command*。" #: ../../library/tkinter.rst:3151 msgid "" @@ -4426,18 +5047,26 @@ msgid "" "scrollbar; :meth:`yview_moveto` and :meth:`yview_scroll` provide a more " "convenient interface." msgstr "" +"查詢或變更視圖的垂直位置。若不帶引數,則回傳一個由介於 0 和 1 之間的兩個分數" +"組成的元組 ``(first, last)``,表示目前可見的文件部分。否則,引數會被傳遞給 " +"Tk 的 ``yview`` 元件指令,通常由捲軸產生;:meth:`yview_moveto` 和 :meth:" +"`yview_scroll` 提供了更方便的介面。" #: ../../library/tkinter.rst:3161 msgid "" "Adjust the view so that *fraction* of the total height of the document is " "off-screen above the top. *fraction* is a number between 0 and 1." msgstr "" +"調整視圖,使文件總高度中 *fraction* 的部分位於畫面頂端之外。*fraction* 是一個" +"介於 0 和 1 之間的數字。" #: ../../library/tkinter.rst:3167 msgid "" "Shift the view up or down by *number* units. *what* is either ``'units'`` or " "``'pages'``; a negative *number* scrolls up and a positive one scrolls down." msgstr "" +"將視圖向上或向下移動 *number* 個單位。*what* 為 ``'units'`` 或 ``'pages'`` 其" +"中之一;*number* 為負數時向上捲動,為正數時向下捲動。" #: ../../library/tkinter.rst:3174 msgid "" @@ -4446,12 +5075,15 @@ msgid "" "normally uses :class:`Widget` or a concrete widget class rather than " "instantiating :class:`!BaseWidget` directly." msgstr "" +"所有元件的內部基礎類別。它繼承自 :class:`Misc`,並加入用於建立底層 Tk 元件的" +"機制;應用程式程式碼通常會使用 :class:`Widget` 或具體的元件類別,而不會直接實" +"例化 :class:`!BaseWidget`。" #: ../../library/tkinter.rst:3182 msgid "" "Destroy this widget and all of its children, removing the corresponding Tk " "widgets and deleting the associated Tcl commands." -msgstr "" +msgstr "摧毀此元件及其所有子代,移除對應的 Tk 元件並刪除相關聯的 Tcl 指令。" #: ../../library/tkinter.rst:3188 msgid "" @@ -4461,14 +5093,16 @@ msgid "" "geometry managers. The concrete widget classes (:class:`Button`, :class:" "`Label`, and so on) derive from :class:`!Widget`." msgstr "" +"標準元件的內部基礎類別。它結合了 :class:`BaseWidget` 與佈局管理器的 mix-in 類" +"別 :class:`Pack`、:class:`Place` 和 :class:`Grid`,使得每個元件都能由這三種佈" +"局管理器中的任何一種來管理。具體的元件類別(:class:`Button`、:class:`Label` " +"等)皆衍生自 :class:`!Widget`。" #: ../../library/tkinter.rst:3197 -#, fuzzy msgid "Toplevel widgets" -msgstr "事件(元件)" +msgstr "頂層元件" #: ../../library/tkinter.rst:3201 -#, fuzzy msgid "" "Construct a toplevel Tk widget, which is usually the main window of an " "application, and initialize a Tcl interpreter for this widget. Each " @@ -4476,13 +5110,15 @@ msgid "" "and :class:`Wm`." msgstr "" "建構一個頂層 Tk 元件,它通常是應用程式的主視窗,並為此元件初始化一個 Tcl 直譯" -"器。每個實例都有其自己關聯的 Tcl 直譯器。" +"器。每個實例都有其自己關聯的 Tcl 直譯器。繼承自 :class:`Misc` 和 :class:" +"`Wm`。" #: ../../library/tkinter.rst:3206 msgid "" "To create a Tcl interpreter without initializing the Tk subsystem, use the :" "func:`Tcl` factory function instead." msgstr "" +"若要建立一個不初始化 Tk 子系統的 Tcl 直譯器,請改用 :func:`Tcl` 工廠函式。" #: ../../library/tkinter.rst:3209 msgid "" @@ -4594,6 +5230,10 @@ msgid "" "`USERPROFILE`, or ``c:\\``). This is done by Tcl and can affect other code " "that reads :envvar:`HOME`." msgstr "" +"在 Windows 上,建立 Tcl 直譯器(透過實例化 :class:`Tk` 或呼叫 :func:`Tcl`)" +"時,若處理程序的 :envvar:`HOME` 環境變數尚未設定,則會將其設定為 " +"``%HOMEDRIVE%%HOMEPATH%``\\ (或 :envvar:`USERPROFILE`,或 ``c:\\``)。這是" +"由 Tcl 所執行的操作,可能會影響其他讀取 :envvar:`HOME` 的程式碼。" #: ../../library/tkinter.rst:3254 msgid "" @@ -4633,6 +5273,7 @@ msgid "" "Destroy this and all descendant widgets and, for the main window, end the " "connection to the underlying Tcl interpreter." msgstr "" +"摧毀此元件及所有子代元件,並且對於主視窗而言,會結束與底層 Tcl 直譯器的連線。" #: ../../library/tkinter.rst:3284 msgid "" @@ -4640,6 +5281,8 @@ msgid "" "the interpreter was created without Tk (for example through :func:`Tcl`); it " "is called automatically when *useTk* is true." msgstr "" +"完成 Tk 子系統的載入與初始化。僅當直譯器是在未載入 Tk 的情況下建立時(例如透" +"過 :func:`Tcl`)才需要此操作;當 *useTk* 為 true 時,會自動呼叫此方法。" #: ../../library/tkinter.rst:3291 msgid "" @@ -4661,6 +5304,10 @@ msgid "" "overridden to customize error handling, for example to display the traceback " "in a dialog." msgstr "" +"回報一個回呼例外。當例外從 Tkinter 回呼中傳播出來時,會呼叫此方法;*exc*、" +"*val* 和 *tb* 分別是 :func:`sys.exc_info` 所回傳的例外類型、值和回溯資訊。預" +"設實作會將回溯資訊印到 :data:`sys.stderr`。可以覆寫此方法以自訂錯誤處理方式," +"例如在對話方塊中顯示回溯資訊。" #: ../../library/tkinter.rst:3310 msgid "" @@ -4674,10 +5321,16 @@ msgid "" "manager. Refer to the Tk ``toplevel`` manual page for the full list of " "options." msgstr "" +":class:`!Toplevel` 元件是一個頂層視窗,類似於 :class:`Frame`,但差異在於其 X " +"parent 是螢幕的根視窗,而非其邏輯上的 parent。它主要的用途是作為對話方塊與其" +"他元件集合的容器;其唯一可見的特徵是背景以及可選的立體邊框。值得注意的選項包" +"括 *menu*,用於安裝一個 :class:`Menu` 作為視窗的選單列。繼承自 :class:" +"`BaseWidget` 和 :class:`Wm`,因此頂層視窗會由視窗管理器所管理。完整的選項清單" +"請參閱 Tk ``toplevel`` 手冊頁面。" #: ../../library/tkinter.rst:3324 msgid "Widget classes" -msgstr "" +msgstr "元件類別" #: ../../library/tkinter.rst:3328 msgid "" @@ -4689,6 +5342,11 @@ msgid "" "as *command* (the callback invoked when the button is pressed), " "*textvariable*, *state* and *default*." msgstr "" +":class:`!Button` 元件會顯示文字字串、點陣圖或影像,並在使用者按下它時(透過在" +"按鈕上按下滑鼠按鍵 1,或者當按鈕擁有焦點時按下空白鍵)呼叫一個命令。繼承自 :" +"class:`Widget`。除了標準元件選項之外,按鈕還接受 Tk ``button`` 手冊頁面中所記" +"載的選項,例如 *command*\\ (按下按鈕時所呼叫的回呼函式)、*textvariable*、" +"*state* 和 *default*。" #: ../../library/tkinter.rst:3338 msgid "" @@ -4696,6 +5354,8 @@ msgid "" "its result, or an empty string if no command is associated with the button. " "This is ignored if the button's state is ``disabled``." msgstr "" +"呼叫與按鈕相關聯的命令(如果有的話),並回傳其結果;若沒有與按鈕相關聯的命" +"令,則回傳空字串。若按鈕的狀態為 ``disabled``,則會忽略此操作。" #: ../../library/tkinter.rst:3345 msgid "" @@ -4704,6 +5364,9 @@ msgid "" "same normal or active state as when the method was called. This is ignored " "if the button's state is ``disabled``." msgstr "" +"讓按鈕閃爍:重複顯示按鈕數次,在 active 顏色與 normal 顏色之間交替。閃爍結束" +"後,按鈕會保持在呼叫此方法時所處的 normal 或 active 狀態。若按鈕的狀態為 " +"``disabled``,則會忽略此操作。" #: ../../library/tkinter.rst:3354 msgid "" @@ -4715,6 +5378,12 @@ msgid "" "meth:`~XView.xview` and :meth:`~YView.yview`. Refer to the Tk ``canvas`` " "manual page for the full list of widget and item options." msgstr "" +":class:`!Canvas` 元件實作結構化繪圖。它可以顯示任意數量的\\ *項目*,例如弧" +"形、線條、橢圓形、多邊形、矩形、文字、點陣圖、影像和嵌入的視窗,這些項目可以" +"被繪製、移動、重新著色,並繫結到事件。繼承自 :class:`Widget`、:class:`XView` " +"和 :class:`YView`,因此可以使用 :meth:`~XView.xview` 和 :meth:`~YView.yview` " +"對視圖進行水平和垂直捲動。完整的元件與項目選項清單請參閱 Tk ``canvas`` 手冊頁" +"面。" #: ../../library/tkinter.rst:3364 msgid "" @@ -4731,6 +5400,14 @@ msgid "" "*tagOrId* matching several items, it normally uses the lowest matching item " "in the display list." msgstr "" +"每個項目都有一個在建立時指定的唯一整數 *id*,以及零個或多個字串 *tags*(標" +"籤)。標籤是一個不具整數形式的任意字串;相同的標籤可以由多個項目共用,這使得" +"標籤便於將項目分組。特殊標籤 ``'all'`` 會比對畫布中的每個項目,而 " +"``'current'`` 會比對滑鼠指標下方最頂層的項目。大多數方法都接受一個 *tagOrId* " +"引數,它可以是指定單一項目的整數 id,或是指定零個或多個項目的標籤;如 Tk " +"``canvas`` 手冊頁面所述,標籤也可以是由運算子 ``&&``、``||``、``^``、``!`` 及" +"括號組合而成的標籤邏輯運算式。當作用於單一項目的方法被賦予一個比對多個項目的 " +"*tagOrId* 時,通常會使用顯示清單中最低的相符項目。" #: ../../library/tkinter.rst:3379 msgid "" @@ -4739,6 +5416,9 @@ msgid "" "placed at the top of the list; the order can be changed with :meth:" "`tag_raise` and :meth:`tag_lower`." msgstr "" +"這些項目被保存在一個決定繪製順序的\\ *顯示清單*\\ 中:清單中較後面的項目會被" +"繪製在較前面的項目之上。新建立的項目會被放置在清單的最上方;可以使用 :meth:" +"`tag_raise` 和 :meth:`tag_lower` 來變更順序。" #: ../../library/tkinter.rst:3394 msgid "" @@ -4752,6 +5432,12 @@ msgid "" "centimetres, inches or printer's points), but are always stored and returned " "in pixels." msgstr "" +"建立一個對應類型的新項目並回傳其整數 id。每個方法都以 " +"``create_TYPE(coord..., **options)`` 的形式呼叫:前面的位置引數提供定義該項目" +"的座標(可以是各自獨立的數字、單一數字序列,或座標對),而關鍵字引數則設定該" +"項目特有的選項。座標與螢幕距離可以用數字表示(會被解讀為像素),也可以用帶有" +"單位後綴的字串表示(``'m'``、``'c'``、``'i'`` 或 ``'p'``,分別代表毫米、公" +"分、英寸或印刷的點),但一律以像素儲存並回傳。" #: ../../library/tkinter.rst:3404 msgid "" @@ -4767,6 +5453,14 @@ msgid "" "widget embedded in the canvas at a point ``x, y``, specified with the " "*window* option)." msgstr "" +"項目類型有:``arc``\\ (弧形,是橢圓的一部分,由外接矩形兩個對角的角 ``x1, " +"y1, x2, y2`` 定義);``bitmap``\\ (定位於點 ``x, y`` 的雙色點陣圖);" +"``image``\\ (定位於點 ``x, y`` 的 Tk 影像);``line``\\ (通過點 ``x1, " +"y1, ..., xn, yn`` 的線條或曲線);``oval``\\ (內接於矩形 ``x1, y1, x2, y2`` " +"的圓形或橢圓形);``polygon``\\ (通過點 ``x1, y1, ..., xn, yn`` 的封閉多邊" +"形);``rectangle``\\ (角為 ``x1, y1, x2, y2`` 的矩形);``text``\\ (定位於" +"點 ``x, y`` 的文字字串);以及 ``window``\\ (以 *window* 選項指定、嵌入畫布" +"中點 ``x, y`` 的子元件)。" #: ../../library/tkinter.rst:3416 msgid "" @@ -4774,10 +5468,12 @@ msgid "" "options specific to each type. Option names are passed as keyword arguments, " "without the leading hyphen." msgstr "" +"大多數項目類型都接受一組共通的\\ *標準項目選項*,再加上少數幾個每種類型特有的" +"選項。選項名稱以關鍵字引數的形式傳遞,不含開頭的連字號。" #: ../../library/tkinter.rst:3421 msgid "The standard item options are:" -msgstr "" +msgstr "標準項目選項如下:" #: ../../library/tkinter.rst:3424 msgid "" @@ -4785,15 +5481,17 @@ msgid "" "characters of a *text* item. An empty string (the default for all types " "except *line* and *text*) leaves the item unfilled." msgstr "" +"用於填滿項目內部的顏色,或用於繪製 *line* 項目或 *text* 項目的字元。空字串" +"(除 *line* 和 *text* 外,其他所有類型的預設值)會使項目保持未填滿的狀態。" #: ../../library/tkinter.rst:3429 msgid "*outline*" -msgstr "" +msgstr "*outline*" #: ../../library/tkinter.rst:3430 msgid "" "The color used to draw the item's outline. An empty string draws no outline." -msgstr "" +msgstr "用於繪製項目外框的顏色。空字串則不繪製外框。" #: ../../library/tkinter.rst:3433 ../../library/tkinter.rst:3537 msgid "*width*" @@ -4803,11 +5501,11 @@ msgstr "*width*" msgid "" "The width of the outline, defaulting to ``1.0``. Has no effect if *outline* " "is empty." -msgstr "" +msgstr "外框的寬度,預設為 ``1.0``。若 *outline* 為空,則此選項無效。" #: ../../library/tkinter.rst:3437 msgid "*dash*" -msgstr "" +msgstr "*dash*" #: ../../library/tkinter.rst:3438 msgid "" @@ -4816,40 +5514,45 @@ msgid "" "``'-'``, ``'_'`` and space. An empty pattern (the default) draws a solid " "outline." msgstr "" +"外框的虛線圖樣,可以用以像素為單位的線段長度序列給定,也可以用由字元 " +"``'.'``、``','``、``'-'``、``'_'`` 和空格組成的字串給定。空圖樣(預設值)會繪" +"製實線外框。" #: ../../library/tkinter.rst:3443 msgid "*dashoffset*" -msgstr "" +msgstr "*dashoffset*" #: ../../library/tkinter.rst:3444 msgid "" "The starting offset in pixels into the *dash* pattern. Ignored if there is " "no *dash* pattern." msgstr "" +"進入 *dash* 圖樣的起始偏移量,以像素為單位。若沒有 *dash* 圖樣,則此選項會被" +"忽略。" #: ../../library/tkinter.rst:3447 msgid "*stipple*" -msgstr "" +msgstr "*stipple*" #: ../../library/tkinter.rst:3448 msgid "" "A bitmap used as a stipple pattern when filling the item. Only well " "supported on X11." -msgstr "" +msgstr "填滿項目時用作點狀圖樣的點陣圖。僅在 X11 上有良好的支援。" #: ../../library/tkinter.rst:3451 msgid "*outlinestipple*" -msgstr "" +msgstr "*outlinestipple*" #: ../../library/tkinter.rst:3452 msgid "" "A bitmap used as a stipple pattern when drawing the outline. Has no effect " "if *outline* is empty." -msgstr "" +msgstr "繪製外框時用作點狀圖樣的點陣圖。若 *outline* 為空,則此選項無效。" #: ../../library/tkinter.rst:3455 msgid "*offset*, *outlineoffset*" -msgstr "" +msgstr "*offset*, *outlineoffset*" #: ../../library/tkinter.rst:3456 msgid "" @@ -4857,6 +5560,8 @@ msgid "" "as a side such as ``'n'``, ``'se'`` or ``'center'``. Stipple offsets are " "only supported on X11." msgstr "" +"填色與外框點狀圖樣的偏移量,可以用 ``'x,y'`` 給定,也可以用方位表示,例如 " +"``'n'``、``'se'`` 或 ``'center'``。點狀圖樣的偏移量僅在 X11 上受支援。" #: ../../library/tkinter.rst:3460 ../../library/tkinter.rst:4410 msgid "*state*" @@ -4867,16 +5572,17 @@ msgid "" "Overrides the canvas state for this item; one of ``'normal'``, " "``'disabled'`` or ``'hidden'``." msgstr "" +"覆寫此項目的畫布狀態;為 ``'normal'``、``'disabled'`` 或 ``'hidden'`` 之一。" #: ../../library/tkinter.rst:3464 msgid "*tags*" -msgstr "" +msgstr "*tags*" #: ../../library/tkinter.rst:3465 msgid "" "A single tag or a sequence of tags to associate with the item, replacing any " "existing tags." -msgstr "" +msgstr "要與項目相關聯的單一標籤或標籤序列,會取代任何現有的標籤。" #: ../../library/tkinter.rst:3468 msgid "" @@ -4886,128 +5592,138 @@ msgid "" "item is the active item (under the mouse pointer) or is in the disabled " "state." msgstr "" +"其中許多選項都有 *active...* 和 *disabled...* 的變體(例如 *activefill*、" +"*disabledfill*、*activewidth*、*disableddash*、*activeoutline*、" +"*disabledstipple*),當項目是 active 項目(位於滑鼠指標下方)或處於 disabled " +"狀態時,會覆寫基本選項。" #: ../../library/tkinter.rst:3474 msgid "The following item types support additional options." -msgstr "" +msgstr "下列項目類型支援額外的選項。" #: ../../library/tkinter.rst:3476 msgid "For ``arc`` items:" -msgstr "" +msgstr "對於 ``arc`` 項目:" #: ../../library/tkinter.rst:3478 msgid "*start*" -msgstr "" +msgstr "*start*" #: ../../library/tkinter.rst:3479 msgid "" "The start of the arc's angular range, in degrees measured counter-clockwise " "from the 3-o'clock position." -msgstr "" +msgstr "弧形角度範圍的起點,以度為單位,從 3 點鐘方向逆時針測量。" #: ../../library/tkinter.rst:3482 msgid "*extent*" -msgstr "" +msgstr "*extent*" #: ../../library/tkinter.rst:3483 msgid "" "The size of the angular range, in degrees counter-clockwise from *start*." -msgstr "" +msgstr "角度範圍的大小,以度為單位,從 *start* 逆時針測量。" #: ../../library/tkinter.rst:3486 msgid "*style*" -msgstr "" +msgstr "*style*" #: ../../library/tkinter.rst:3487 msgid "" "How the arc is drawn: ``'pieslice'`` (the default), ``'chord'`` or ``'arc'``." -msgstr "" +msgstr "弧形的繪製方式:``'pieslice'``\\ (預設)、``'chord'`` 或 ``'arc'``。" #: ../../library/tkinter.rst:3490 msgid "For ``line`` items:" -msgstr "" +msgstr "對於 ``line`` 項目:" #: ../../library/tkinter.rst:3492 msgid "*arrow*" -msgstr "" +msgstr "*arrow*" #: ../../library/tkinter.rst:3493 msgid "" "Where to draw arrowheads: ``'none'`` (the default), ``'first'``, ``'last'`` " "or ``'both'``." msgstr "" +"箭頭繪製的位置:``'none'``\\ (預設)、``'first'``、``'last'`` 或 " +"``'both'``。" #: ../../library/tkinter.rst:3496 msgid "*arrowshape*" -msgstr "" +msgstr "*arrowshape*" #: ../../library/tkinter.rst:3497 msgid "A sequence of three distances describing the shape of the arrowheads." -msgstr "" +msgstr "由三個距離組成的序列,用以描述箭頭的形狀。" #: ../../library/tkinter.rst:3500 msgid "*capstyle*" -msgstr "" +msgstr "*capstyle*" #: ../../library/tkinter.rst:3501 msgid "" "How line ends are drawn: ``'butt'`` (the default), ``'projecting'`` or " "``'round'``." msgstr "" +"線條端點的繪製方式:``'butt'``\\ (預設)、``'projecting'`` 或 ``'round'``。" #: ../../library/tkinter.rst:3504 msgid "*joinstyle*" -msgstr "" +msgstr "*joinstyle*" #: ../../library/tkinter.rst:3505 msgid "" "How line vertices are drawn: ``'round'`` (the default), ``'bevel'`` or " "``'miter'``." msgstr "" +"線條頂點的繪製方式:``'round'``\\ (預設)、``'bevel'`` 或 ``'miter'``。" #: ../../library/tkinter.rst:3508 msgid "*smooth*" -msgstr "" +msgstr "*smooth*" #: ../../library/tkinter.rst:3509 msgid "" "The smoothing method: a false value (the default) for no smoothing, or " "``'true'``/``'bezier'`` or ``'raw'`` to draw the line as a curve." msgstr "" +"平滑方法:假值(預設)表示不平滑,或使用 ``'true'``/``'bezier'`` 或 " +"``'raw'`` 將線條繪製為曲線。" #: ../../library/tkinter.rst:3512 msgid "*splinesteps*" -msgstr "" +msgstr "*splinesteps*" #: ../../library/tkinter.rst:3513 msgid "" "The number of line segments approximating each spline when *smooth* is " "enabled." -msgstr "" +msgstr "當 *smooth* 啟用時,用以近似每個雲形線的線段數量。" #: ../../library/tkinter.rst:3516 msgid "For ``polygon`` items:" -msgstr "" +msgstr "對於 ``polygon`` 項目:" #: ../../library/tkinter.rst:3518 msgid "*joinstyle*, *smooth*, *splinesteps*" -msgstr "" +msgstr "*joinstyle*, *smooth*, *splinesteps*" #: ../../library/tkinter.rst:3519 msgid "As for ``line`` items, applied to the polygon's outline." -msgstr "" +msgstr "與 ``line`` 項目相同,套用於多邊形的外框。" #: ../../library/tkinter.rst:3521 msgid "For ``text`` items:" -msgstr "" +msgstr "對於 ``text`` 項目:" #: ../../library/tkinter.rst:3523 msgid "*text*" -msgstr "" +msgstr "*text*" #: ../../library/tkinter.rst:3524 msgid "The string to display; newline characters start new lines." -msgstr "" +msgstr "要顯示的字串;換行字元會開始新的一行。" #: ../../library/tkinter.rst:3526 ../../library/tkinter.rst:4424 #: ../../library/tkinter.rst:5308 @@ -5016,7 +5732,7 @@ msgstr "*font*" #: ../../library/tkinter.rst:3527 msgid "The font used for the text." -msgstr "" +msgstr "文字所使用的字型。" #: ../../library/tkinter.rst:3529 ../../library/tkinter.rst:5348 msgid "*justify*" @@ -5031,34 +5747,36 @@ msgstr "對齊方式:``'left'``\\ (預設)、``'right'`` 或 ``'center'`` #: ../../library/tkinter.rst:3534 msgid "" "How the text is positioned relative to its point, defaulting to ``'center'``." -msgstr "" +msgstr "文字相對於其定位點的位置,預設為 ``'center'``。" #: ../../library/tkinter.rst:3538 msgid "The maximum line length; if non-zero, lines are wrapped at spaces." -msgstr "" +msgstr "每行的最大長度;若非零,則會在空格處換行。" #: ../../library/tkinter.rst:3540 msgid "*angle*" -msgstr "" +msgstr "*angle*" #: ../../library/tkinter.rst:3541 msgid "" "How many degrees to rotate the text counter-clockwise about its positioning " "point, from ``0.0`` to ``360.0`` (default ``0.0``)." msgstr "" +"文字要繞著其定位點逆時針旋轉的角度,範圍從 ``0.0`` 到 ``360.0``\\ (預設為 " +"``0.0``)。" #: ../../library/tkinter.rst:3544 ../../library/tkinter.rst:4406 #: ../../library/tkinter.rst:5333 msgid "*underline*" -msgstr "" +msgstr "*underline*" #: ../../library/tkinter.rst:3545 msgid "The index of a character to underline, or ``-1`` for none." -msgstr "" +msgstr "要加底線的字元索引,或 ``-1`` 表示不加底線。" #: ../../library/tkinter.rst:3547 msgid "For ``bitmap`` items:" -msgstr "" +msgstr "對於 ``bitmap`` 項目:" #: ../../library/tkinter.rst:3549 ../../library/tkinter.rst:4421 msgid "*bitmap*" @@ -5066,15 +5784,15 @@ msgstr "*bitmap*" #: ../../library/tkinter.rst:3550 msgid "The bitmap to display." -msgstr "" +msgstr "要顯示的點陣圖。" #: ../../library/tkinter.rst:3553 msgid "How the bitmap is positioned relative to its point." -msgstr "" +msgstr "點陣圖相對於其定位點的位置。" #: ../../library/tkinter.rst:3555 ../../library/tkinter.rst:4427 msgid "*background*, *foreground*" -msgstr "" +msgstr "*background*, *foreground*" #: ../../library/tkinter.rst:3556 msgid "" @@ -5083,10 +5801,13 @@ msgid "" "*disabled...* variants, and *bitmap* has *activebitmap* and *disabledbitmap* " "variants." msgstr "" +"用於點陣圖 ``0`` 和 ``1`` 像素的顏色;若 *background* 為空,則 ``0`` 像素會變" +"成透明。這兩者都有 *active...* 和 *disabled...* 的變體,而 *bitmap* 則有 " +"*activebitmap* 和 *disabledbitmap* 的變體。" #: ../../library/tkinter.rst:3561 msgid "For ``image`` items:" -msgstr "" +msgstr "對於 ``image`` 項目:" #: ../../library/tkinter.rst:3563 ../../library/tkinter.rst:4413 msgid "*image*" @@ -5094,53 +5815,58 @@ msgstr "*image*" #: ../../library/tkinter.rst:3564 msgid "The Tk image to display, previously created with the image protocols." -msgstr "" +msgstr "要顯示的 Tk 影像,須事先使用影像協定建立。" #: ../../library/tkinter.rst:3568 msgid "How the image is positioned relative to its point." -msgstr "" +msgstr "影像相對於其定位點的位置。" #: ../../library/tkinter.rst:3570 msgid "" "Both options have *active...* and *disabled...* variants (*activeimage*, " "*disabledimage*) used in the active and disabled states." msgstr "" +"這兩個選項都有 *active...* 和 *disabled...* 的變體(*activeimage*、" +"*disabledimage*),用於 active 和 disabled 狀態。" #: ../../library/tkinter.rst:3574 msgid "For ``window`` items:" -msgstr "" +msgstr "對於 ``window`` 項目:" #: ../../library/tkinter.rst:3576 msgid "*window*" -msgstr "" +msgstr "*window*" #: ../../library/tkinter.rst:3577 msgid "" "The widget to embed; it must be a child of the canvas or of one of its " "ancestors, and may not be a top-level window." -msgstr "" +msgstr "要嵌入的元件;它必須是畫布或其某個祖先的子代,且不可為頂層視窗。" #: ../../library/tkinter.rst:3581 msgid "How the window is positioned relative to its point." -msgstr "" +msgstr "視窗相對於其定位點的位置。" #: ../../library/tkinter.rst:3584 msgid "" "The size to assign to the window; if zero (the default), the window is given " "its requested size." -msgstr "" +msgstr "要指定給視窗的大小;若為零(預設值),則視窗會使用其所要求的大小。" #: ../../library/tkinter.rst:3587 msgid "" "``oval`` and ``rectangle`` items have no type-specific options; they use " "only the standard item options." msgstr "" +"``oval`` 和 ``rectangle`` 項目沒有類型特有的選項;它們只使用標準項目選項。" #: ../../library/tkinter.rst:3592 msgid "" "Tk 8.6 added the *angle* option and Tk 9.0 added the *underline* option for " "``text`` items." msgstr "" +"Tk 8.6 為 ``text`` 項目新增了 *angle* 選項,Tk 9.0 則新增了 *underline* 選" +"項。" #: ../../library/tkinter.rst:3599 msgid "" @@ -5153,6 +5879,11 @@ msgid "" "of the units used to specify them; for rectangles, ovals and arcs they are " "ordered left, top, right, bottom." msgstr "" +"查詢或修改項目的座標。若只給定 *tagOrId*,則回傳由 *tagOrId* 所指定項目(若比" +"對到多個項目,則為第一個相符的項目)的浮點數座標串列。若給定新的座標,則會以" +"這些座標取代該項目的座標;與 ``create_*`` 方法相同,座標可以用各自獨立的數" +"字、單一序列,或座標對來給定。回傳的座標一律以像素表示,不論指定時所使用的單" +"位為何;對於矩形、橢圓形和弧形,座標的順序為左、上、右、下。" #: ../../library/tkinter.rst:3610 msgid "" @@ -5160,6 +5891,8 @@ msgid "" "arguments, as a single sequence, or grouped in pairs, like the ``create_*`` " "methods." msgstr "" +"現在引數會被扁平化:座標可以用各自獨立的引數、單一序列,或成對分組來給定,與 " +"``create_*`` 方法相同。" #: ../../library/tkinter.rst:3618 msgid "" @@ -5167,6 +5900,8 @@ msgid "" "adding *xAmount* to every x-coordinate and *yAmount* to every y-coordinate " "of the item." msgstr "" +"在畫布座標空間中移動由 *tagOrId* 指定的每個項目:將 *xAmount* 加到項目的每個 " +"x 座標,並將 *yAmount* 加到每個 y 座標。" #: ../../library/tkinter.rst:3624 msgid "" @@ -5176,6 +5911,9 @@ msgid "" "corresponding coordinate is unchanged. All matching items keep their " "positions relative to each other." msgstr "" +"移動由 *tagOrId* 指定的項目,使最低相符項目的第一個座標對(邊界框的左上角)位" +"於位置 (*x*, *y*)。*x* 或 *y* 可以是空字串,此時對應的座標維持不變。所有相符" +"的項目會保持彼此的相對位置。" #: ../../library/tkinter.rst:3636 msgid "" @@ -5185,10 +5923,14 @@ msgid "" "from *yOrigin* changes by a factor of *yScale* (a factor of ``1.0`` leaves " "the coordinate unchanged)." msgstr "" +"在畫布座標空間中,重新縮放由 *tagOrId* 指定的所有項目的座標。每個 x 座標都會" +"被調整,使其與 *xOrigin* 的距離按 *xScale* 的倍率變化;每個 y 座標則會被調" +"整,使其與 *yOrigin* 的距離按 *yScale* 的倍率變化(倍率為 ``1.0`` 時座標維持" +"不變)。" #: ../../library/tkinter.rst:3645 msgid "Delete each of the items given by the *tagOrIds* arguments." -msgstr "" +msgstr "刪除由 *tagOrIds* 引數指定的每個項目。" #: ../../library/tkinter.rst:3650 msgid "" @@ -5197,6 +5939,9 @@ msgid "" "to *last* inclusive; *last* defaults to *first*. Items that do not support " "indexing ignore this operation." msgstr "" +"從由 *tagOrId* 指定的每個項目中,刪除從 *first* 到 *last*(含)範圍內的字元" +"(對 text 項目而言)或座標(對 line 和 polygon 項目而言);*last* 預設為 " +"*first*。不支援索引的項目會忽略此操作。" #: ../../library/tkinter.rst:3657 msgid "" @@ -5204,6 +5949,8 @@ msgid "" "character or coordinate whose index is *beforeThis*. For line and polygon " "items *string* must be a valid sequence of coordinates." msgstr "" +"將 *string* 插入由 *tagOrId* 指定的每個項目中,插在索引為 *beforeThis* 的字元" +"或座標之前。對於 line 和 polygon 項目,*string* 必須是有效的座標序列。" #: ../../library/tkinter.rst:3664 msgid "" @@ -5211,6 +5958,8 @@ msgid "" "given by *tagOrId* (the lowest matching item if it matches several). This is " "like :meth:`~Misc.cget` but applies to an individual item." msgstr "" +"回傳由 *tagOrId* 指定項目(若比對到多個項目,則為最低的相符項目)的設定選項 " +"*option* 目前的值。這類似於 :meth:`~Misc.cget`,但適用於單一項目。" #: ../../library/tkinter.rst:3673 msgid "" @@ -5222,6 +5971,11 @@ msgid "" "options are those accepted by the corresponding ``create_*`` method. :meth:" "`itemconfig` is an alias of :meth:`!itemconfigure`." msgstr "" +"查詢或修改由 *tagOrId* 指定項目的設定選項。這與 :meth:`~Misc.configure` 類" +"似,差別在於它適用於個別項目,而非整個畫布。若不帶選項,則回傳一個描述第一個" +"相符項目目前選項的字典;否則會將給定的選項設定到每個相符的項目上。合法的選項" +"為對應的 ``create_*`` 方法所接受的選項。:meth:`itemconfig` 是 :meth:`!" +"itemconfigure` 的別名。" #: ../../library/tkinter.rst:3686 msgid "" @@ -5229,6 +5983,9 @@ msgid "" "it matches several), such as ``'rectangle'`` or ``'text'``, or ``None`` if " "*tagOrId* does not match any item." msgstr "" +"回傳由 *tagOrId* 指定項目(若比對到多個項目,則為第一個相符的項目)的類型,例" +"如 ``'rectangle'`` 或 ``'text'``;若 *tagOrId* 未比對到任何項目,則回傳 " +"``None``。" #: ../../library/tkinter.rst:3692 msgid "" @@ -5236,12 +5993,16 @@ msgid "" "first matching item in display-list order if it matches several). Return an " "empty tuple if no item matches or the item has no tags." msgstr "" +"回傳與由 *tagOrId* 指定項目相關聯的標籤元組(若比對到多個項目,則依顯示清單順" +"序取第一個相符的項目)。若沒有項目相符,或該項目沒有標籤,則回傳空元組。" #: ../../library/tkinter.rst:3699 msgid "" "Remove the tag *tagToDelete* (which defaults to *tagOrId*) from each of the " "items given by *tagOrId*. Items that do not have that tag are unaffected." msgstr "" +"從 *tagOrId* 所指定的每個項目中移除標籤 *tagToDelete*(預設為 *tagOrId*)。沒" +"有該標籤的項目不受影響。" #: ../../library/tkinter.rst:3705 msgid "" @@ -5251,22 +6012,26 @@ msgid "" "``'withtag'``; the ``addtag_*`` methods below are convenient wrappers that " "supply each of these forms." msgstr "" +"將標籤 *newtag* 加入到搜尋規範 *searchSpec*(以及任何額外的 *args*)所選取的" +"每個項目。*searchSpec* 為 ``'above'``、``'all'``、``'below'``、" +"``'closest'``、``'enclosed'``、``'overlapping'`` 或 ``'withtag'`` 之一;下方" +"的 ``addtag_*`` 方法是提供這些形式的便利包裝函式。" #: ../../library/tkinter.rst:3714 msgid "" "Add the tag *newtag* to the item just above (after) *tagOrId* in the display " "list." -msgstr "" +msgstr "將標籤 *newtag* 加入到顯示清單中緊接在 *tagOrId* 之上(之後)的項目。" #: ../../library/tkinter.rst:3719 msgid "Add the tag *newtag* to all items in the canvas." -msgstr "" +msgstr "將標籤 *newtag* 加入到畫布中的所有項目。" #: ../../library/tkinter.rst:3723 msgid "" "Add the tag *newtag* to the item just below (before) *tagOrId* in the " "display list." -msgstr "" +msgstr "將標籤 *newtag* 加入到顯示清單中緊接在 *tagOrId* 之下(之前)的項目。" #: ../../library/tkinter.rst:3728 msgid "" @@ -5276,22 +6041,30 @@ msgid "" "closest item that lies below *start* in the display list, which can be used " "to step through all the closest items." msgstr "" +"將標籤 *newtag* 加入到最接近點 (*x*, *y*) 的項目。若有給定 *halo*,則該點該距" +"離內的任何項目都會被視為與其重疊。若有給定 *start*(一個標籤或 id),則選擇顯" +"示清單中位於 *start* 之下、最接近該點的最上層項目,這可用於依序走訪所有最接近" +"的項目。" #: ../../library/tkinter.rst:3737 msgid "" "Add the tag *newtag* to every item completely enclosed within the rectangle " "(*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." msgstr "" +"將標籤 *newtag* 加入到完全被包圍在矩形 (*x1*, *y1*, *x2*, *y2*) 內的每個項" +"目,其中 *x1* <= *x2* 且 *y1* <= *y2*。" #: ../../library/tkinter.rst:3742 msgid "" "Add the tag *newtag* to every item that overlaps or is enclosed within the " "rectangle (*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." msgstr "" +"將標籤 *newtag* 加入到與矩形 (*x1*, *y1*, *x2*, *y2*) 重疊或被包圍在其中的每" +"個項目,其中 *x1* <= *x2* 且 *y1* <= *y2*。" #: ../../library/tkinter.rst:3748 msgid "Add the tag *newtag* to every item given by *tagOrId*." -msgstr "" +msgstr "將標籤 *newtag* 加入到 *tagOrId* 所指定的每個項目。" #: ../../library/tkinter.rst:3752 msgid "" @@ -5301,45 +6074,54 @@ msgid "" "`addtag`. The ``find_*`` methods below are more convenient wrappers around " "it." msgstr "" +"回傳一個包含由搜尋規範 *searchSpec*(以及任何額外的 *args*)所選取的所有項目" +"id 的元組,依堆疊順序排列,最下層的項目在前。搜尋規範可以是 :meth:`addtag` 所" +"接受的任一形式。下方的 ``find_*`` 方法是圍繞它的更方便的包裝函式。" #: ../../library/tkinter.rst:3760 msgid "" "Return a tuple containing the id of the item just above *tagOrId* in the " "display list." -msgstr "" +msgstr "回傳一個包含顯示清單中緊接在 *tagOrId* 之上的項目 id 的元組。" #: ../../library/tkinter.rst:3765 msgid "" "Return a tuple of the ids of all items in the canvas, in stacking order." -msgstr "" +msgstr "回傳一個包含畫布中所有項目 id 的元組,依堆疊順序排列。" #: ../../library/tkinter.rst:3769 msgid "" "Return a tuple containing the id of the item just below *tagOrId* in the " "display list." -msgstr "" +msgstr "回傳一個包含顯示清單中緊接在 *tagOrId* 之下的項目 id 的元組。" #: ../../library/tkinter.rst:3774 msgid "" "Return a tuple containing the id of the item closest to the point (*x*, " "*y*). *halo* and *start* are interpreted as for :meth:`addtag_closest`." msgstr "" +"回傳一個包含最接近點 (*x*, *y*) 的項目 id 的元組。*halo* 和 *start* 的解讀方" +"式與 :meth:`addtag_closest` 相同。" #: ../../library/tkinter.rst:3780 msgid "" "Return a tuple of the ids of all items completely enclosed within the " "rectangle (*x1*, *y1*, *x2*, *y2*)." msgstr "" +"回傳一個包含完全被包圍在矩形 (*x1*, *y1*, *x2*, *y2*) 內的所有項目 id 的元" +"組。" #: ../../library/tkinter.rst:3785 msgid "" "Return a tuple of the ids of all items that overlap or are enclosed within " "the rectangle (*x1*, *y1*, *x2*, *y2*)." msgstr "" +"回傳一個包含與矩形 (*x1*, *y1*, *x2*, *y2*) 重疊或被包圍在其中的所有項目 id " +"的元組。" #: ../../library/tkinter.rst:3790 msgid "Return a tuple of the ids of all items given by *tagOrId*." -msgstr "" +msgstr "回傳一個包含 *tagOrId* 所指定的所有項目 id 的元組。" #: ../../library/tkinter.rst:3800 msgid "" @@ -5350,6 +6132,11 @@ msgid "" "is controlled by :meth:`Misc.tkraise` and :meth:`Misc.lower` instead. :meth:" "`lift` and :meth:`tkraise` are aliases of :meth:`!tag_raise`." msgstr "" +"將 *tagOrId* 所指定的所有項目移動到顯示清單中緊接在 *aboveThis* 所指定項目之" +"上的新位置,若省略 *aboveThis* 則移動到顯示清單的最上層。當同時移動多個項目" +"時,會保留它們之間的相對順序。這對內嵌視窗項目沒有影響,其堆疊順序改由 :meth:" +"`Misc.tkraise` 和 :meth:`Misc.lower` 控制。:meth:`lift` 和 :meth:`tkraise` " +"是 :meth:`!tag_raise` 的別名。" #: ../../library/tkinter.rst:3813 msgid "" @@ -5359,6 +6146,10 @@ msgid "" "preserved. This has no effect on embedded window items. :meth:`lower` is an " "alias of :meth:`!tag_lower`." msgstr "" +"將 *tagOrId* 所指定的所有項目移動到顯示清單中緊接在 *belowThis* 所指定項目之" +"下的新位置,若省略 *belowThis* 則移動到顯示清單的最下層。當同時移動多個項目" +"時,會保留它們之間的相對順序。這對內嵌視窗項目沒有影響。:meth:`lower` 是 :" +"meth:`!tag_lower` 的別名。" #: ../../library/tkinter.rst:3822 msgid "" @@ -5367,6 +6158,10 @@ msgid "" "and :meth:`Misc.lower` methods that restack the widget itself, which are " "therefore not available." msgstr "" +"在 :class:`Canvas` 上,:meth:`tkraise`/:meth:`lift` 和 :meth:`lower` 會重新排" +"列畫布項目的堆疊順序,這遮蔽了繼承而來、用於重新排列元件本身堆疊順序的 :meth:" +"`Misc.tkraise`/:meth:`Misc.lift` 和 :meth:`Misc.lower` 方法,因此這些方法無法" +"使用。" #: ../../library/tkinter.rst:3830 msgid "" @@ -5380,6 +6175,12 @@ msgid "" "than replacing them. Return the identifier of the bound function, which can " "be passed to :meth:`tag_unbind`." msgstr "" +"將回呼函式 *func* 綁定到 *tagOrId* 所指定的所有項目的事件 *sequence*,使得每" +"當該事件發生在其中一個項目上時就會呼叫 *func*。這類似於 :meth:`Widget.bind " +"`,但作用於畫布項目而非整個元件;只能綁定滑鼠、鍵盤和虛擬事件。滑" +"鼠事件會導向目前項目,鍵盤事件則導向焦點項目(見 :meth:`focus`)。若 *add* 為" +"真,新的綁定會加入到同一事件序列的現有綁定中,而不是取代它們。回傳所綁定函式" +"的識別碼,可將其傳入 :meth:`tag_unbind`。" #: ../../library/tkinter.rst:3845 msgid "" @@ -5387,10 +6188,12 @@ msgid "" "*sequence*. If *funcid* is given, only that callback (as returned by :meth:" "`tag_bind`) is unbound and deregistered." msgstr "" +"為 *tagOrId* 所指定的所有項目移除事件 *sequence* 的綁定。若有給定 *funcid*," +"則只會解除綁定並取消註冊該回呼函式(由 :meth:`tag_bind` 回傳)。" #: ../../library/tkinter.rst:3850 ../../library/tkinter.rst:5454 msgid "If *funcid* is given, only that callback is unbound." -msgstr "" +msgstr "若有給定 *funcid*,則只會解除該回呼函式的綁定。" #: ../../library/tkinter.rst:3856 msgid "" @@ -5400,6 +6203,9 @@ msgid "" "pixels. Return ``None`` if no item matches or the matching items have " "nothing to display." msgstr "" +"回傳一個 4 元組 ``(x1, y1, x2, y2)``,以像素為單位給出包圍 *tagOrId* 及任何其" +"他 *tagOrIds* 所指定的所有項目的近似外框。結果可能會比實際外框多估計幾個像" +"素。若沒有項目匹配,或匹配的項目沒有任何內容可顯示,則回傳 ``None``。" #: ../../library/tkinter.rst:3863 ../../library/tkinter.rst:4256 #: ../../library/tkinter.rst:4997 ../../library/tkinter.rst:5224 @@ -5407,6 +6213,8 @@ msgid "" "This shadows the inherited :meth:`!Misc.bbox`; use :meth:`~Misc.grid_bbox` " "for the grid bounding box." msgstr "" +"這會遮蔽繼承的 :meth:`!Misc.bbox`;請使用 :meth:`~Misc.grid_bbox` 取得網格的" +"外框。" #: ../../library/tkinter.rst:3868 msgid "" @@ -5414,6 +6222,8 @@ msgid "" "displayed at that location. If *gridspacing* is given, the result is rounded " "to the nearest multiple of *gridspacing* units." msgstr "" +"給定一個視窗 x 座標 *screenx*,回傳該位置所顯示的畫布 x 座標。若有給定 " +"*gridspacing*,結果會被四捨五入到最接近的 *gridspacing* 單位倍數。" #: ../../library/tkinter.rst:3875 msgid "" @@ -5421,6 +6231,8 @@ msgid "" "displayed at that location. If *gridspacing* is given, the result is rounded " "to the nearest multiple of *gridspacing* units." msgstr "" +"給定一個視窗 y 座標 *screeny*,回傳該位置所顯示的畫布 y 座標。若有給定 " +"*gridspacing*,結果會被四捨五入到最接近的 *gridspacing* 單位倍數。" #: ../../library/tkinter.rst:3883 msgid "" @@ -5432,12 +6244,19 @@ msgid "" "displays the insertion cursor when both it is the focus item and its canvas " "has the input focus." msgstr "" +"若給定 *tagOrId*,將畫布的鍵盤焦點設定到 *tagOrId* 所指定、且支援插入游標的第" +"一個項目;若不存在這樣的項目,則焦點保持不變。若 *tagOrId* 為空字串,則重設焦" +"點,使得沒有任何項目擁有它。若未給定引數,則回傳目前擁有焦點的項目 id,若沒有" +"則回傳空字串。項目只有在它同時是焦點項目且其畫布擁有輸入焦點時,才會顯示插入" +"游標。" #: ../../library/tkinter.rst:3892 msgid "" "This shadows the inherited :meth:`!Misc.focus`; use :meth:`~Misc.focus_set` " "to focus the widget itself." msgstr "" +"這會遮蔽繼承的 :meth:`!Misc.focus`;請使用 :meth:`~Misc.focus_set` 來讓元件本" +"身取得焦點。" #: ../../library/tkinter.rst:3897 msgid "" @@ -5446,6 +6265,8 @@ msgid "" "are unaffected. The cursor is only displayed when the item has the focus, " "but its position may be set at any time." msgstr "" +"將 *tagOrId* 所指定項目的插入游標設定到 *index* 所指定字元之前。不支援插入游" +"標的項目不受影響。游標只有在項目擁有焦點時才會顯示,但其位置可隨時設定。" #: ../../library/tkinter.rst:3905 msgid "" @@ -5455,6 +6276,9 @@ msgid "" "coordinates). If *tagOrId* matches several items, the first one that " "supports indexing is used." msgstr "" +"以整數形式回傳 *tagOrId* 中對應於 *index* 的數字索引,*index* 是位置的文字描" +"述(對文字項目而言是字元的索引,對線條和多邊形項目而言是座標的索引)。若 " +"*tagOrId* 匹配多個項目,則使用第一個支援索引的項目。" #: ../../library/tkinter.rst:3914 msgid "" @@ -5463,10 +6287,13 @@ msgid "" "`select_to` calls. If the selection is not currently in *tagOrId*, this " "behaves like :meth:`select_to`." msgstr "" +"調整 *tagOrId* 中最接近 *index* 的選取範圍端點,使其位於 *index*,並將另一端" +"設為未來 :meth:`select_to` 呼叫的錨點。若目前 *tagOrId* 中沒有選取範圍,則其" +"行為與 :meth:`select_to` 相同。" #: ../../library/tkinter.rst:3922 msgid "Clear the selection if it is in this canvas; otherwise do nothing." -msgstr "" +msgstr "若選取範圍在此畫布中,則清除該選取範圍;否則不做任何事。" #: ../../library/tkinter.rst:3926 msgid "" @@ -5474,6 +6301,8 @@ msgid "" "in the item given by *tagOrId*. This does not change the selection itself; " "it sets the fixed end for future :meth:`select_to` calls." msgstr "" +"將選取錨點設定到 *tagOrId* 所指定項目中 *index* 所指定字元之前。這不會改變選" +"取範圍本身;它會設定未來 :meth:`select_to` 呼叫的固定端點。" #: ../../library/tkinter.rst:3933 msgid "" @@ -5481,6 +6310,8 @@ msgid "" "selection is not in this canvas. Unlike :meth:`find` and the ``find_*`` " "methods, this returns the id as a string rather than an integer." msgstr "" +"回傳持有選取範圍的項目 id,若此畫布中沒有選取範圍則回傳 ``None``。與 :meth:" +"`find` 及 ``find_*`` 方法不同,此方法回傳的 id 是字串而非整數。" #: ../../library/tkinter.rst:3940 msgid "" @@ -5488,6 +6319,9 @@ msgid "" "anchor point and *index*, inclusive of *index*. The anchor point is the one " "set by the most recent :meth:`select_adjust` or :meth:`select_from` call." msgstr "" +"將選取範圍設定為 *tagOrId* 中選取錨點與 *index* 之間(含 *index*)的字元。錨" +"點是由最近一次 :meth:`select_adjust` 或 :meth:`select_from` 呼叫所設定的錨" +"點。" #: ../../library/tkinter.rst:3947 ../../library/tkinter.rst:4352 #: ../../library/tkinter.rst:5578 @@ -5495,6 +6329,8 @@ msgid "" "Record *x*, *y* and the current view, for use with later :meth:`scan_dragto` " "calls. This is typically bound to a mouse button press in the widget." msgstr "" +"記錄 *x*、*y* 和目前的檢視,供之後的 :meth:`scan_dragto` 呼叫使用。這通常會綁" +"定到元件中的滑鼠按鍵按下事件。" #: ../../library/tkinter.rst:3953 msgid "" @@ -5503,6 +6339,9 @@ msgid "" "bound to mouse motion events in the widget, producing the effect of dragging " "the canvas at high speed through its window." msgstr "" +"將畫布捲動 *gain* 倍於 *x*、*y* 與上一次 :meth:`scan_mark` 呼叫所傳入座標之間" +"的差值。這通常會綁定到元件中的滑鼠移動事件,產生以高速在其視窗中拖曳畫布的效" +"果。" #: ../../library/tkinter.rst:3960 msgid "" @@ -5516,6 +6355,12 @@ msgid "" "*pageanchor*, *pageheight*, *pagewidth*, *pagex*, *pagey*, *rotate*, " "*width*, *x* and *y*." msgstr "" +"產生畫布全部或部分內容的 PostScript(Encapsulated PostScript,3.0 版)表示" +"法。若有給定 *file* 或 *channel* 選項,則會將 PostScript 寫入該處並回傳空字" +"串;否則會以字串形式回傳。預設情況下只會產生目前在視窗中可見的區域,因此通常" +"需要先呼叫 :meth:`~Misc.update`,或使用 *width* 和 *height* 選項。支援的選項" +"包括 *colormap*、*colormode*、*file*、*fontmap*、*height*、*pageanchor*、" +"*pageheight*、*pagewidth*、*pagex*、*pagey*、*rotate*、*width*、*x* 和 *y*。" #: ../../library/tkinter.rst:3975 msgid "" @@ -5529,6 +6374,12 @@ msgid "" "checkbutton accepts the options documented in the Tk ``checkbutton`` manual " "page, such as *variable*, *onvalue*, *offvalue* and *command*." msgstr "" +":class:`!Checkbutton`(核取按鈕)元件會顯示一個文字字串、點陣圖或圖片,並搭配" +"一個方形指示器,按下時會切換一個布林選取狀態。它具有簡單按鈕的所有行為,此外" +"還可以被選取:選取時指示器會繪製打勾標記,並將關聯的變數設為 ``onvalue``;取" +"消選取時指示器會繪製為空白,並將變數設為 ``offvalue``。繼承自 :class:" +"`Widget`。除了標準元件選項外,核取按鈕還接受 Tk ``checkbutton`` manual page " +"中所記載的選項,例如 *variable*、*onvalue*、*offvalue* 和 *command*。" #: ../../library/tkinter.rst:3989 msgid "" @@ -5538,22 +6389,25 @@ msgid "" "string if no command is associated with the checkbutton. This is ignored if " "the checkbutton's state is ``disabled``." msgstr "" +"執行使用者以滑鼠按下核取按鈕時會發生的行為:切換按鈕的選取狀態,並呼叫相關聯" +"的命令(如果有的話)。回傳該命令的結果,若核取按鈕沒有關聯的命令則回傳空字" +"串。若核取按鈕的狀態為 ``disabled``,則會忽略此方法。" #: ../../library/tkinter.rst:3998 msgid "" "Select the checkbutton and set the associated variable to its ``onvalue``." -msgstr "" +msgstr "選取核取按鈕,並將相關聯的變數設為其 ``onvalue``。" #: ../../library/tkinter.rst:4003 msgid "" "Deselect the checkbutton and set the associated variable to its ``offvalue``." -msgstr "" +msgstr "取消選取核取按鈕,並將相關聯的變數設為其 ``offvalue``。" #: ../../library/tkinter.rst:4008 msgid "" "Toggle the selection state of the button, redisplaying it and modifying its " "associated variable to reflect the new state." -msgstr "" +msgstr "切換按鈕的選取狀態,重新顯示按鈕,並修改相關聯的變數以反映新的狀態。" #: ../../library/tkinter.rst:4013 msgid "" @@ -5562,6 +6416,9 @@ msgid "" "left in the same normal or active state as when the method was called. This " "is ignored if the checkbutton's state is ``disabled``." msgstr "" +"透過多次重新顯示核取按鈕、在作用中和一般顏色之間交替來閃爍核取按鈕。閃爍結束" +"後,核取按鈕會保持呼叫此方法時原本的一般或作用中狀態。若核取按鈕的狀態為 " +"``disabled``,則會忽略此方法。" #: ../../library/tkinter.rst:4022 msgid "" @@ -5570,6 +6427,9 @@ msgid "" "hold strings too long to fit in the window, they support horizontal " "scrolling through :meth:`~XView.xview`." msgstr "" +":class:`!Entry`(輸入框)元件會顯示單行文字,並讓使用者編輯該文字。繼承自 :" +"class:`Widget` 和 :class:`XView`;由於輸入框中可能包含長度超過視窗的字串,因" +"此它們透過 :meth:`~XView.xview` 支援水平捲動。" #: ../../library/tkinter.rst:4028 msgid "" @@ -5581,6 +6441,11 @@ msgid "" "together let a callback accept or reject edits), and *state* (one of " "``'normal'``, ``'disabled'`` or ``'readonly'``)." msgstr "" +"除了標準元件選項外,輸入框還接受 Tk ``entry`` manual page 中所記載的選項。其" +"中值得注意的有 *textvariable*(與輸入框內容保持同步的變數名稱)、*show*(若有" +"設定,則每個字元都會以指定的字元顯示而非其真實值,適用於密碼輸入)、" +"*validate* 和 *validatecommand*(兩者共同讓回呼函式接受或拒絕編輯),以及 " +"*state*(``'normal'``、``'disabled'`` 或 ``'readonly'`` 之一)。" #: ../../library/tkinter.rst:4037 msgid "" @@ -5593,6 +6458,12 @@ msgid "" "x-coordinate *x* in the window). Out-of-range indices are rounded to the " "nearest legal value." msgstr "" +"下方許多方法都接受一個 *index* 引數,用於選擇輸入框字串中的一個字元。如 Tk " +"``entry`` manual page 所述,*index* 可以是一個數字(從 0 開始計數)、" +"``'insert'``\\ (插入游標之後的字元)、``'end'``\\ (最後一個字元之後)、" +"``'anchor'``\\ (選取錨點)、``'sel.first'`` 和 ``'sel.last'``\\ (選取範圍的" +"兩端),或 ``@x``\\ (覆蓋視窗中像素 x 座標 *x* 的字元)。超出範圍的索引會被" +"四捨五入到最接近的合法值。" #: ../../library/tkinter.rst:4049 msgid "" @@ -5600,24 +6471,26 @@ msgid "" "*last*. If *last* is omitted, only the single character at *first* is " "deleted." msgstr "" +"刪除從索引 *first* 開始、到但不包含索引 *last* 為止的字元。若省略 *last*,則" +"只刪除 *first* 處的單一字元。" #: ../../library/tkinter.rst:4055 msgid "Return the entry's current string." -msgstr "" +msgstr "回傳輸入框目前的字串。" #: ../../library/tkinter.rst:4059 msgid "Insert *string* just before the character given by *index*." -msgstr "" +msgstr "在 *index* 所指定的字元之前插入 *string*。" #: ../../library/tkinter.rst:4063 ../../library/tkinter.rst:4980 msgid "" "Arrange for the insertion cursor to be displayed just before the character " "given by *index*." -msgstr "" +msgstr "安排將插入游標顯示在 *index* 所指定的字元之前。" #: ../../library/tkinter.rst:4068 msgid "Return the numerical index corresponding to *index*." -msgstr "" +msgstr "回傳對應於 *index* 的數字索引。" #: ../../library/tkinter.rst:4075 msgid "" @@ -5628,6 +6501,10 @@ msgid "" "*index* and the most recent anchor point, inclusive. :meth:`select_adjust` " "is an alias of :meth:`!selection_adjust`." msgstr "" +"找出最接近 *index* 所指定字元的選取範圍端點,並將該端點調整到 *index*(包含但" +"不超過它);另一端則成為未來 :meth:`selection_to` 呼叫的錨點。若輸入框中沒有" +"選取範圍,則會在 *index* 與最近一次的錨點之間(含兩端)建立一個新的選取範" +"圍。:meth:`select_adjust` 是 :meth:`!selection_adjust` 的別名。" #: ../../library/tkinter.rst:4088 msgid "" @@ -5635,12 +6512,16 @@ msgid "" "not in this widget the method has no effect. :meth:`select_clear` is an " "alias of :meth:`!selection_clear`." msgstr "" +"若選取範圍目前在此元件中,則清除該選取範圍。若選取範圍不在此元件中,則此方法" +"沒有作用。:meth:`select_clear` 是 :meth:`!selection_clear` 的別名。" #: ../../library/tkinter.rst:4094 msgid "" "This shadows the inherited :meth:`Misc.selection_clear`, which clears the X " "selection; that method is not available on an :class:`Entry`." msgstr "" +"這會遮蔽繼承的 :meth:`Misc.selection_clear`(用於清除 X selection);此方法" +"在 :class:`Entry` 上不可用。" #: ../../library/tkinter.rst:4103 msgid "" @@ -5648,12 +6529,16 @@ msgid "" "*index*, without changing the selection. :meth:`select_from` is an alias of :" "meth:`!selection_from`." msgstr "" +"將選取錨點設定到 *index* 所指定字元之前,而不改變選取範圍。:meth:" +"`select_from` 是 :meth:`!selection_from` 的別名。" #: ../../library/tkinter.rst:4112 msgid "" "Return ``True`` if there are characters selected in the entry, ``False`` " "otherwise. :meth:`select_present` is an alias of :meth:`!selection_present`." msgstr "" +"若輸入框中有選取的字元則回傳 ``True``,否則回傳 ``False``。:meth:" +"`select_present` 是 :meth:`!selection_present` 的別名。" #: ../../library/tkinter.rst:4121 msgid "" @@ -5662,6 +6547,9 @@ msgid "" "same character as *start* or an earlier one, the selection is cleared. :meth:" "`select_range` is an alias of :meth:`!selection_range`." msgstr "" +"將選取範圍設定為包含從索引 *start* 開始、到 *end* 之前為止的字元。若 *end* 所" +"指的字元與 *start* 相同或在其之前,則會清除選取範圍。:meth:`select_range` " +"是 :meth:`!selection_range` 的別名。" #: ../../library/tkinter.rst:4132 msgid "" @@ -5673,6 +6561,12 @@ msgid "" "If there is no selection in the entry, a new one is created using the most " "recent anchor point. :meth:`select_to` is an alias of :meth:`!selection_to`." msgstr "" +"在錨點與 *index* 之間設定選取範圍:若 *index* 在錨點之前,則選取範圍從 " +"*index* 開始、到但不包含錨點為止;若 *index* 在錨點之後,則從錨點開始、到但不" +"包含 *index* 為止;若兩者重合,則不做任何事。錨點是由最近一次 :meth:" +"`selection_from` 或 :meth:`selection_adjust` 呼叫所設定的錨點。若輸入框中沒有" +"選取範圍,則會使用最近一次的錨點建立一個新的選取範圍。:meth:`select_to` 是 :" +"meth:`!selection_to` 的別名。" #: ../../library/tkinter.rst:4144 msgid "" @@ -5680,6 +6574,8 @@ msgid "" "meth:`scan_dragto` calls. Typically associated with a mouse button press in " "the widget." msgstr "" +"記錄 *x* 和輸入框視窗中目前的檢視,供之後的 :meth:`scan_dragto` 呼叫使用。通" +"常會與元件中的滑鼠按鍵按下事件相關聯。" #: ../../library/tkinter.rst:4150 msgid "" @@ -5688,6 +6584,9 @@ msgid "" "difference. Typically associated with mouse motion events, to produce the " "effect of dragging the entry at high speed through the window." msgstr "" +"計算 *x* 與上一次 :meth:`scan_mark` 呼叫所傳入 *x* 之間的差值,並將檢視向左或" +"向右調整該差值的 10 倍。通常會與滑鼠移動事件相關聯,以產生在視窗中高速拖曳輸" +"入框的效果。" #: ../../library/tkinter.rst:4159 msgid "" @@ -5697,6 +6596,10 @@ msgid "" "raised or sunken. Inherits from :class:`Widget`. Refer to the Tk ``frame`` " "manual page for the full list of options." msgstr "" +":class:`!Frame`(框架)元件是一個簡單的容器。它的主要用途是作為間隔物,或作為" +"複雜視窗版面配置的容器;它唯一的特色是其背景,以及可讓框架呈現凸起或凹陷外觀" +"的選擇性 3D 邊框。繼承自 :class:`Widget`。有關選項的完整清單,請參閱 Tk " +"``frame`` manual page。" #: ../../library/tkinter.rst:4169 msgid "" @@ -5708,6 +6611,11 @@ msgid "" "class:`Widget`. Refer to the Tk ``label`` manual page for the full list of " "options." msgstr "" +":class:`!Label`(標籤)元件會顯示不可互動的文字字串、點陣圖或圖片。顯示的文字" +"透過 *text* 選項設定,或透過 *textvariable* 連結到一個變數,圖片則可以使用 " +"*image* 選項顯示。文字都必須使用同一種字型,但可以佔用多行,並且可以使用 " +"*underline* 選項為一個字元加上底線。繼承自 :class:`Widget`。有關選項的完整清" +"單,請參閱 Tk ``label`` manual page。" #: ../../library/tkinter.rst:4181 msgid "" @@ -5718,6 +6626,10 @@ msgid "" "Inherits from :class:`Widget`. Refer to the Tk ``labelframe`` manual page " "for the full list of options." msgstr "" +":class:`!LabelFrame`(標籤框架)元件是一個容器,具有 :class:`Frame` 的特色," +"並能額外顯示一個標籤。標籤文字透過 *text* 選項設定,並透過 *labelanchor* 定" +"位;也可以將任意元件作為 *labelwidget* 選項的值,用作標籤。繼承自 :class:" +"`Widget`。有關選項的完整清單,請參閱 Tk ``labelframe`` manual page。" #: ../../library/tkinter.rst:4192 msgid "" @@ -5732,6 +6644,14 @@ msgid "" "and vertically with :meth:`~XView.xview` and :meth:`~YView.yview`. Refer to " "the Tk ``listbox`` manual page for the full list of options." msgstr "" +":class:`!Listbox`(清單方塊)元件會顯示一份單行文字項目的清單,每行一個項目," +"使用者可以選取其中一個或多個項目。選取的行為由 *selectmode* 選項決定,其值為 " +"``browse``\\ (預設值;最多一個項目,可用滑鼠拖曳)、``single``\\ (最多一個" +"項目)、``multiple``\\ (任意數量的項目,個別切換)或 ``extended``\\ (任意數" +"量的項目,包括不連續的範圍,透過點擊與拖曳選取)之一。繼承自 :class:" +"`Widget`、:class:`XView` 和 :class:`YView`,因此可以使用 :meth:`~XView." +"xview` 和 :meth:`~YView.yview` 水平與垂直捲動檢視。有關選項的完整清單,請參" +"閱 Tk ``listbox`` manual page。" #: ../../library/tkinter.rst:4204 msgid "" @@ -5744,6 +6664,13 @@ msgid "" "item covering pixel coordinates *x*, *y* in the listbox window). Arguments " "named *first* and *last* are indices of the same forms." msgstr "" +"許多方法都接受一個 *index* 引數,用於識別特定的項目。如 Tk ``listbox`` " +"manual page 所述,*index* 可以是一個數字索引(從頂部的 0 開始計數)、" +"``'active'``\\ (帶有定位游標的項目,由 :meth:`activate` 設定)、" +"``'anchor'``\\ (選取錨點,由 :meth:`selection_anchor` 設定)、``'end'``\\ " +"(最後一個項目,或對 :meth:`index` 和 :meth:`insert` 而言是緊接在其後的位" +"置),或 ``@x,y``\\ (清單方塊視窗中覆蓋像素座標 *x*、*y* 的項目)。名為 " +"*first* 和 *last* 的引數也是相同形式的索引。" #: ../../library/tkinter.rst:4215 msgid "" @@ -5751,12 +6678,16 @@ msgid "" "*index*. If *index* is ``'end'``, the new items are appended to the end of " "the list." msgstr "" +"將給定的 *elements* 作為新項目,插入到 *index* 所指定項目之前。若 *index* 為 " +"``'end'``,則新項目會附加到清單的末尾。" #: ../../library/tkinter.rst:4222 msgid "" "Delete the items in the range from *first* to *last* inclusive. If *last* is " "omitted, it defaults to *first*, so that a single item is deleted." msgstr "" +"刪除從 *first* 到 *last*(含兩端)範圍內的項目。若省略 *last*,則預設為 " +"*first*,因此只會刪除單一項目。" #: ../../library/tkinter.rst:4228 msgid "" @@ -5765,16 +6696,21 @@ msgid "" "given, return a tuple of all the items in the range from *first* to *last* " "inclusive." msgstr "" +"若省略 *last*,則回傳 *first* 所指定項目的內容,若 *first* 所指的項目不存在則" +"回傳空字串。若有給定 *last*,則回傳一個包含從 *first* 到 *last*(含兩端)範圍" +"內所有項目的元組。" #: ../../library/tkinter.rst:4235 msgid "Return the total number of items in the listbox." -msgstr "" +msgstr "回傳清單方塊中項目的總數。" #: ../../library/tkinter.rst:4237 msgid "" "This shadows the inherited :meth:`!Misc.size`; use :meth:`~Misc.grid_size` " "for the grid size." msgstr "" +"這會遮蔽繼承的 :meth:`!Misc.size`;請使用 :meth:`~Misc.grid_size` 取得網格大" +"小。" #: ../../library/tkinter.rst:4242 msgid "" @@ -5782,6 +6718,9 @@ msgid "" "*index* is out of range. If *index* is ``'end'``, the result is a count of " "the number of items in the listbox (not the index of the last item)." msgstr "" +"回傳對應於 *index* 的整數索引值,若 *index* 超出範圍則回傳 ``None``。若 " +"*index* 為 ``'end'``,則結果為清單方塊中項目的數量(而非最後一個項目的索" +"引)。" #: ../../library/tkinter.rst:4249 msgid "" @@ -5792,12 +6731,16 @@ msgid "" "the result still gives the full area of the item, including the parts that " "are not visible." msgstr "" +"回傳一個元組 ``(x, y, width, height)``,以相對於元件的像素描述 *index* 所指定" +"項目的文字外框。若該項目沒有任何部分在螢幕上可見,或 *index* 所指的項目不存" +"在,則回傳 ``None``;若該項目只有部分可見,結果仍會給出該項目的完整區域,包括" +"不可見的部分。" #: ../../library/tkinter.rst:4261 msgid "" "Given a y-coordinate within the listbox window, return the index of the " "visible item nearest to that y-coordinate." -msgstr "" +msgstr "給定清單方塊視窗中的一個 y 座標,回傳最接近該 y 座標的可見項目索引。" #: ../../library/tkinter.rst:4266 msgid "" @@ -5806,6 +6749,9 @@ msgid "" "window the listbox scrolls just enough to bring it into view at that edge, " "otherwise the listbox scrolls to center the item." msgstr "" +"調整檢視,使 *index* 所指定的項目可見。若該項目已經可見,則此方法沒有作用;若" +"該項目靠近視窗邊緣,清單方塊只會捲動剛好足夠的距離,使其在該邊緣可見,否則清" +"單方塊會捲動以將該項目置中。" #: ../../library/tkinter.rst:4273 msgid "" @@ -5814,12 +6760,16 @@ msgid "" "drawn as specified by the *activestyle* option when the widget has the input " "focus, and its index may be retrieved with the ``'active'`` index." msgstr "" +"將作用中項目設定為 *index* 所指定的項目。若 *index* 超出項目範圍,則改為啟用" +"最接近的項目。當元件擁有輸入焦點時,作用中項目會依 *activestyle* 選項所指定的" +"方式繪製,其索引可透過 ``'active'`` 索引取得。" #: ../../library/tkinter.rst:4282 msgid "" "Return a tuple containing the numerical indices of all of the items that are " "currently selected, or an empty tuple if no items are selected." msgstr "" +"回傳一個包含目前所有已選取項目數字索引的元組,若沒有項目被選取則回傳空元組。" #: ../../library/tkinter.rst:4290 msgid "" @@ -5829,6 +6779,10 @@ msgid "" "mouse, and may afterwards be referred to with the ``'anchor'`` index. :meth:" "`select_anchor` is an alias of :meth:`!selection_anchor`." msgstr "" +"將選取錨點設定為 *index* 所指定的項目。若 *index* 所指的項目不存在,則使用最" +"接近的項目。選取錨點是使用滑鼠拖曳選取範圍時保持固定的一端,之後可透過 " +"``'anchor'`` 索引參照它。:meth:`select_anchor` 是 :meth:`!selection_anchor` " +"的別名。" #: ../../library/tkinter.rst:4302 msgid "" @@ -5836,12 +6790,16 @@ msgid "" "are selected. The selection state of items outside this range is not " "changed. :meth:`select_clear` is an alias of :meth:`!selection_clear`." msgstr "" +"取消選取從 *first* 到 *last*(含兩端)範圍內任何已選取的項目。此範圍之外項目" +"的選取狀態不會改變。:meth:`select_clear` 是 :meth:`!selection_clear` 的別名。" #: ../../library/tkinter.rst:4309 msgid "" "This shadows the inherited :meth:`Misc.selection_clear`, which clears the X " "selection; that method is not available on a :class:`Listbox`." msgstr "" +"這會遮蔽繼承的 :meth:`Misc.selection_clear`(用於清除 X selection);此方法" +"在 :class:`Listbox` 上不可用。" #: ../../library/tkinter.rst:4318 msgid "" @@ -5849,6 +6807,8 @@ msgid "" "``False`` otherwise. :meth:`select_includes` is an alias of :meth:`!" "selection_includes`." msgstr "" +"若 *index* 所指定的項目目前已被選取則回傳 ``True``,否則回傳 ``False``。:" +"meth:`select_includes` 是 :meth:`!selection_includes` 的別名。" #: ../../library/tkinter.rst:4327 msgid "" @@ -5856,12 +6816,14 @@ msgid "" "without affecting the selection state of items outside that range. :meth:" "`select_set` is an alias of :meth:`!selection_set`." msgstr "" +"選取從 *first* 到 *last*(含兩端)範圍內的所有項目,而不影響該範圍之外項目的" +"選取狀態。:meth:`select_set` 是 :meth:`!selection_set` 的別名。" #: ../../library/tkinter.rst:4333 msgid "" "Return the current value of the configuration option *option* for the item " "given by *index*." -msgstr "" +msgstr "回傳 *index* 所指定項目的設定選項 *option* 的目前值。" #: ../../library/tkinter.rst:4341 msgid "" @@ -5873,6 +6835,11 @@ msgid "" "*selectbackground* and *selectforeground*. :meth:`itemconfig` is an alias " "of :meth:`!itemconfigure`." msgstr "" +"查詢或修改 *index* 所指定項目的設定選項。這與 :meth:`~Misc.configure` 類似," +"差別在於它套用於個別項目,而非整個清單方塊。若沒有給定選項,則回傳一個描述該" +"項目目前選項的字典;否則會設定給定的選項。支援的項目選項有 *background*、" +"*foreground*、*selectbackground* 和 *selectforeground*。:meth:`itemconfig` " +"是 :meth:`!itemconfigure` 的別名。" #: ../../library/tkinter.rst:4358 msgid "" @@ -5881,6 +6848,9 @@ msgid "" "bound to mouse motion events in the widget, producing the effect of dragging " "the list at high speed through the window." msgstr "" +"將清單方塊捲動 10 倍於 *x*、*y* 與上一次 :meth:`scan_mark` 呼叫所傳入座標之間" +"的差值。這通常會綁定到元件中的滑鼠移動事件,產生以高速在視窗中拖曳清單的效" +"果。" #: ../../library/tkinter.rst:4366 msgid "" @@ -5890,6 +6860,9 @@ msgid "" "as pulldown menus posted from a cascade entry or menubutton, and as popup " "menus. Inherits from :class:`Widget`." msgstr "" +":class:`!Menu`(選單)元件會顯示一欄項目,每個項目可以是一個命令、核取按鈕、" +"單選按鈕、階層(會顯示相關聯的子選單)或分隔線。選單可用作頂層視窗的選單列、" +"由階層項目或選單按鈕顯示的下拉選單,以及彈出選單。繼承自 :class:`Widget`。" #: ../../library/tkinter.rst:4373 msgid "" @@ -5901,6 +6874,12 @@ msgid "" "coordinate *y* in the menu window), or a pattern matched against the labels " "of the entries from the top down." msgstr "" +"許多項目方法都接受一個 *index* 引數,用於選擇要操作的項目。如 Tk ``menu`` " +"manual page 所述,*index* 可以是一個數字索引(從頂部的 0 開始計數)、" +"``'active'``\\ (目前作用中的項目)、``'end'`` 或 ``'last'``\\ (最底部的項" +"目)、``'none'``\\ (完全沒有項目,在 Tcl 中寫作 ``{}``)、``@y``\\ (選單視" +"窗中覆蓋像素 y 座標 *y* 的項目),或是一個從頂部往下與項目標籤進行比對的樣" +"式。" #: ../../library/tkinter.rst:4384 msgid "" @@ -5911,20 +6890,27 @@ msgid "" "`!add_checkbutton`, :meth:`!add_radiobutton` and :meth:`!add_separator` " "convenience methods call this method with the corresponding *itemType*." msgstr "" +"在選單底部新增一個項目。*itemType* 為 ``'command'``、``'cascade'``、" +"``'checkbutton'``、``'radiobutton'`` 或 ``'separator'`` 之一,用於決定新項目" +"的類型;其餘的選項則用於設定該項目。:meth:`!add_command`、:meth:`!" +"add_cascade`、:meth:`!add_checkbutton`、:meth:`!add_radiobutton` 和 :meth:`!" +"add_separator` 這些便利方法會以對應的 *itemType* 呼叫此方法。" #: ../../library/tkinter.rst:4392 msgid "" "The entry is configured by the following options, although not every option " "applies to every entry type (a separator accepts none of them):" msgstr "" +"項目由以下選項設定,不過並非每個選項都適用於每種項目類型(分隔線不接受其中任" +"何一個):" #: ../../library/tkinter.rst:4395 msgid "*label*" -msgstr "" +msgstr "*label*" #: ../../library/tkinter.rst:4396 msgid "The text to display in the entry." -msgstr "" +msgstr "要在該項目中顯示的文字。" #: ../../library/tkinter.rst:4398 msgid "*command*" @@ -5934,146 +6920,149 @@ msgstr "*command*" msgid "" "The function to call when the entry is invoked (command, checkbutton and " "radiobutton entries)." -msgstr "" +msgstr "當項目被觸發時要呼叫的函式(命令、核取按鈕和單選按鈕項目)。" #: ../../library/tkinter.rst:4402 msgid "*accelerator*" -msgstr "" +msgstr "*accelerator*" #: ../../library/tkinter.rst:4403 msgid "" "A string displayed at the right of the entry to advertise an accelerator " "keystroke; it does not itself create the binding." msgstr "" +"顯示在項目右側、用於提示快速鍵按鍵組合的字串;它本身並不會建立該按鍵綁定。" #: ../../library/tkinter.rst:4407 msgid "" "The index of a character in the label to underline for keyboard traversal." -msgstr "" +msgstr "標籤中要加上底線以供鍵盤走訪的字元索引。" #: ../../library/tkinter.rst:4411 msgid "One of ``'normal'``, ``'active'`` or ``'disabled'``." -msgstr "" +msgstr "``'normal'``、``'active'`` 或 ``'disabled'`` 之一。" #: ../../library/tkinter.rst:4414 msgid "An image to display instead of, or together with, the text label." -msgstr "" +msgstr "要顯示以取代文字標籤,或與文字標籤一起顯示的圖片。" #: ../../library/tkinter.rst:4416 msgid "*compound*" -msgstr "" +msgstr "*compound*" #: ../../library/tkinter.rst:4417 msgid "" "Where to show the image relative to the text: ``'none'`` (the default), " "``'text'``, ``'image'``, ``'top'``, ``'bottom'``, ``'left'`` or ``'right'``." msgstr "" +"圖片相對於文字要顯示的位置:``'none'``\\ (預設值)、``'text'``、" +"``'image'``、``'top'``、``'bottom'``、``'left'`` 或 ``'right'``。" #: ../../library/tkinter.rst:4422 msgid "A bitmap to display instead of the text label." -msgstr "" +msgstr "要顯示以取代文字標籤的點陣圖。" #: ../../library/tkinter.rst:4425 ../../library/tkinter.rst:5309 msgid "The font to use for the text." -msgstr "" +msgstr "要用於文字的字型。" #: ../../library/tkinter.rst:4428 msgid "" "The entry's background and foreground colors in its normal state (ignored on " "macOS)." -msgstr "" +msgstr "項目在一般狀態下的背景色和前景色(在 macOS 上會被忽略)。" #: ../../library/tkinter.rst:4431 msgid "*activebackground*, *activeforeground*" -msgstr "" +msgstr "*activebackground*, *activeforeground*" #: ../../library/tkinter.rst:4432 msgid "" "The background and foreground colors used when the entry is active (ignored " "on macOS)." -msgstr "" +msgstr "項目處於作用中狀態時所使用的背景色和前景色(在 macOS 上會被忽略)。" #: ../../library/tkinter.rst:4435 msgid "*columnbreak*" -msgstr "" +msgstr "*columnbreak*" #: ../../library/tkinter.rst:4436 msgid "" "If true, the entry starts a new column instead of being placed below the " "previous entry." -msgstr "" +msgstr "若為真,該項目會另起一欄,而不是被放置在前一個項目下方。" #: ../../library/tkinter.rst:4439 msgid "*hidemargin*" -msgstr "" +msgstr "*hidemargin*" #: ../../library/tkinter.rst:4440 msgid "" "If true, the standard margin around the entry is omitted, which is useful " "when a menu is used as a palette." -msgstr "" +msgstr "若為真,則會省略項目周圍的標準邊界,這在選單用作調色盤時很有用。" #: ../../library/tkinter.rst:4443 msgid "*menu*" -msgstr "" +msgstr "*menu*" #: ../../library/tkinter.rst:4444 msgid "The submenu posted by a cascade entry; it must be a child of this menu." -msgstr "" +msgstr "由階層項目所顯示的子選單;它必須是此選單的子項。" #: ../../library/tkinter.rst:4447 msgid "*variable*" -msgstr "" +msgstr "*variable*" #: ../../library/tkinter.rst:4448 msgid "The variable associated with a checkbutton or radiobutton entry." -msgstr "" +msgstr "與核取按鈕或單選按鈕項目相關聯的變數。" #: ../../library/tkinter.rst:4450 msgid "*onvalue*, *offvalue*" -msgstr "" +msgstr "*onvalue*, *offvalue*" #: ../../library/tkinter.rst:4451 msgid "" "The values stored in *variable* when a checkbutton entry is selected or " "cleared." -msgstr "" +msgstr "核取按鈕項目被選取或清除時,儲存在 *variable* 中的值。" #: ../../library/tkinter.rst:4454 msgid "*value*" -msgstr "" +msgstr "*value*" #: ../../library/tkinter.rst:4455 msgid "The value stored in *variable* when a radiobutton entry is selected." -msgstr "" +msgstr "單選按鈕項目被選取時,儲存在 *variable* 中的值。" #: ../../library/tkinter.rst:4457 msgid "*indicatoron*" -msgstr "" +msgstr "*indicatoron*" #: ../../library/tkinter.rst:4458 msgid "Whether to display the indicator of a checkbutton or radiobutton entry." -msgstr "" +msgstr "是否顯示核取按鈕或單選按鈕項目的指示器。" #: ../../library/tkinter.rst:4461 msgid "*selectcolor*" -msgstr "" +msgstr "*selectcolor*" #: ../../library/tkinter.rst:4462 msgid "" "The color of the indicator of a checkbutton or radiobutton entry when it is " "selected." -msgstr "" +msgstr "核取按鈕或單選按鈕項目被選取時,其指示器的顏色。" #: ../../library/tkinter.rst:4465 msgid "*selectimage*" -msgstr "" +msgstr "*selectimage*" #: ../../library/tkinter.rst:4466 msgid "" "The image displayed when a checkbutton or radiobutton entry is selected and " "*image* is also given." -msgstr "" +msgstr "當核取按鈕或單選按鈕項目被選取,且也有給定 *image* 時所顯示的圖片。" #: ../../library/tkinter.rst:4471 msgid "" @@ -6081,6 +7070,8 @@ msgid "" "associated submenu, given by its *menu* option, which must be a child of " "this menu; posting the entry posts the submenu next to it." msgstr "" +"在選單底部新增一個階層項目。階層項目具有一個由其 *menu* 選項所指定的相關聯子" +"選單,該子選單必須是此選單的子項;顯示該項目時會在其旁邊顯示子選單。" #: ../../library/tkinter.rst:4478 msgid "" @@ -6089,6 +7080,9 @@ msgid "" "result in its associated *variable*, and displays an indicator showing " "whether it is selected." msgstr "" +"在選單底部新增一個核取按鈕項目。核取按鈕項目被觸發時,會在其 *onvalue* 和 " +"*offvalue* 之間切換,將結果儲存在其相關聯的 *variable* 中,並顯示一個指示器來" +"表示它是否被選取。" #: ../../library/tkinter.rst:4485 msgid "" @@ -6096,6 +7090,8 @@ msgid "" "much like a button: when it is invoked, the callback given by its *command* " "option is called." msgstr "" +"在選單底部新增一個命令項目。命令項目的行為很像按鈕:當它被觸發時,會呼叫其 " +"*command* 選項所指定的回呼函式。" #: ../../library/tkinter.rst:4491 msgid "" @@ -6103,12 +7099,16 @@ msgid "" "sharing the same *variable* form a group of which only one may be selected " "at a time; selecting an entry stores its *value* in the variable." msgstr "" +"在選單底部新增一個單選按鈕項目。共用相同 *variable* 的單選按鈕項目會形成一個" +"群組,該群組中一次只能選取一個項目;選取某個項目會將其 *value* 儲存到該變數" +"中。" #: ../../library/tkinter.rst:4498 msgid "" "Add a separator to the bottom of the menu. A separator is displayed as a " "horizontal dividing line and cannot be activated or invoked." msgstr "" +"在選單底部新增一條分隔線。分隔線會顯示為一條水平分隔線,且無法被啟用或觸發。" #: ../../library/tkinter.rst:4504 msgid "" @@ -6120,36 +7120,49 @@ msgid "" "and :meth:`!insert_separator` convenience methods call this method with the " "corresponding *itemType*." msgstr "" +"與 :meth:`add` 相同,差別在於新項目會被插入到 *index* 所指定項目之前,而不是" +"附加到選單的末尾。*itemType* 為 ``'command'``、``'cascade'``、" +"``'checkbutton'``、``'radiobutton'`` 或 ``'separator'`` 之一。:meth:`!" +"insert_command`、:meth:`!insert_cascade`、:meth:`!insert_checkbutton`、:meth:" +"`!insert_radiobutton` 和 :meth:`!insert_separator` 這些便利方法會以對應的 " +"*itemType* 呼叫此方法。" #: ../../library/tkinter.rst:4516 msgid "" "Insert a new cascade entry before the entry given by *index* (see :meth:" "`add_cascade`)." msgstr "" +"在 *index* 所指定的項目之前插入一個新的階層項目(見 :meth:`add_cascade`)。" #: ../../library/tkinter.rst:4521 msgid "" "Insert a new checkbutton entry before the entry given by *index* (see :meth:" "`add_checkbutton`)." msgstr "" +"在 *index* 所指定的項目之前插入一個新的核取按鈕項目(見 :meth:" +"`add_checkbutton`)。" #: ../../library/tkinter.rst:4526 msgid "" "Insert a new command entry before the entry given by *index* (see :meth:" "`add_command`)." msgstr "" +"在 *index* 所指定的項目之前插入一個新的命令項目(見 :meth:`add_command`)。" #: ../../library/tkinter.rst:4531 msgid "" "Insert a new radiobutton entry before the entry given by *index* (see :meth:" "`add_radiobutton`)." msgstr "" +"在 *index* 所指定的項目之前插入一個新的單選按鈕項目(見 :meth:" +"`add_radiobutton`)。" #: ../../library/tkinter.rst:4536 msgid "" "Insert a separator before the entry given by *index* (see :meth:" "`add_separator`)." msgstr "" +"在 *index* 所指定的項目之前插入一條分隔線(見 :meth:`add_separator`)。" #: ../../library/tkinter.rst:4541 msgid "" @@ -6158,12 +7171,15 @@ msgid "" "deleted. Attempts to delete a tear-off entry are ignored; remove it by " "changing the *tearoff* option instead." msgstr "" +"刪除 *index1* 到 *index2*(含兩端)之間的所有選單項目。若省略 *index2*,則預" +"設為 *index1*,因此只會刪除單一項目。嘗試刪除撕下項目的動作會被忽略;請改為變" +"更 *tearoff* 選項來移除它。" #: ../../library/tkinter.rst:4549 msgid "" "Return the current value of the configuration option *option* for the entry " "given by *index*." -msgstr "" +msgstr "回傳 *index* 所指定項目的設定選項 *option* 的目前值。" #: ../../library/tkinter.rst:4557 msgid "" @@ -6175,12 +7191,17 @@ msgid "" "`add` for the entry's type. :meth:`entryconfig` is an alias of :meth:`!" "entryconfigure`." msgstr "" +"查詢或修改 *index* 所指定項目的設定選項。這與 :meth:`~Misc.configure` 類似," +"差別在於它套用於個別項目,而非整個選單。若沒有給定選項,則回傳一個描述該項目" +"目前選項的字典;否則會設定給定的選項。支援的選項為 :meth:`add` 針對該項目類型" +"所接受的選項。:meth:`entryconfig` 是 :meth:`!entryconfigure` 的別名。" #: ../../library/tkinter.rst:4568 msgid "" "Return the numerical index corresponding to *index*, or ``None`` if *index* " "selects no entry." msgstr "" +"回傳對應於 *index* 的數字索引,若 *index* 沒有選取任何項目則回傳 ``None``。" #: ../../library/tkinter.rst:4573 msgid "" @@ -6188,6 +7209,9 @@ msgid "" "``'cascade'``, ``'checkbutton'``, ``'radiobutton'``, ``'separator'`` or " "``'tearoff'`` (for the tear-off entry)." msgstr "" +"回傳 *index* 所指定項目的類型:``'command'``、``'cascade'``、" +"``'checkbutton'``、``'radiobutton'``、``'separator'`` 或 ``'tearoff'``\\ (用" +"於撕下項目)之一。" #: ../../library/tkinter.rst:4579 msgid "" @@ -6196,6 +7220,9 @@ msgid "" "selects no entry, or the selected entry is disabled, the menu ends up with " "no active entry." msgstr "" +"將 *index* 所指定的項目設為作用中項目,以其作用中顏色重新顯示,並停用任何先前" +"的作用中項目。若 *index* 沒有選取任何項目,或所選取的項目已被停用,則選單最終" +"不會有任何作用中項目。" #: ../../library/tkinter.rst:4586 msgid "" @@ -6204,6 +7231,8 @@ msgid "" "associated with it, the result of that command is returned; otherwise the " "result is an empty string." msgstr "" +"觸發 *index* 所指定項目的動作,如同它被點擊一樣。若該項目已被停用,則不會有任" +"何動作。若該項目有相關聯的 *command*,則回傳該命令的結果;否則回傳空字串。" #: ../../library/tkinter.rst:4594 msgid "" @@ -6212,6 +7241,8 @@ msgid "" "*postcommand* option has been specified, it is evaluated before the menu is " "posted." msgstr "" +"在螢幕上根視窗座標 *x* 和 *y* 處顯示選單,並在必要時調整座標,使整個選單可" +"見。若有指定 *postcommand* 選項,則會在顯示選單之前執行它。" #: ../../library/tkinter.rst:4601 msgid "" @@ -6219,6 +7250,8 @@ msgid "" "*entry* is given, the menu is positioned so that this entry is displayed " "under the pointer." msgstr "" +"在根視窗座標 *x* 和 *y* 處以彈出選單的方式顯示此選單。若有給定 *entry*,則會" +"調整選單的位置,使該項目顯示在指標下方。" #: ../../library/tkinter.rst:4607 msgid "" @@ -6226,18 +7259,20 @@ msgid "" "lower-level cascaded submenu. This has no effect on Windows and macOS, which " "manage the unposting of menus themselves." msgstr "" +"取消映射此選單,使其不再顯示,同時也會取消顯示任何已顯示的下層階層子選單。這" +"在 Windows 和 macOS 上沒有作用,因為它們會自行管理選單的取消顯示。" #: ../../library/tkinter.rst:4614 msgid "" "Return the x-coordinate, within the menu window, of the leftmost pixel of " "the entry given by *index*." -msgstr "" +msgstr "回傳 *index* 所指定項目最左側像素在選單視窗中的 x 座標。" #: ../../library/tkinter.rst:4621 msgid "" "Return the y-coordinate, within the menu window, of the topmost pixel of the " "entry given by *index*." -msgstr "" +msgstr "回傳 *index* 所指定項目最頂端像素在選單視窗中的 y 座標。" #: ../../library/tkinter.rst:4627 msgid "" @@ -6248,6 +7283,11 @@ msgid "" "relative to the button. Inherits from :class:`Widget`. Refer to the Tk " "``menubutton`` manual page for the full list of options." msgstr "" +":class:`!Menubutton`(選單按鈕)元件會顯示一個文字字串、點陣圖或圖片,並在使" +"用者按下時顯示其 *menu* 選項所指定的相關聯 :class:`Menu`。如同 :class:" +"`Label` 一樣,它可以顯示 *text*、*textvariable* 或 *image*,而 *direction* 選" +"項則控制選單相對於按鈕出現的位置。繼承自 :class:`Widget`。有關選項的完整清" +"單,請參閱 Tk ``menubutton`` manual page。" #: ../../library/tkinter.rst:4639 msgid "" @@ -6259,6 +7299,11 @@ msgid "" "`Widget`. Refer to the Tk ``message`` manual page for the full list of " "options." msgstr "" +":class:`!Message`(訊息)元件會顯示一個不可互動的文字字串,該字串由 *text* 選" +"項給定,或透過 *textvariable* 連結到一個變數。與 :class:`Label` 不同的是,它" +"會將字串拆成多行,以產生指定的長寬比,並在單字邊界處選擇換行位置,還可以將文" +"字靠左、置中或靠右對齊。繼承自 :class:`Widget`。有關選項的完整清單,請參閱 " +"Tk ``message`` manual page。" #: ../../library/tkinter.rst:4650 msgid "" @@ -6269,14 +7314,18 @@ msgid "" "callback that is invoked with the selected value, and the keyword argument " "*name* sets the Tk widget name." msgstr "" +":class:`Menubutton` 的一個輔助子類別,會顯示一個包含互斥選項的彈出選單。" +"*variable* 是一個與選取內容保持同步的 :class:`Variable`,*value* 是初始選項," +"而 *values* 則是其餘的選單項目。關鍵字引數 *command* 可以指定一個會以選取的值" +"作為引數呼叫的回呼函式;關鍵字引數 *name* 則用於設定 Tk 元件名稱。" #: ../../library/tkinter.rst:4659 msgid "Destroy the widget, also cleaning up the associated pop-up menu." -msgstr "" +msgstr "銷毀該元件,同時清理相關聯的彈出選單。" #: ../../library/tkinter.rst:4661 msgid "Added support for the *name* keyword argument." -msgstr "" +msgstr "新增支援 *name* 關鍵字引數。" #: ../../library/tkinter.rst:4668 msgid "" @@ -6287,6 +7336,11 @@ msgid "" "can drag with the mouse to resize the widgets on either side of it. Inherits " "from :class:`Widget`." msgstr "" +":class:`!PanedWindow` 是一種佈局管理器元件,可將任意數量的子\\ *窗格*\\ 排列" +"成一列(當 *orient* 為 ``'horizontal'`` 時)或一欄(當 *orient* 為 " +"``'vertical'`` 時)。每個窗格容納一個元件,且每對相鄰窗格之間都由一條可移動的" +"\\ *分隔條*\\ 隔開,使用者可以用滑鼠拖曳它來調整兩側元件的大小。繼承自 :" +"class:`Widget`。" #: ../../library/tkinter.rst:4676 msgid "" @@ -6295,6 +7349,10 @@ msgid "" "handle is drawn on each sash that the user can grab to drag it. Refer to the " "Tk ``panedwindow`` manual page for the full list of options." msgstr "" +"*orient* 選項用於選擇佈局方向,*sashwidth* 設定每條分隔條的寬度," +"*sashrelief* 設定其浮雕樣式。當 *showhandle* 為真時,每條分隔條上會繪製一個小" +"把手,供使用者抓取以拖曳該分隔條。完整的選項清單請參閱 Tk 的 ``panedwindow`` " +"手冊頁。" #: ../../library/tkinter.rst:4684 msgid "" @@ -6302,6 +7360,9 @@ msgid "" "panes. The keyword arguments specify per-pane management options for " "*child*; they may be any of the options accepted by :meth:`paneconfigure`." msgstr "" +"將 *child* 加入此 PanedWindow 作為新的窗格,並放置在所有現有窗格之後。關鍵字" +"引數用於指定 *child* 的個別窗格管理選項,可以是 :meth:`paneconfigure` 所接受" +"的任何選項。" #: ../../library/tkinter.rst:4694 msgid "" @@ -6311,12 +7372,17 @@ msgid "" "use :meth:`~Pack.pack_forget`, :meth:`~Grid.grid_forget` or :meth:`~Place." "place_forget` to remove the widget itself from its manager." msgstr "" +"從此 PanedWindow 中移除包含 *child* 的窗格。*child* 的所有佈局管理選項都會被" +"遺忘。:meth:`forget` 是 :meth:`!remove` 的別名。這會遮蔽繼承而來的佈局管理器" +"方法 :meth:`!forget`;如要將元件本身從其管理器中移除,請使用 :meth:`~Pack." +"pack_forget`、:meth:`~Grid.grid_forget` 或 :meth:`~Place.place_forget`。" #: ../../library/tkinter.rst:4703 msgid "" "Return a tuple of the widgets managed by the panedwindow, one per pane, in " "order." msgstr "" +"回傳一個由此 PanedWindow 所管理之元件所組成的 tuple,依序每個窗格一個元件。" #: ../../library/tkinter.rst:4708 msgid "" @@ -6324,6 +7390,8 @@ msgid "" "containing *child*. *option* may be any value allowed by :meth:" "`paneconfigure`." msgstr "" +"回傳包含 *child* 的窗格中管理選項 *option* 的目前值。*option* 可以是 :meth:" +"`paneconfigure` 所允許的任何值。" #: ../../library/tkinter.rst:4717 msgid "" @@ -6342,6 +7410,16 @@ msgid "" "``'first'``, ``'last'``, ``'middle'`` or ``'never'``). :meth:`paneconfig` is " "an alias of :meth:`!paneconfigure`." msgstr "" +"查詢或修改包含元件 *tagOrId* 的窗格的管理選項。若未提供任何選項,會回傳一個描" +"述該窗格所有可用選項的 dictionary;若提供單一選項名稱字串,則回傳該選項的描" +"述;否則會設定所給定的選項。支援的選項包括 *after* 和 *before*(將窗格插入在" +"另一個受管理視窗之後或之前)、*height* 和 *width*(視窗的外部尺寸,包含任何邊" +"框)、*minsize*(在分隔方向上的最小尺寸)、*padx* 和 *pady*(在視窗每側保留的" +"額外空間)、*sticky*(在過大的窗格中定位或延展視窗,使用由 ``n``、``s``、" +"``e`` 和 ``w`` 等字元組成的字串)、*hide*(隱藏窗格但仍將其保留在窗格清單" +"中),以及 *stretch*(如何將額外空間分配給窗格:``'always'``、``'first'``、" +"``'last'``、``'middle'`` 或 ``'never'`` 其中之一)。:meth:`paneconfig` 是 :" +"meth:`!paneconfigure` 的別名。" #: ../../library/tkinter.rst:4735 msgid "" @@ -6352,6 +7430,11 @@ msgid "" "'sash')`` or ``(2, 'handle')``. If the point is over any other part of the " "panedwindow, the result is an empty string." msgstr "" +"辨識位於視窗座標中 *x* 和 *y* 所指定之點下方的 PanedWindow 元件部位。若該點位" +"於分隔條或分隔條把手之上,結果會是一個包含兩個元素的 tuple,其中包含該分隔條" +"或把手的索引,以及一個表示該處是分隔條還是把手的字詞,例如 ``(0, 'sash')`` " +"或 ``(2, 'handle')``。若該點位於此 PanedWindow 的其他部分之上,結果則為空字" +"串。" #: ../../library/tkinter.rst:4746 msgid "" @@ -6360,6 +7443,9 @@ msgid "" "meth:`sash_coord`, :meth:`sash_mark` and :meth:`sash_place` should normally " "be used instead." msgstr "" +"查詢或改變此 PanedWindow 中各分隔條的位置。這是 Tk ``sash`` 子指令的薄封裝;" +"一般情況下應改用便利方法 :meth:`sash_coord`、:meth:`sash_mark` 和 :meth:" +"`sash_place`。" #: ../../library/tkinter.rst:4753 msgid "" @@ -6368,16 +7454,21 @@ msgid "" "the panedwindow. The coordinates returned are those of the top left corner " "of the region containing the sash." msgstr "" +"回傳由 *index* 所指定之分隔條目前的 x、y 座標對,*index* 必須是介於 0 到此 " +"PanedWindow 窗格數量減一之間的整數。回傳的座標為包含該分隔條之區域的左上角座" +"標。" #: ../../library/tkinter.rst:4761 msgid "" "Record the current mouse position for the sash given by *index*, for use " "together with later sash-drag operations to move the sash." msgstr "" +"記錄由 *index* 所指定之分隔條目前的滑鼠位置,供之後的分隔條拖曳操作用來移動該" +"分隔條。" #: ../../library/tkinter.rst:4766 msgid "Place the sash given by *index* at the coordinates *x* and *y*." -msgstr "" +msgstr "將由 *index* 所指定的分隔條放置在座標 *x* 和 *y* 處。" #: ../../library/tkinter.rst:4770 msgid "" @@ -6387,20 +7478,24 @@ msgid "" "`proxy_coord`, :meth:`proxy_forget` and :meth:`proxy_place` should normally " "be used instead." msgstr "" +"查詢或改變分隔條代理(sash proxy)的位置,此代理是在以非不透明方式調整大小拖" +"曳分隔條時所顯示的「幽靈」分隔條。這是 Tk ``proxy`` 子指令的薄封裝;一般情況" +"下應改用便利方法 :meth:`proxy_coord`、:meth:`proxy_forget` 和 :meth:" +"`proxy_place`。" #: ../../library/tkinter.rst:4778 msgid "" "Return a tuple containing the x and y coordinates of the most recent proxy " "location." -msgstr "" +msgstr "回傳一個包含最近一次代理位置 x、y 座標的 tuple。" #: ../../library/tkinter.rst:4783 msgid "Remove the proxy from the display." -msgstr "" +msgstr "將代理從畫面上移除。" #: ../../library/tkinter.rst:4787 msgid "Place the proxy at the coordinates *x* and *y*." -msgstr "" +msgstr "將代理放置在座標 *x* 和 *y* 處。" #: ../../library/tkinter.rst:4792 msgid "" @@ -6415,6 +7510,13 @@ msgid "" "options documented in the Tk ``radiobutton`` manual page, such as " "*variable*, *value* and *command*." msgstr "" +":class:`!Radiobutton` 元件會顯示一段文字字串、點陣圖或圖片,並搭配一個菱形或" +"圓形指示器,用於在多個選項中選擇一個。它具有簡單按鈕的所有行為,此外還可以被" +"選取:通常會有數個 radiobutton 共用同一個 *variable*,選取其中一個會將該變數" +"設為該 radiobutton 的 *value*;每個 radiobutton 也會監控該變數,並在變數改變" +"時自動選取或取消選取自身。繼承自 :class:`Widget`。除了標準元件選項之外," +"radiobutton 還接受 Tk ``radiobutton`` 手冊頁中所記載的選項,例如 *variable*、" +"*value* 和 *command*。" #: ../../library/tkinter.rst:4807 msgid "" @@ -6424,18 +7526,23 @@ msgid "" "associated with the radiobutton. This is ignored if the radiobutton's state " "is ``disabled``." msgstr "" +"執行使用者以滑鼠按下該 radiobutton 時會發生的動作:選取該按鈕並叫用相關聯的命" +"令(若有的話)。回傳該命令的結果,若沒有與此 radiobutton 相關聯的命令則回傳空" +"字串。若此 radiobutton 的狀態為 ``disabled``,則此方法會被忽略。" #: ../../library/tkinter.rst:4816 msgid "" "Select the radiobutton and set the associated variable to the value " "corresponding to this widget." -msgstr "" +msgstr "選取此 radiobutton,並將相關聯的變數設為對應此元件的值。" #: ../../library/tkinter.rst:4821 msgid "" "Deselect the radiobutton and set the associated variable to an empty string. " "If this radiobutton was not currently selected, this has no effect." msgstr "" +"取消選取此 radiobutton,並將相關聯的變數設為空字串。若此 radiobutton 目前並未" +"被選取,則此方法沒有作用。" #: ../../library/tkinter.rst:4827 msgid "" @@ -6444,6 +7551,9 @@ msgid "" "left in the same normal or active state as when the method was called. This " "is ignored if the radiobutton's state is ``disabled``." msgstr "" +"讓此 radiobutton 閃爍,方式是重新顯示它數次,並在作用中與一般顏色之間交替。閃" +"爍結束後,此 radiobutton 會維持與呼叫此方法時相同的一般或作用中狀態。若此 " +"radiobutton 的狀態為 ``disabled``,則此方法會被忽略。" #: ../../library/tkinter.rst:4836 msgid "" @@ -6452,6 +7562,8 @@ msgid "" "optionally display a label and the current value. Inherits from :class:" "`Widget`." msgstr "" +":class:`!Scale` 元件讓使用者透過沿著溝槽移動滑桿來選擇一個數值。它可以垂直或" +"水平定向,並可選擇性地顯示標籤與目前的值。繼承自 :class:`Widget`。" #: ../../library/tkinter.rst:4842 msgid "" @@ -6462,24 +7574,34 @@ msgid "" "dropped; *from* is spelled ``from_`` because :keyword:`from` is a Python " "keyword." msgstr "" +"除了標準元件選項之外,scale 還接受 Tk ``scale`` 手冊頁中所記載的選項,例如 " +"*from_*、*to*、*resolution*、*orient*、*tickinterval*、*variable* 和 " +"*command*。與 :mod:`!tkinter` 中其他地方一樣,Tk 選項名稱開頭的 ``-`` 會被省" +"略;*from* 拼寫為 ``from_``,因為 :keyword:`from` 是 Python 的關鍵字。" #: ../../library/tkinter.rst:4849 msgid "" "With a non-integer *resolution*, see :ref:`numeric values and the locale " "`." msgstr "" +"若 *resolution* 為非整數,請參閱\\ :ref:`數值與地區設定 `。" #: ../../library/tkinter.rst:4854 msgid "" "Return the current value of the scale. The result is an integer if the " "scale's *resolution* yields whole numbers, and a float otherwise." msgstr "" +"回傳此 scale 目前的值。若 scale 的 *resolution* 產生整數,結果為 int;否則為 " +"float。" #: ../../library/tkinter.rst:4860 msgid "" "Set the scale to *value*, moving the slider accordingly. This has no effect " "if the scale is disabled." msgstr "" +"將 scale 設為 *value*,並相應地移動滑桿。若此 scale 已停用,則此方法沒有作" +"用。" #: ../../library/tkinter.rst:4865 msgid "" @@ -6487,6 +7609,8 @@ msgid "" "widget, of the point on the centerline of the trough that corresponds to " "*value*. If *value* is omitted, the scale's current value is used." msgstr "" +"回傳一個 tuple ``(x, y)``,表示對應 *value* 之溝槽中心線上該點相對於此元件的" +"像素座標。若省略 *value*,則使用 scale 目前的值。" #: ../../library/tkinter.rst:4872 msgid "" @@ -6495,6 +7619,9 @@ msgid "" "the left of the slider), ``'trough2'`` (below or to the right of the " "slider), or an empty string if the point is not over any of these elements." msgstr "" +"回傳一個描述位於像素座標 *x*、*y* 處之 scale 部位的字串:``'slider'``、" +"``'trough1'``\\ (滑桿上方或左側的溝槽部分)、``'trough2'``\\ (滑桿下方或右" +"側的溝槽部分),若該點不在這些元素之上,則回傳空字串。" #: ../../library/tkinter.rst:4881 msgid "" @@ -6506,6 +7633,12 @@ msgid "" "to the scrolled widget's :meth:`~XView.xview` or :meth:`~YView.yview` " "method. Inherits from :class:`Widget`." msgstr "" +":class:`!Scrollbar` 元件會顯示一個滑桿與兩個箭頭,讓使用者可以捲動相關聯的元" +"件,例如 :class:`Listbox`、:class:`Text`、:class:`Canvas` 或 :class:`Entry`。" +"將該元件的 *xscrollcommand* 或 *yscrollcommand* 選項設為此 scrollbar 的 :" +"meth:`set` 方法,並將此 scrollbar 的 *command* 選項設為被捲動元件的 :meth:" +"`~XView.xview` 或 :meth:`~YView.yview` 方法,即可將兩者連接起來。繼承自 :" +"class:`Widget`。" #: ../../library/tkinter.rst:4892 msgid "" @@ -6513,6 +7646,8 @@ msgid "" "fractions between 0 and 1, describing the portion of the document that is " "currently visible, as last passed to :meth:`set`." msgstr "" +"以 tuple ``(first, last)`` 的形式回傳目前的 scrollbar 設定,這兩個介於 0 到 " +"1 之間的分數描述了文件中目前可見的部分,即最近一次傳給 :meth:`set` 的值。" #: ../../library/tkinter.rst:4898 msgid "" @@ -6521,6 +7656,9 @@ msgid "" "document. This method is normally registered as the scrolled widget's " "*xscrollcommand* or *yscrollcommand* and called by that widget." msgstr "" +"設定此 scrollbar。*first* 和 *last* 為介於 0 到 1 之間的分數,表示相關聯文件" +"中可見部分的起點與終點位置。此方法通常會被註冊為被捲動元件的 " +"*xscrollcommand* 或 *yscrollcommand*,並由該元件呼叫。" #: ../../library/tkinter.rst:4906 msgid "" @@ -6529,10 +7667,13 @@ msgid "" "*activerelief* options. If *index* is omitted, return the name of the " "currently active element, or ``None`` if no element is active." msgstr "" +"將元素 *index*(``'arrow1'``、``'slider'`` 或 ``'arrow2'`` 其中之一)標記為作" +"用中,並依照 *activebackground* 和 *activerelief* 選項顯示它。若省略 " +"*index*,則回傳目前作用中元素的名稱,若沒有元素處於作用中,則回傳 ``None``。" #: ../../library/tkinter.rst:4912 msgid "The *index* argument is now optional." -msgstr "" +msgstr "*index* 引數現在為可選。" #: ../../library/tkinter.rst:4917 msgid "" @@ -6541,6 +7682,9 @@ msgid "" "horizontal scrollbars) or *deltay* pixels vertically (for vertical " "scrollbars)." msgstr "" +"回傳一個 float,表示將滑桿水平移動 *deltax* 個像素(適用於水平 scrollbar)或" +"垂直移動 *deltay* 個像素(適用於垂直 scrollbar)時,scrollbar 設定所對應的分" +"數變化量。" #: ../../library/tkinter.rst:4924 msgid "" @@ -6548,6 +7692,8 @@ msgid "" "coordinates *x*, *y* lies in the trough: 0 corresponds to the top or left of " "the trough and 1 to the bottom or right." msgstr "" +"回傳一個介於 0 到 1 之間的 float,表示位於像素座標 *x*、*y* 處的點在溝槽中的" +"位置:0 對應溝槽的頂端或左側,1 對應底端或右側。" #: ../../library/tkinter.rst:4930 msgid "" @@ -6555,6 +7701,8 @@ msgid "" "``'arrow1'``), or an empty string if the point does not lie in any element " "of the scrollbar." msgstr "" +"回傳位於像素座標 *x*、*y* 下方元素的名稱(例如 ``'arrow1'``),若該點不在此 " +"scrollbar 的任何元素之上,則回傳空字串。" #: ../../library/tkinter.rst:4937 msgid "" @@ -6569,12 +7717,21 @@ msgid "" "numeric values are formatted; and the *validate* option enables validation " "of the entered text. Inherits from :class:`Widget` and :class:`XView`." msgstr "" +":class:`!Spinbox` 元件是一種類似 :class:`Entry` 的元件,具有一對上/下箭頭按" +"鈕,讓使用者除了可以直接編輯數值之外,還能逐步瀏覽一個數值範圍。這組數值可以" +"是由 *from_*、*to* 和 *increment* 選項所指定的數值範圍,或是由 *values* 選項" +"所指定的明確字串清單(此選項優先於範圍設定)。每次按下箭頭時,若有指定 " +"*command* 回呼,就會呼叫它;*wrap* 選項控制在超出範圍任一端時是否要繞回到另一" +"端;*format* 選項指定數值的格式化方式;而 *validate* 選項則可啟用對輸入文字的" +"驗證。繼承自 :class:`Widget` 和 :class:`XView`。" #: ../../library/tkinter.rst:4950 msgid "" "With a non-integer *increment*, see :ref:`numeric values and the locale " "`." msgstr "" +"若 *increment* 為非整數,請參閱\\ :ref:`數值與地區設定 `。" #: ../../library/tkinter.rst:4953 msgid "" @@ -6586,16 +7743,21 @@ msgid "" "last'`` (the ends of the selection), or ``@x`` (the character covering pixel " "x-coordinate *x* in the window)." msgstr "" +"許多方法都接受一個 *index* 引數,用於指定此 spinbox 字串中的某個字元。如 Tk " +"``spinbox`` 手冊頁所述,*index* 可以是一個數值索引(從 0 開始計數)、" +"``'anchor'``\\ (選取錨點)、``'end'``\\ (最後一個字元之後的位置)、" +"``'insert'``\\ (插入游標之後的字元)、``'sel.first'`` 或 ``'sel.last'``\\ " +"(選取範圍的兩端),或是 ``@x``\\ (涵蓋視窗中像素 x 座標 *x* 的字元)。" #: ../../library/tkinter.rst:4964 msgid "Return the spinbox's string." -msgstr "" +msgstr "回傳此 spinbox 的字串。" #: ../../library/tkinter.rst:4968 msgid "" "Insert the characters of the string *s* just before the character given by " "*index*." -msgstr "" +msgstr "將字串 *s* 中的字元插入到由 *index* 所指定的字元之前。" #: ../../library/tkinter.rst:4973 msgid "" @@ -6604,10 +7766,13 @@ msgid "" "after the last one to delete. If *last* is omitted, a single character at " "*first* is deleted." msgstr "" +"刪除此 spinbox 中一個或多個字元。*first* 為要刪除的第一個字元的索引,*last* " +"為要刪除的最後一個字元之後那個字元的索引。若省略 *last*,則只刪除 *first* 處" +"的單一字元。" #: ../../library/tkinter.rst:4985 msgid "Return the numerical index corresponding to *index*, as a string." -msgstr "" +msgstr "回傳對應 *index* 的數值索引,以字串形式表示。" #: ../../library/tkinter.rst:4989 msgid "" @@ -6617,18 +7782,26 @@ msgid "" "widget, and *width* and *height* are its size in pixels. The bounding box " "may refer to a region outside the visible area of the window." msgstr "" +"回傳一個包含四個整數 ``(x, y, width, height)`` 的 tuple,描述由 *index* 所指" +"定字元的邊界框(bounding box)。*x* 和 *y* 為該字元左上角相對於此元件的像素座" +"標,*width* 和 *height* 則為其以像素為單位的尺寸。此邊界框可能是指視窗可見區" +"域之外的範圍。" #: ../../library/tkinter.rst:5002 msgid "" "Return the name of the window element at the pixel coordinates *x*, *y*: one " "of ``'buttondown'``, ``'buttonup'``, ``'entry'`` or ``'none'``." msgstr "" +"回傳位於像素座標 *x*、*y* 處視窗元素的名稱:``'buttondown'``、" +"``'buttonup'``、``'entry'`` 或 ``'none'`` 其中之一。" #: ../../library/tkinter.rst:5007 msgid "" "Invoke the spin button given by *element*, either ``'buttonup'`` or " "``'buttondown'``, triggering the action associated with it." msgstr "" +"叫用由 *element* 所指定的旋轉按鈕(``'buttonup'`` 或 ``'buttondown'`` 其中之" +"一),觸發與其相關聯的動作。" #: ../../library/tkinter.rst:5012 msgid "" @@ -6637,6 +7810,10 @@ msgid "" "view, and ``scan('dragto', x)`` adjusts the view relative to that mark. The :" "meth:`scan_mark` and :meth:`scan_dragto` methods wrap the two forms." msgstr "" +"這是 Tk ``scan`` 元件子指令的薄封裝,用於實作快速拖曳檢視畫面:" +"``scan('mark', x)`` 會記錄 *x* 與目前的檢視畫面,而 ``scan('dragto', x)`` 則" +"會相對於該標記調整檢視畫面。:meth:`scan_mark` 和 :meth:`scan_dragto` 方法即為" +"這兩種形式的封裝。" #: ../../library/tkinter.rst:5020 msgid "" @@ -6644,6 +7821,8 @@ msgid "" "meth:`scan_dragto` call. This is typically associated with a mouse button " "press in the widget." msgstr "" +"記錄 *x* 與此 spinbox 視窗目前的檢視畫面,供之後呼叫 :meth:`scan_dragto` 時使" +"用。這通常會與元件中的滑鼠按鍵按下事件相關聯。" #: ../../library/tkinter.rst:5026 msgid "" @@ -6652,6 +7831,9 @@ msgid "" "motion events, producing the effect of dragging the spinbox at high speed " "through the window." msgstr "" +"依據 *x* 與最近一次呼叫 :meth:`scan_mark` 時所傳入之 *x* 之間差值的 10 倍來調" +"整檢視畫面。這通常會與滑鼠移動事件相關聯,產生以高速拖曳此 spinbox 穿過視窗的" +"效果。" #: ../../library/tkinter.rst:5033 msgid "" @@ -6665,6 +7847,14 @@ msgid "" "meth:`selection_present`, :meth:`selection_range` and :meth:`selection_to` " "methods wrap these forms." msgstr "" +"這是 Tk ``selection`` 元件子指令的薄封裝,用於調整此 spinbox 中的選取範圍。依" +"第一個引數的不同,它有數種形式,例如 ``selection('adjust', index)``、" +"``selection('clear')``、``selection('element', ?elem?)``、" +"``selection('from', index)``、``selection('present')``、``selection('range', " +"start, end)`` 和 ``selection('to', index)``。:meth:`selection_adjust`、:meth:" +"`selection_clear`、:meth:`selection_element`、:meth:`selection_from`、:meth:" +"`selection_present`、:meth:`selection_range` 和 :meth:`selection_to` 方法即為" +"這些形式的封裝。" #: ../../library/tkinter.rst:5047 msgid "" @@ -6675,18 +7865,26 @@ msgid "" "a new selection is created to include the characters between *index* and the " "most recent anchor point, inclusive." msgstr "" +"找出選取範圍中最靠近 *index* 所指定字元的那一端,並將該端調整到 *index* 處" +"(包含但不超過 *index*)。另一端則會成為之後呼叫 :meth:`selection_to` 時的錨" +"點。若此 spinbox 目前沒有選取範圍,則會建立一個新的選取範圍,包含 *index* 與" +"最近錨點之間(含兩端)的字元。" #: ../../library/tkinter.rst:5058 msgid "" "Clear the selection if it is currently in this widget. If the selection is " "not in this widget, the method has no effect." msgstr "" +"若此元件目前有選取範圍,則清除該選取範圍。若此元件沒有選取範圍,則此方法沒有" +"作用。" #: ../../library/tkinter.rst:5063 msgid "" "This shadows the inherited :meth:`Misc.selection_clear`, which clears the X " "selection; that method is not available on a :class:`Spinbox`." msgstr "" +"這會遮蔽繼承而來的 :meth:`Misc.selection_clear`(用於清除 X selection);該方" +"法在 :class:`Spinbox` 上無法使用。" #: ../../library/tkinter.rst:5069 msgid "" @@ -6695,18 +7893,22 @@ msgid "" "is selected and displayed depressed; otherwise the name of the currently " "selected element is returned." msgstr "" +"設定或取得目前選取的元素。若有給定 *element*(``'buttonup'``、" +"``'buttondown'`` 或 ``'none'`` 其中之一),則會選取該旋轉按鈕並以按下的樣式顯" +"示;否則會回傳目前選取元素的名稱。" #: ../../library/tkinter.rst:5076 msgid "" "Set the selection anchor point to just before the character given by " "*index*, without changing the selection itself." msgstr "" +"將選取錨點設為緊接在 *index* 所指定字元之前的位置,但不改變選取範圍本身。" #: ../../library/tkinter.rst:5084 msgid "" "Return ``True`` if there are characters selected in the spinbox, ``False`` " "otherwise." -msgstr "" +msgstr "若此 spinbox 中有已選取的字元則回傳 ``True``,否則回傳 ``False``。" #: ../../library/tkinter.rst:5092 msgid "" @@ -6714,6 +7916,8 @@ msgid "" "*start* and ending with the one just before *end*. If *end* refers to the " "same character as *start* or an earlier one, the selection is cleared." msgstr "" +"將選取範圍設為包含從 *start* 索引的字元開始,到 *end* 之前那個字元為止的所有" +"字元。若 *end* 所指的字元與 *start* 相同或位於其之前,則會清除選取範圍。" #: ../../library/tkinter.rst:5102 msgid "" @@ -6725,6 +7929,11 @@ msgid "" "meth:`selection_adjust` call. If the selection is not in this widget, a new " "selection is created using the most recent anchor point." msgstr "" +"將選取範圍設為 *index* 與錨點之間的範圍。若 *index* 位於錨點之前,選取範圍會" +"從 *index* 開始,直到但不包含錨點;若位於其後,選取範圍會從錨點開始,直到但不" +"包含 *index*;若兩者相同,則不會有任何動作。錨點為最近一次呼叫 :meth:" +"`selection_from` 或 :meth:`selection_adjust` 時所設定的位置。若此元件沒有選取" +"範圍,則會使用最近的錨點建立一個新的選取範圍。" #: ../../library/tkinter.rst:5118 msgid "" @@ -6738,6 +7947,13 @@ msgid "" "`~YView.yview`. Refer to the Tk ``text`` manual page for the full list of " "options." msgstr "" +":class:`!Text` 元件用於顯示與編輯多行文字。文字的部分內容可以用\\ **標籤**\\ " +"(tag)加以樣式化,特定位置可以用浮動的\\ **標記**\\ (mark)加以標註,此外還" +"可以在文字中嵌入任意的圖片與其他元件。此元件也提供不受限制的復原/重做機制," +"並支援共用相同底層資料的同儕元件(peer widget)。繼承自 :class:`Widget`、:" +"class:`XView` 和 :class:`YView`,因此可以用 :meth:`~XView.xview` 和 :meth:" +"`~YView.yview` 對檢視畫面進行水平和垂直捲動。完整的選項清單請參閱 Tk 的 " +"``text`` 手冊頁。" #: ../../library/tkinter.rst:5129 msgid "" @@ -6756,6 +7972,17 @@ msgid "" "to its base; several modifiers may be combined and are applied from left to " "right, for example ``'insert wordstart - 1 c'``." msgstr "" +"大多數方法都接受一個或多個 *index* 引數,用於指定文字中的某個位置。如 Tk " +"``text`` 手冊頁所述,索引是一個由基底(base)組成的字串,後面可選擇性地接上一" +"個或多個修飾詞(modifier)。基底可以是 ``'line.char'``\\ (第 *line* 行、第 " +"*char* 個字元,其中行號從 1 開始計數,行內字元則從 0 開始計數;``'line." +"end'`` 表示該行結尾的換行字元)、``'end'``\\ (最後一個換行字元之後的位置)、" +"標記的名稱、``'tag.first'`` 或 ``'tag.last'``\\ (標有 *tag* 標籤的第一個字" +"元,或是最後一個這類字元之後的位置)、嵌入圖片或視窗的名稱,或是 ``@x,y``\\ " +"(涵蓋此元件中像素座標 *x*、*y* 的字元)。像 ``'+5 chars'``、``'-3 lines'``、" +"``'linestart'``、``'lineend'``、``'wordstart'`` 或 ``'wordend'`` 這樣的修飾詞" +"會相對於其基底調整該索引;多個修飾詞可以組合使用,並由左至右依序套用,例如 " +"``'insert wordstart - 1 c'``。" #: ../../library/tkinter.rst:5147 msgid "" @@ -6766,6 +7993,11 @@ msgid "" "*chars* receives exactly the tags listed (a tag list may be a single tag " "name or a sequence of names), overriding the surrounding tags." msgstr "" +"將字串 *chars* 插入到 *index* 處字元之前(若 *index* 為 ``'end'``,則插入到最" +"後一個換行字元之前)。預設情況下,新文字會繼承插入點兩側都存在的所有標籤。若" +"有給定 *args*,則其由交替出現的 *tagList*、*chars* 值所組成:前一個 *chars* " +"會精確套用所列出的標籤(標籤清單可以是單一標籤名稱,或是一連串名稱),並覆蓋" +"周圍的標籤。" #: ../../library/tkinter.rst:5158 msgid "" @@ -6774,6 +8006,9 @@ msgid "" "deleted. The widget always keeps a newline as its last character, so a " "deletion that would remove it is adjusted accordingly." msgstr "" +"刪除從 *index1* 開始、直到但不包含 *index2* 的字元範圍。若省略 *index2*,則只" +"刪除 *index1* 處的單一字元。此元件的最後一個字元一律會保留換行字元,因此若刪" +"除動作會移除該字元,則會相應地調整刪除範圍。" #: ../../library/tkinter.rst:5166 msgid "" @@ -6781,6 +8016,9 @@ msgid "" "*index2* with *chars*. This is equivalent to a :meth:`delete` followed by " "an :meth:`insert` at *index1*; *args* is interpreted as for :meth:`insert`." msgstr "" +"將從 *index1* 開始、直到但不包含 *index2* 的字元範圍替換為 *chars*。這相當於" +"先呼叫 :meth:`delete`,再於 *index1* 處呼叫 :meth:`insert`;*args* 的解讀方式" +"與 :meth:`insert` 相同。" #: ../../library/tkinter.rst:5175 msgid "" @@ -6788,12 +8026,14 @@ msgid "" "If *index2* is omitted, return the single character at *index1*. Embedded " "images and windows are omitted from the result." msgstr "" +"以字串形式回傳從 *index1* 開始、直到但不包含 *index2* 的文字。若省略 " +"*index2*,則回傳 *index1* 處的單一字元。結果中不包含嵌入的圖片與視窗。" #: ../../library/tkinter.rst:5182 msgid "" "Return the position corresponding to *index* in the canonical ``'line." "char'`` form." -msgstr "" +msgstr "以標準的 ``'line.char'`` 形式回傳對應 *index* 的位置。" #: ../../library/tkinter.rst:5187 msgid "" @@ -6801,6 +8041,8 @@ msgid "" "*op*, which must be one of ``'<'``, ``'<='``, ``'=='``, ``'>='``, ``'>'`` or " "``'!='``, and return the boolean result." msgstr "" +"使用關係運算子 *op*(必須是 ``'<'``、``'<='``、``'=='``、``'>='``、``'>'`` " +"或 ``'!='`` 其中之一)比較 *index1* 和 *index2* 的位置,並回傳布林結果。" #: ../../library/tkinter.rst:5193 msgid "" @@ -6815,10 +8057,18 @@ msgid "" "return a plain integer; otherwise return a tuple with one integer per " "counting option (or ``None`` if the result is empty)." msgstr "" +"計算 *index1* 和 *index2* 之間所要求種類的項目數量;若 *index1* 在 *index2* " +"之後,則計數為負值。*options* 中的每一項都用於指定要計算的項目種類:" +"``'chars'``、``'displaychars'``、``'displayindices'``、``'displaylines'``、" +"``'indices'``、``'lines'``、``'xpixels'`` 或 ``'ypixels'``\\ (若未給定任何選" +"項,預設值為 ``'indices'``)。虛擬選項 ``'update'`` 會強制在計算後續選項之" +"前,重新計算任何過時的版面配置資訊。當 *return_ints* 為真且只給定一個計數選項" +"時,回傳一個純 int;否則回傳一個 tuple,其中每個計數選項各對應一個 int(若結" +"果為空則回傳 ``None``)。" #: ../../library/tkinter.rst:5207 msgid "Added the *return_ints* parameter." -msgstr "" +msgstr "新增 *return_ints* 參數。" #: ../../library/tkinter.rst:5213 msgid "" @@ -6827,6 +8077,9 @@ msgid "" "view the widget scrolls just enough to bring it to the nearest edge, " "otherwise it scrolls to center *index* in the window." msgstr "" +"調整檢視畫面,使 *index* 所指定的字元可見。若該字元已經可見,此方法沒有作用;" +"若該字元只稍微超出可見範圍,此元件只會捲動剛好足夠的距離,使其到達最近的邊" +"緣;否則會捲動至讓 *index* 位於視窗正中央。" #: ../../library/tkinter.rst:5220 msgid "" @@ -6834,6 +8087,8 @@ msgid "" "of the visible part of the character at *index*, or ``None`` if that " "character is not visible on the screen." msgstr "" +"回傳一個 tuple ``(x, y, width, height)``,以像素為單位表示 *index* 處字元可見" +"部分的邊界框,若該字元在螢幕上不可見,則回傳 ``None``。" #: ../../library/tkinter.rst:5229 msgid "" @@ -6843,6 +8098,9 @@ msgid "" "down from the top of the area. Return ``None`` if that display line is not " "visible on the screen." msgstr "" +"回傳一個 tuple ``(x, y, width, height, baseline)``,描述包含 *index* 的顯示" +"行:前四個值以像素表示該行的邊界框,*baseline* 則表示基準線相對於該區域頂端往" +"下量測的偏移量。若該顯示行在螢幕上不可見,則回傳 ``None``。" #: ../../library/tkinter.rst:5237 msgid "" @@ -6850,16 +8108,20 @@ msgid "" "*index*, creating the mark if it does not already exist. A mark created this " "way has right gravity by default." msgstr "" +"將名為 *markName* 的標記設定到 *index* 處字元之前的位置,若該標記尚不存在則會" +"建立它。以此方式建立的標記預設具有右側引力(right gravity)。" #: ../../library/tkinter.rst:5243 msgid "" "Remove each of the marks named in *markNames*. The special ``insert`` and " "``current`` marks may not be removed." msgstr "" +"移除 *markNames* 中所指定名稱的每個標記。特殊的 ``insert`` 和 ``current`` 標" +"記無法被移除。" #: ../../library/tkinter.rst:5248 msgid "Return a tuple of the names of all marks currently set in the widget." -msgstr "" +msgstr "回傳此元件中目前所有已設定標記名稱所組成的 tuple。" #: ../../library/tkinter.rst:5252 msgid "" @@ -6869,6 +8131,10 @@ msgid "" "position appears: a mark with right gravity (the default) stays to the right " "of such text." msgstr "" +"若省略 *direction*,則回傳標記 *markName* 的引力,為 ``'left'`` 或 " +"``'right'`` 之一。否則將其引力設為 *direction*。引力決定在該標記位置插入文字" +"時,插入的文字會出現在標記的哪一側:具有右側引力(預設值)的標記會保持在此類" +"文字的右側。" #: ../../library/tkinter.rst:5261 msgid "" @@ -6876,6 +8142,8 @@ msgid "" "is none. When *index* is the name of a mark, the search starts just after " "that mark." msgstr "" +"回傳位於 *index* 或其之後的第一個標記名稱,若沒有這樣的標記則回傳 ``None``。" +"若 *index* 為某個標記的名稱,則搜尋會從該標記之後開始。" #: ../../library/tkinter.rst:5268 msgid "" @@ -6883,6 +8151,8 @@ msgid "" "is none. When *index* is the name of a mark, the search starts just before " "that mark." msgstr "" +"回傳位於 *index* 或其之前的最後一個標記名稱,若沒有這樣的標記則回傳 " +"``None``。若 *index* 為某個標記的名稱,則搜尋會從該標記之前開始。" #: ../../library/tkinter.rst:5275 msgid "" @@ -6891,6 +8161,9 @@ msgid "" "*args* to tag additional ranges; a trailing single index tags just the " "character at that index." msgstr "" +"將標籤 *tagName* 加入到從 *index1* 開始、直到但不包含 *args* 中下一個索引的字" +"元範圍。*args* 中可以接續更多索引配對,用來標記其他範圍;若結尾為單一索引,則" +"只會標記該索引處的字元。" #: ../../library/tkinter.rst:5282 msgid "" @@ -6898,12 +8171,17 @@ msgid "" "including *index2* (or from the single character at *index1* if *index2* is " "omitted). The tag itself continues to exist even if no characters carry it." msgstr "" +"從 *index1* 開始、直到但不包含 *index2* 的字元中移除標籤 *tagName*(若省略 " +"*index2*,則只從 *index1* 處的單一字元移除)。即使沒有任何字元帶有該標籤,該" +"標籤本身仍會繼續存在。" #: ../../library/tkinter.rst:5289 msgid "" "Delete each of the tags named in *tagNames*, removing them from all " "characters and discarding their options and bindings." msgstr "" +"刪除 *tagNames* 中所指定名稱的每個標籤,將它們從所有字元中移除,並捨棄其選項" +"與繫結。" #: ../../library/tkinter.rst:5297 msgid "" @@ -6913,48 +8191,53 @@ msgid "" "the current options, otherwise it sets the given options. Defining a tag " "this way also gives it a priority higher than any existing tag." msgstr "" +"查詢或修改標籤 *tagName* 的設定選項。此方法與 :meth:`~Misc.configure` 相似," +"差別在於它作用於某個標籤,而非整個元件:若未提供任何選項,會回傳一個描述目前" +"選項的 dictionary;否則會設定所給定的選項。以此方式定義標籤,也會使其優先權高" +"於任何現有的標籤。" #: ../../library/tkinter.rst:5305 msgid "" "The supported tag options, all controlling the appearance of the tagged " "text, are:" -msgstr "" +msgstr "支援的標籤選項如下,皆用於控制標記文字的外觀:" #: ../../library/tkinter.rst:5311 msgid "*foreground*" -msgstr "" +msgstr "*foreground*" #: ../../library/tkinter.rst:5312 msgid "The color to use for the text." -msgstr "" +msgstr "用於文字的顏色。" #: ../../library/tkinter.rst:5314 msgid "*background*" -msgstr "" +msgstr "*background*" #: ../../library/tkinter.rst:5315 msgid "The color to use for the area behind the text." -msgstr "" +msgstr "用於文字背後區域的顏色。" #: ../../library/tkinter.rst:5317 msgid "*fgstipple*, *bgstipple*" -msgstr "" +msgstr "*fgstipple*, *bgstipple*" #: ../../library/tkinter.rst:5318 msgid "" "Bitmaps used to stipple the foreground (text) and the background; only well " "supported on X11." msgstr "" +"用於為前景(文字)與背景加上點紋效果的點陣圖;僅在 X11 上有良好的支援。" #: ../../library/tkinter.rst:5321 msgid "*borderwidth*" -msgstr "" +msgstr "*borderwidth*" #: ../../library/tkinter.rst:5322 msgid "" "The width of the border drawn around the text according to *relief* (default " "``0``)." -msgstr "" +msgstr "依照 *relief* 在文字周圍繪製的邊框寬度(預設為 ``0``)。" #: ../../library/tkinter.rst:5325 msgid "*relief*" @@ -6965,58 +8248,61 @@ msgid "" "The 3-D appearance of the text's border: ``'flat'`` (the default), " "``'raised'``, ``'sunken'``, ``'ridge'``, ``'groove'`` or ``'solid'``." msgstr "" +"文字邊框的立體外觀:``'flat'``\\ (預設)、``'raised'``、``'sunken'``、" +"``'ridge'``、``'groove'`` 或 ``'solid'``。" #: ../../library/tkinter.rst:5329 msgid "*offset*" -msgstr "" +msgstr "*offset*" #: ../../library/tkinter.rst:5330 msgid "" "How far the text is raised above (or, if negative, lowered below) the " "baseline, for superscripts and subscripts." -msgstr "" +msgstr "文字相對於基準線抬升(若為負值則為下降)的距離,用於上標與下標。" #: ../../library/tkinter.rst:5334 msgid "Whether to underline the text." -msgstr "" +msgstr "是否為文字加上底線。" #: ../../library/tkinter.rst:5336 msgid "*underlinefg*" -msgstr "" +msgstr "*underlinefg*" #: ../../library/tkinter.rst:5337 msgid "The color of the underline; it defaults to the text color." -msgstr "" +msgstr "底線的顏色;預設為文字的顏色。" #: ../../library/tkinter.rst:5339 msgid "*overstrike*" -msgstr "" +msgstr "*overstrike*" #: ../../library/tkinter.rst:5340 msgid "Whether to draw a line through the middle of the text." -msgstr "" +msgstr "是否在文字中間畫一條線。" #: ../../library/tkinter.rst:5342 msgid "*overstrikefg*" -msgstr "" +msgstr "*overstrikefg*" #: ../../library/tkinter.rst:5343 msgid "The color of the overstrike line; it defaults to the text color." -msgstr "" +msgstr "刪除線的顏色;預設為文字的顏色。" #: ../../library/tkinter.rst:5345 msgid "*elide*" -msgstr "" +msgstr "*elide*" #: ../../library/tkinter.rst:5346 msgid "Whether the text is elided (hidden)." -msgstr "" +msgstr "文字是否被省略(隱藏)。" #: ../../library/tkinter.rst:5349 msgid "" "How to justify the first character of a display line: ``'left'`` (the " "default), ``'right'`` or ``'center'``." msgstr "" +"顯示行首字元的對齊方式:``'left'``\\ (預設)、``'right'`` 或 ``'center'``。" #: ../../library/tkinter.rst:5352 msgid "*wrap*" @@ -7025,92 +8311,96 @@ msgstr "*wrap*" #: ../../library/tkinter.rst:5353 msgid "" "How to wrap lines that are too long: ``'char'``, ``'word'`` or ``'none'``." -msgstr "" +msgstr "過長行的換行方式:``'char'``、``'word'`` 或 ``'none'``。" #: ../../library/tkinter.rst:5356 msgid "*lmargin1*, *lmargin2*" -msgstr "" +msgstr "*lmargin1*, *lmargin2*" #: ../../library/tkinter.rst:5357 msgid "" "The indentation, in pixels, of the first display line of a logical line and " "of the remaining display lines." -msgstr "" +msgstr "邏輯行第一個顯示行,以及其餘顯示行的縮排量,以像素為單位。" #: ../../library/tkinter.rst:5360 msgid "*lmargincolor*" -msgstr "" +msgstr "*lmargincolor*" #: ../../library/tkinter.rst:5361 msgid "The color of the left margin area." -msgstr "" +msgstr "左邊界區域的顏色。" #: ../../library/tkinter.rst:5363 msgid "*rmargin*" -msgstr "" +msgstr "*rmargin*" #: ../../library/tkinter.rst:5364 msgid "The right-hand margin, in pixels." -msgstr "" +msgstr "右邊界,以像素為單位。" #: ../../library/tkinter.rst:5366 msgid "*rmargincolor*" -msgstr "" +msgstr "*rmargincolor*" #: ../../library/tkinter.rst:5367 msgid "The color of the right margin area." -msgstr "" +msgstr "右邊界區域的顏色。" #: ../../library/tkinter.rst:5369 msgid "*spacing1*, *spacing2*, *spacing3*" -msgstr "" +msgstr "*spacing1*, *spacing2*, *spacing3*" #: ../../library/tkinter.rst:5370 msgid "" "Extra space, in pixels, above the first display line of a logical line, " "between its display lines, and below its last display line." msgstr "" +"邏輯行第一個顯示行上方、各顯示行之間,以及最後一個顯示行下方的額外空間,以像" +"素為單位。" #: ../../library/tkinter.rst:5373 msgid "*tabs*" -msgstr "" +msgstr "*tabs*" #: ../../library/tkinter.rst:5374 msgid "The set of tab stops, in the same form as the widget's *tabs* option." -msgstr "" +msgstr "定位停駐點的集合,格式與此元件的 *tabs* 選項相同。" #: ../../library/tkinter.rst:5376 msgid "*tabstyle*" -msgstr "" +msgstr "*tabstyle*" #: ../../library/tkinter.rst:5377 msgid "How tab stops are interpreted: ``'tabular'`` or ``'wordprocessor'``." -msgstr "" +msgstr "定位停駐點的解讀方式:``'tabular'`` 或 ``'wordprocessor'``。" #: ../../library/tkinter.rst:5379 msgid "*selectbackground*, *selectforeground*" -msgstr "" +msgstr "*selectbackground*, *selectforeground*" #: ../../library/tkinter.rst:5380 msgid "" "The background and foreground colors used for the text while it is selected." -msgstr "" +msgstr "文字被選取時所使用的背景與前景顏色。" #: ../../library/tkinter.rst:5385 msgid "" "Tk 8.6 added the *lmargincolor*, *overstrikefg*, *rmargincolor*, " "*selectbackground*, *selectforeground* and *underlinefg* options." msgstr "" +"Tk 8.6 新增了 *lmargincolor*、*overstrikefg*、*rmargincolor*、" +"*selectbackground*、*selectforeground* 和 *underlinefg* 選項。" #: ../../library/tkinter.rst:5388 msgid ":meth:`tag_config` is an alias of :meth:`!tag_configure`." -msgstr "" +msgstr ":meth:`tag_config` 是 :meth:`!tag_configure` 的別名。" #: ../../library/tkinter.rst:5392 msgid "" "Return the current value of the configuration option *option* for the tag " "*tagName*." -msgstr "" +msgstr "回傳標籤 *tagName* 的設定選項 *option* 目前的值。" #: ../../library/tkinter.rst:5397 msgid "" @@ -7118,6 +8408,8 @@ msgid "" "the widget; otherwise return only the names of the tags applied to the " "character at *index*. The names are ordered from lowest to highest priority." msgstr "" +"若省略 *index*,則回傳此元件中所有已定義標籤名稱所組成的 tuple;否則只回傳套" +"用於 *index* 處字元的標籤名稱。這些名稱依優先權由低到高排序。" #: ../../library/tkinter.rst:5404 msgid "" @@ -7125,6 +8417,8 @@ msgid "" "*tagName*. The result alternates start and end indices, so that elements " "``2*i`` and ``2*i+1`` bound the *i*-th range." msgstr "" +"回傳一個由索引組成的 tuple,描述所有標有 *tagName* 標籤的文字範圍。結果中的起" +"始與結束索引交替出現,因此元素 ``2*i`` 和 ``2*i+1`` 界定了第 *i* 個範圍。" #: ../../library/tkinter.rst:5411 msgid "" @@ -7132,6 +8426,9 @@ msgid "" "of characters tagged with *tagName*, and return a two-element tuple of its " "start and end indices, or an empty tuple if there is no such range." msgstr "" +"從 *index1* 開始向前搜尋(若有給定 *index2*,則搜尋至該處為止),尋找第一個標" +"有 *tagName* 標籤的字元範圍,並回傳一個包含其起始與結束索引的二元素 tuple;若" +"沒有這樣的範圍,則回傳空 tuple。" #: ../../library/tkinter.rst:5418 msgid "" @@ -7140,6 +8437,9 @@ msgid "" "element tuple of its start and end indices, or an empty tuple if there is no " "such range." msgstr "" +"從 *index1* 開始向後搜尋(若有給定 *index2*,則搜尋至該處為止),尋找最靠近的" +"前一個標有 *tagName* 標籤的字元範圍,並回傳一個包含其起始與結束索引的二元素 " +"tuple;若沒有這樣的範圍,則回傳空 tuple。" #: ../../library/tkinter.rst:5425 msgid "" @@ -7148,12 +8448,17 @@ msgid "" "omitted. When the display options of overlapping tags conflict, the higher-" "priority tag wins." msgstr "" +"提高標籤 *tagName* 的優先權,使其剛好高於 *aboveThis* 的優先權;若省略 " +"*aboveThis*,則將其優先權提高至所有標籤中最高。當重疊標籤的顯示選項發生衝突" +"時,優先權較高的標籤將會勝出。" #: ../../library/tkinter.rst:5433 msgid "" "Lower the priority of tag *tagName* so that it is just below the priority of " "*belowThis*, or to the lowest priority of all tags if *belowThis* is omitted." msgstr "" +"降低標籤 *tagName* 的優先權,使其剛好低於 *belowThis* 的優先權;若省略 " +"*belowThis*,則將其優先權降低至所有標籤中最低。" #: ../../library/tkinter.rst:5439 msgid "" @@ -7163,6 +8468,10 @@ msgid "" "bindings for *sequence*, otherwise it replaces them. Works like :meth:`~Misc." "bind` and returns the identifier of the new binding." msgstr "" +"將事件 *sequence* 繫結到標有 *tagName* 標籤的字元上的回呼 *func*,使得該事件" +"發生於這類字元之上時會叫用 *func*。若 *add* 為真,此繫結會新增在 *sequence* " +"現有繫結之外;否則會取代它們。運作方式與 :meth:`~Misc.bind` 相同,並回傳新繫" +"結的識別碼。" #: ../../library/tkinter.rst:5449 msgid "" @@ -7170,6 +8479,8 @@ msgid "" "*tagName*. If *funcid* is given, only that binding (as returned by :meth:" "`tag_bind`) is removed and its callback is unregistered." msgstr "" +"移除標有 *tagName* 標籤字元上事件 *sequence* 的繫結。若有給定 *funcid*,則只" +"會移除該繫結(即 :meth:`tag_bind` 所回傳的繫結),並取消註冊其回呼函式。" #: ../../library/tkinter.rst:5460 msgid "" @@ -7179,22 +8490,28 @@ msgid "" "(the Tk image to display), *name* (a base name for the instance), *align*, " "*padx* and *pady*." msgstr "" +"在 *index* 處嵌入一張圖片,並回傳指派給此圖片實例的名稱,之後即可將該名稱當作" +"索引使用,或傳遞給其他 ``image_*`` 方法。透過 *cnf* 和 *kw* 給定的選項包括 " +"*image*(要顯示的 Tk 圖片)、*name*(此實例的基本名稱)、*align*、*padx* 和 " +"*pady*。" #: ../../library/tkinter.rst:5469 msgid "" "Return the current value of the configuration option *option* for the " "embedded image at *index*." -msgstr "" +msgstr "回傳 *index* 處嵌入圖片的設定選項 *option* 目前的值。" #: ../../library/tkinter.rst:5474 msgid "" "Query or modify the configuration options of the embedded image at *index*, " "like :meth:`~Misc.configure` but applied to that image." msgstr "" +"查詢或修改 *index* 處嵌入圖片的設定選項,作用方式與 :meth:`~Misc.configure` " +"相似,但作用於該圖片。" #: ../../library/tkinter.rst:5479 msgid "Return a tuple of the names of all images embedded in the widget." -msgstr "" +msgstr "回傳此元件中所有嵌入圖片名稱所組成的 tuple。" #: ../../library/tkinter.rst:5483 msgid "" @@ -7202,6 +8519,8 @@ msgid "" "of all images in the Tcl interpreter; that method is not available on a :" "class:`Text`." msgstr "" +"這會遮蔽繼承而來的 :meth:`Misc.image_names`(用於回傳 Tcl 直譯器中所有圖片的" +"名稱);該方法在 :class:`Text` 上無法使用。" #: ../../library/tkinter.rst:5489 msgid "" @@ -7210,26 +8529,31 @@ msgid "" "creates the widget on demand), *align*, *stretch*, *padx* and *pady*. The " "embedded widget must be a descendant of the text widget's parent." msgstr "" +"在 *index* 處嵌入一個視窗(任何元件)。透過 *cnf* 和 *kw* 給定的選項包括 " +"*window*(要嵌入的元件)、*create*(依需求建立該元件的回呼)、*align*、" +"*stretch*、*padx* 和 *pady*。嵌入的元件必須是此 text 元件之父元件的子代。" #: ../../library/tkinter.rst:5497 msgid "" "Return the current value of the configuration option *option* for the " "embedded window at *index*." -msgstr "" +msgstr "回傳 *index* 處嵌入視窗的設定選項 *option* 目前的值。" #: ../../library/tkinter.rst:5505 msgid "" "Query or modify the configuration options of the embedded window at *index*, " "like :meth:`~Misc.configure` but applied to that window." msgstr "" +"查詢或修改 *index* 處嵌入視窗的設定選項,作用方式與 :meth:`~Misc.configure` " +"相似,但作用於該視窗。" #: ../../library/tkinter.rst:5508 msgid ":meth:`window_config` is an alias of :meth:`!window_configure`." -msgstr "" +msgstr ":meth:`window_config` 是 :meth:`!window_configure` 的別名。" #: ../../library/tkinter.rst:5512 msgid "Return a tuple of the names of all windows embedded in the widget." -msgstr "" +msgstr "回傳此元件中所有嵌入視窗名稱所組成的 tuple。" #: ../../library/tkinter.rst:5516 msgid "" @@ -7238,6 +8562,9 @@ msgid "" "and its arguments. The :meth:`!edit_\\*` methods below are thin wrappers " "around it and are usually more convenient." msgstr "" +"這是 Tk ``edit`` 元件指令的低階封裝,用於控制復原/重做機制與已修改旗標;" +"*args* 為 ``edit`` 子指令及其引數。下方的 :meth:`!edit_\\*` 方法是它的薄封" +"裝,通常較為方便使用。" #: ../../library/tkinter.rst:5524 msgid "" @@ -7245,6 +8572,8 @@ msgid "" "or ``1``; the flag is set automatically whenever the text is inserted or " "deleted. Otherwise set the flag to the boolean *arg*." msgstr "" +"若省略 *arg*,則以 ``0`` 或 ``1`` 回傳已修改旗標目前的狀態;每當文字被插入或" +"刪除時,此旗標都會自動設定。否則將該旗標設為布林值 *arg*。" #: ../../library/tkinter.rst:5531 msgid "" @@ -7254,6 +8583,10 @@ msgid "" "unless the *undo* option is true. Since Tk 9.0, returns a tuple of indices " "delimiting the ranges of text that were changed." msgstr "" +"復原最近一次的編輯動作,也就是自上一個分隔符(separator)以來,記錄在復原堆疊" +"上的所有插入與刪除動作,並將其移至重做堆疊。若復原堆疊為空,則引發 :exc:" +"`TclError`。除非 *undo* 選項為真,否則此方法沒有作用。自 Tk 9.0 起,會回傳一" +"個索引 tuple,用於界定發生變更的文字範圍。" #: ../../library/tkinter.rst:5541 msgid "" @@ -7263,10 +8596,14 @@ msgid "" "Since Tk 9.0, returns a tuple of indices delimiting the ranges of text that " "were changed." msgstr "" +"只要在此之後沒有進行其他編輯,就重新套用最近一次被復原的編輯動作,並將其移回" +"復原堆疊。若重做堆疊為空,則引發 :exc:`TclError`。除非 *undo* 選項為真,否則" +"此方法沒有作用。自 Tk 9.0 起,會回傳一個索引 tuple,用於界定發生變更的文字範" +"圍。" #: ../../library/tkinter.rst:5550 msgid "Clear the undo and redo stacks." -msgstr "" +msgstr "清除復原與重做堆疊。" #: ../../library/tkinter.rst:5554 msgid "" @@ -7275,6 +8612,9 @@ msgid "" "Separators are inserted automatically when the *autoseparators* option is " "true." msgstr "" +"將一個分隔符推入復原堆疊,用於標記復原與重做編輯動作之間的邊界。除非 *undo* " +"選項為真,否則此方法沒有作用。當 *autoseparators* 選項為真時,會自動插入分隔" +"符。" #: ../../library/tkinter.rst:5562 msgid "" @@ -7289,6 +8629,13 @@ msgid "" "*count* is a :class:`Variable`, the number of index positions in the match " "is stored in it." msgstr "" +"從 *index* 開始搜尋 *pattern*,並回傳第一個相符結果之第一個字元的索引,若沒有" +"相符結果則回傳空字串。若有給定 *stopindex*,搜尋會在該處停止;否則會在文字的" +"兩端循環搜尋,直到再次回到起始位置為止。下列布林關鍵字旗標可用於控制搜尋:" +"*forwards* 或 *backwards* 選擇搜尋方向(預設為向前);*exact*(預設)或 " +"*regexp* 選擇字面比對或正規表示式比對;*nocase* 使比對不區分大小寫;而 " +"*elide* 會使隱藏文字也一併被搜尋。若 *count* 為 :class:`Variable`,則相符結果" +"中的索引位置數量會被存入其中。" #: ../../library/tkinter.rst:5584 msgid "" @@ -7297,6 +8644,8 @@ msgid "" "bound to mouse motion events, producing the effect of dragging the text at " "high speed through the window." msgstr "" +"依據 *x*、*y* 與最近一次呼叫 :meth:`scan_mark` 時所傳入座標之間差值的 10 倍來" +"捲動此元件。這通常會繫結至滑鼠移動事件,產生以高速拖曳文字穿過視窗的效果。" #: ../../library/tkinter.rst:5591 msgid "" @@ -7305,6 +8654,9 @@ msgid "" "setting is shared by all text widgets and may noticeably slow down widgets " "holding large amounts of text." msgstr "" +"如果省略 *boolean*,則回傳是否已啟用 B-tree 資料結構的內部一致性檢查;否則會" +"啟用或停用這些檢查。此設定由所有文字元件共用,且可能會明顯拖慢持有大量文字之" +"元件的執行速度。" #: ../../library/tkinter.rst:5599 msgid "" @@ -7318,6 +8670,14 @@ msgid "" "selected kinds. If *command* is given, it is called once per triple with the " "three values as arguments and nothing is returned." msgstr "" +"回傳元件從 *index1* 到(但不包括)*index2* 之間的內容(如果省略 *index2*,則" +"只回傳 *index1* 處的片段),包括文字以及有關標記、標籤、圖片和視窗的資訊。結" +"果是一個由 ``(key, value, index)`` 三元組組成的 list,其中 *key* 為 " +"``'text'``、``'mark'``、``'tagon'``、``'tagoff'``、``'image'`` 或 " +"``'window'``\\ 之一。預設情況下會回報所有種類;將關鍵字引數 *all*、*text*、" +"*mark*、*tag*、*image* 或 *window* 中的任何一個傳入 true,可將傾印限制在所選" +"的種類。如果有給定 *command*,則會針對每個三元組呼叫一次,並以這三個值作為引" +"數,且不會回傳任何內容。" #: ../../library/tkinter.rst:5613 msgid "" @@ -7327,22 +8687,28 @@ msgid "" "peer covers the same lines as this widget; standard text options, including " "*startline* and *endline*, may be given to override this." msgstr "" +"建立一個路徑名稱為 *newPathName* 的對等文字元件,它會共用此元件底層的資料(文" +"字、標記、標籤、圖片和復原堆疊)。透過任何對等元件所做的變更都會反映在所有對" +"等元件上。預設情況下,對等元件會涵蓋與此元件相同的行;可以提供標準的文字選項" +"(包括 *startline* 和 *endline*)來覆寫此行為。" #: ../../library/tkinter.rst:5625 msgid "" "Return a tuple of the path names of this widget's peers, not including the " "widget itself." -msgstr "" +msgstr "回傳此元件所有對等元件的路徑名稱組成的 tuple,不包括該元件本身。" #: ../../library/tkinter.rst:5632 msgid "" "Adjust the view so that the location given by *what* is visible. This is an " "obsolete equivalent of :meth:`see`, which should be used instead." msgstr "" +"調整檢視區使得由 *what* 指定的位置可見。這是已過時的 :meth:`see` 等價方法,應" +"改用後者。" #: ../../library/tkinter.rst:5638 msgid "Variable classes" -msgstr "" +msgstr "變數類別" #: ../../library/tkinter.rst:5642 msgid "" @@ -7352,6 +8718,10 @@ msgid "" "so that changes propagate both ways: updating the variable updates every " "widget bound to it, and a user editing such a widget updates the variable." msgstr "" +"Tk 變數包裝器的基底類別。Tk 變數是儲存在 Tcl 直譯器中的一個值,可以透過元件" +"的 *variable* 或 *textvariable* 選項將其連結至元件(請參閱 :ref:`coupling-" +"widget-variables`),如此一來變更會雙向傳播:更新變數會更新所有綁定至該變數的" +"元件,而使用者編輯該元件也會更新變數。" #: ../../library/tkinter.rst:5649 msgid "" @@ -7362,6 +8732,10 @@ msgid "" "generated. If *name* matches an existing variable and *value* is omitted, " "the existing value is retained." msgstr "" +"*master* 是擁有該變數之 Tcl 直譯器所屬的元件;如果省略,則使用預設的根視窗。" +"*value* 是初始值;如果省略,則使用型別特定的預設值。*name* 是該變數在 Tcl 直" +"譯器中的名稱;如果省略,則會產生一個形式為 ``'PY_VARnum'`` 的唯一名稱。如果 " +"*name* 符合現有的變數,且省略 *value*,則會保留現有的值。" #: ../../library/tkinter.rst:5657 msgid "" @@ -7369,12 +8743,17 @@ msgid "" "`StringVar`, :class:`IntVar`, :class:`DoubleVar` or :class:`BooleanVar` -- " "rather than :class:`!Variable` directly." msgstr "" +"在大多數情況下,你應該使用下面型別化的子類別之一 -- :class:`StringVar`、:" +"class:`IntVar`、:class:`DoubleVar` 或 :class:`BooleanVar` -- 而非直接使用 :" +"class:`!Variable`。" #: ../../library/tkinter.rst:5661 msgid "" "Two variables now compare equal (``==``) only when they have the same name, " "are of the same class, and belong to the same Tcl interpreter." msgstr "" +"現在只有當兩個變數的名稱相同、類別相同且屬於同一個 Tcl 直譯器時,比較" +"(``==``)才會相等。" #: ../../library/tkinter.rst:5667 msgid "" @@ -7382,15 +8761,17 @@ msgid "" "returned as a string; the typed subclasses convert it to the appropriate " "Python type." msgstr "" +"回傳變數目前的值。對於基底類別,該值會以字串形式回傳;型別化的子類別則會將其" +"轉換為適當的 Python 型別。" #: ../../library/tkinter.rst:5676 msgid "" "Set the variable to *value*. :meth:`initialize` is an alias of :meth:`!set`." -msgstr "" +msgstr "將變數設為 *value*。:meth:`initialize` 是 :meth:`!set` 的別名。" #: ../../library/tkinter.rst:5679 ../../library/tkinter.rst:5810 msgid "The *initialize* spelling." -msgstr "" +msgstr "*initialize* 拼寫方式。" #: ../../library/tkinter.rst:5684 msgid "" @@ -7398,6 +8779,9 @@ msgid "" "*mode*. *mode* is one of the strings ``'array'``, ``'read'``, ``'write'`` or " "``'unset'``, or a list or tuple of such strings." msgstr "" +"註冊 *callback*,使其在變數依照 *mode* 被存取時被呼叫。*mode* 為字串 " +"``'array'``、``'read'``、``'write'`` 或 ``'unset'`` 之一,或是這些字串所組成" +"的 list 或 tuple。" #: ../../library/tkinter.rst:5689 msgid "" @@ -7405,12 +8789,14 @@ msgid "" "Tcl variable, an index (or an empty string if the variable is not an element " "of an array), and the *mode* that triggered the call." msgstr "" +"觸發時,*callback* 會以三個引數被呼叫:Tcl 變數的名稱、索引(如果該變數不是陣" +"列的元素,則為空字串),以及觸發此次呼叫的 *mode*。" #: ../../library/tkinter.rst:5693 msgid "" "Return the internal name of the registered callback, which can be passed to :" "meth:`trace_remove`." -msgstr "" +msgstr "回傳已註冊回呼的內部名稱,該名稱可以傳入 :meth:`trace_remove`。" #: ../../library/tkinter.rst:5700 msgid "" @@ -7418,6 +8804,8 @@ msgid "" "was passed to :meth:`trace_add`, and *cbname* is the callback name returned " "by :meth:`trace_add`." msgstr "" +"從變數中移除一個追蹤回呼。*mode* 必須符合傳給 :meth:`trace_add` 的 *mode*," +"而 *cbname* 則是 :meth:`trace_add` 所回傳的回呼名稱。" #: ../../library/tkinter.rst:5708 msgid "" @@ -7425,6 +8813,8 @@ msgid "" "set on the variable, where *modes* is a tuple of mode strings and *cbname* " "is the internal callback name." msgstr "" +"回傳一個由 ``(modes, cbname)`` 配對組成的 list,用於描述目前設定在該變數上的" +"所有追蹤,其中 *modes* 是模式字串組成的 tuple,*cbname* 則是內部的回呼名稱。" #: ../../library/tkinter.rst:5719 msgid "" @@ -7433,66 +8823,75 @@ msgid "" "write or unset. Return the internal name of the registered callback. :meth:" "`trace` is an alias of :meth:`!trace_variable`." msgstr "" +"註冊 *callback*,使其在變數依照 *mode* 被存取時被呼叫。*mode* 為字串 " +"``'r'``、``'w'`` 或 ``'u'`` 之一,分別代表讀取、寫入或取消設定。回傳已註冊回" +"呼的內部名稱。:meth:`trace` 是 :meth:`!trace_variable` 的別名。" #: ../../library/tkinter.rst:5726 msgid "" "Use :meth:`trace_add` instead. This method wraps a Tcl feature that was " "removed in Tcl 9.0." msgstr "" +"請改用 :meth:`trace_add`。此方法包裝了一個已在 Tcl 9.0 中移除的 Tcl 功能。" #: ../../library/tkinter.rst:5732 msgid "" "Remove the trace callback named *cbname* registered for *mode* with :meth:" "`trace_variable`." msgstr "" +"移除以 :meth:`trace_variable` 為 *mode* 註冊、名為 *cbname* 的追蹤回呼。" #: ../../library/tkinter.rst:5735 msgid "" "Use :meth:`trace_remove` instead. This method wraps a Tcl feature that was " "removed in Tcl 9.0." msgstr "" +"請改用 :meth:`trace_remove`。此方法包裝了一個已在 Tcl 9.0 中移除的 Tcl 功能。" #: ../../library/tkinter.rst:5741 msgid "" "Return a list of ``(mode, cbname)`` pairs for all traces set on the variable " "with :meth:`trace_variable`." msgstr "" +"回傳一個由 ``(mode, cbname)`` 配對組成的 list,代表以 :meth:`trace_variable` " +"設定在該變數上的所有追蹤。" #: ../../library/tkinter.rst:5744 msgid "" "Use :meth:`trace_info` instead. This method wraps a Tcl feature that was " "removed in Tcl 9.0." msgstr "" +"請改用 :meth:`trace_info`。此方法包裝了一個已在 Tcl 9.0 中移除的 Tcl 功能。" #: ../../library/tkinter.rst:5751 msgid "" "A :class:`Variable` subclass that holds a string. The default value is " "``''``." -msgstr "" +msgstr "一個持有字串的 :class:`Variable` 子類別。預設值為 ``''``。" #: ../../library/tkinter.rst:5756 msgid "Return the value of the variable as a :class:`str`." -msgstr "" +msgstr "以 :class:`str` 回傳變數的值。" #: ../../library/tkinter.rst:5761 msgid "" "A :class:`Variable` subclass that holds an integer. The default value is " "``0``." -msgstr "" +msgstr "一個持有整數的 :class:`Variable` 子類別。預設值為 ``0``。" #: ../../library/tkinter.rst:5766 msgid "Return the value of the variable as an :class:`int`." -msgstr "" +msgstr "以 :class:`int` 回傳變數的值。" #: ../../library/tkinter.rst:5771 msgid "" "A :class:`Variable` subclass that holds a float. The default value is " "``0.0``." -msgstr "" +msgstr "一個持有浮點數的 :class:`Variable` 子類別。預設值為 ``0.0``。" #: ../../library/tkinter.rst:5776 msgid "Return the value of the variable as a :class:`float`." -msgstr "" +msgstr "以 :class:`float` 回傳變數的值。" #: ../../library/tkinter.rst:5782 msgid "" @@ -7503,24 +8902,33 @@ msgid "" "cannot read, raising :exc:`TclError`. Set ``LC_NUMERIC`` to a locale that " "uses a period (such as ``'C'``) to avoid this." msgstr "" +"浮點數值一律以句點(``.``)作為小數點分隔符號來剖析,但 :class:`Spinbox`、:" +"class:`Scale` 和 :class:`ttk.Spinbox ` 會依照 " +"``LC_NUMERIC`` 區域設定來格式化它。在使用逗號的區域設定下,它們會產生一個 :" +"meth:`get` 無法讀取的值,並引發 :exc:`TclError`。請將 ``LC_NUMERIC`` 設為使用" +"句點的區域設定(例如 ``'C'``)以避免此問題。" #: ../../library/tkinter.rst:5793 msgid "" "A :class:`Variable` subclass that holds a boolean. The default value is " "``False``." -msgstr "" +msgstr "一個持有布林值的 :class:`Variable` 子類別。預設值為 ``False``。" #: ../../library/tkinter.rst:5798 msgid "" "Return the value of the variable as a :class:`bool`. Raise a :exc:" "`ValueError` if the value cannot be interpreted as a boolean." msgstr "" +"以 :class:`bool` 回傳變數的值。如果該值無法被解讀為布林值,則引發 :exc:" +"`ValueError`。" #: ../../library/tkinter.rst:5807 msgid "" "Set the variable to *value*, converting it to a boolean. :meth:`initialize` " "is an alias of :meth:`!set`." msgstr "" +"將變數設為 *value*,並將其轉換為布林值。:meth:`initialize` 是 :meth:`!set` 的" +"別名。" #: ../../library/tkinter.rst:5815 msgid "Image classes" @@ -7534,6 +8942,10 @@ msgid "" "object deletes the underlying Tk image. Usually you create a :class:" "`PhotoImage` or :class:`BitmapImage` rather than an :class:`!Image` directly." msgstr "" +"Tk 圖片的基底類別。*imgtype* 是 Tk 圖片型別,為 ``'photo'`` 或 ``'bitmap'`` " +"之一。圖片是一個具名物件,可以透過元件的 *image* 選項顯示;刪除對 :class:`!" +"Image` 物件的所有參照,會刪除底層的 Tk 圖片。通常你會建立 :class:" +"`PhotoImage` 或 :class:`BitmapImage`,而不是直接建立 :class:`!Image`。" #: ../../library/tkinter.rst:5827 msgid "" @@ -7541,6 +8953,8 @@ msgid "" "queried and changed later with the mapping protocol (using ``image[key]``) " "or with the :meth:`configure` method." msgstr "" +"圖片的設定選項由 *cnf* 和 *kw* 給定,之後可以使用對映協定(透過 " +"``image[key]``)或 :meth:`configure` 方法來查詢和變更。" #: ../../library/tkinter.rst:5836 msgid "" @@ -7548,20 +8962,25 @@ msgid "" "depend on the image type; see :class:`PhotoImage` and :class:`BitmapImage`. :" "meth:`config` is an alias of :meth:`!configure`." msgstr "" +"修改圖片的一個或多個設定選項。有效的選項取決於圖片型別;請參閱 :class:" +"`PhotoImage` 和 :class:`BitmapImage`。:meth:`config` 是 :meth:`!configure` 的" +"別名。" #: ../../library/tkinter.rst:5843 msgid "Return the height of the image, in pixels." -msgstr "" +msgstr "以像素為單位,回傳圖片的高度。" #: ../../library/tkinter.rst:5847 msgid "Return the width of the image, in pixels." -msgstr "" +msgstr "以像素為單位,回傳圖片的寬度。" #: ../../library/tkinter.rst:5851 msgid "" "Return the type of the image, that is the value of *imgtype* with which it " "was created (for example ``'photo'`` or ``'bitmap'``)." msgstr "" +"回傳圖片的型別,即建立圖片時使用的 *imgtype* 值(例如 ``'photo'`` 或 " +"``'bitmap'``)。" #: ../../library/tkinter.rst:5857 msgid "" @@ -7570,6 +8989,9 @@ msgid "" "and (in Tk 8.6 and later) PNG files, read SVG files (in Tk 9.0 and later), " "and be drawn in widgets. Inherits from :class:`Image`." msgstr "" +"全彩圖片(Tk 的 ``photo`` 圖片型別),內部以每個像素不同程度的透明度儲存。它" +"可以讀寫 GIF、PPM/PGM 檔案,以及(在 Tk 8.6 及以後版本中)PNG 檔案,讀取 SVG " +"檔案(在 Tk 9.0 及以後版本中),並可繪製在元件中。繼承自 :class:`Image`。" #: ../../library/tkinter.rst:5863 msgid "" @@ -7578,6 +9000,9 @@ msgid "" "the file format handler), *width* and *height* (the size of the image, used " "when building it up piece by piece), *gamma* and *palette*." msgstr "" +"設定選項包括 *data*(以字串表示的圖片內容)、*file*(要讀取內容的檔案名稱)、" +"*format*(檔案格式處理常式的名稱)、*width* 和 *height*(圖片的大小,用於逐步" +"建構圖片時使用)、*gamma* 和 *palette*。" #: ../../library/tkinter.rst:5870 msgid "" @@ -7585,14 +9010,16 @@ msgid "" "is displayed as transparent and the background of whatever window it is " "displayed in shows through." msgstr "" +"清空圖片;也就是說,將整個圖片設為沒有資料,使其顯示為透明,並讓其所顯示之視" +"窗的背景透出來。" #: ../../library/tkinter.rst:5876 msgid "Return the current value of the configuration option *option*." -msgstr "" +msgstr "回傳設定選項 *option* 目前的值。" #: ../../library/tkinter.rst:5880 msgid "Return a new :class:`PhotoImage` with a copy of this image." -msgstr "" +msgstr "回傳一個新的 :class:`PhotoImage`,其內容是此圖片的複本。" #: ../../library/tkinter.rst:5882 msgid "" @@ -7604,6 +9031,11 @@ msgid "" "and top edges of the rectangle but not the bottom or right edges. If " "*from_coords* is not given, the whole source image is copied." msgstr "" +"*from_coords* 指定要複製的來源圖片矩形子區域。它必須是一個由 1 到 4 個整數組" +"成的 tuple 或 list,即 ``(x1, y1, x2, y2)``。``(x1, y1)`` 和 ``(x2, y2)`` 指" +"定矩形的對角頂點。如果未指定 *x2* 和 *y2*,則預設為來源圖片的右下角。所複製的" +"像素包括矩形的左邊和上邊,但不包括下邊和右邊。如果未給定 *from_coords*,則會" +"複製整個來源圖片。" #: ../../library/tkinter.rst:5893 ../../library/tkinter.rst:5925 msgid "" @@ -7611,10 +9043,12 @@ msgid "" "meth:`zoom` or :meth:`subsample` methods. The value must be a single integer " "or a pair of integers." msgstr "" +"如果指定了 *zoom* 或 *subsample*,圖片會依照 :meth:`zoom` 或 :meth:" +"`subsample` 方法的方式進行轉換。此值必須是單一整數或一對整數。" #: ../../library/tkinter.rst:5897 msgid "Added the *from_coords*, *zoom* and *subsample* parameters." -msgstr "" +msgstr "新增了 *from_coords*、*zoom* 和 *subsample* 參數。" #: ../../library/tkinter.rst:5905 msgid "" @@ -7623,13 +9057,16 @@ msgid "" "are specified, the whole of *sourceImage* is copied into this image, " "starting at coordinates ``(0, 0)``." msgstr "" +"將 *sourceImage*(必須是 :class:`PhotoImage`)中的某個區域複製到此圖片中,可" +"能會進行像素縮放和/或次取樣。如果沒有指定任何選項,則會將整個 *sourceImage* " +"複製到此圖片,從座標 ``(0, 0)`` 開始。" #: ../../library/tkinter.rst:5910 ../../library/tkinter.rst:6022 #: ../../library/tkinter.rst:6078 msgid "" "*from_coords* specifies a rectangular sub-region of the source image to be " "copied, as in the :meth:`copy` method." -msgstr "" +msgstr "*from_coords* 指定要複製的來源圖片矩形子區域,如同 :meth:`copy` 方法。" #: ../../library/tkinter.rst:5913 msgid "" @@ -7640,6 +9077,11 @@ msgid "" "If *x2* and *y2* are specified, the source region is replicated if necessary " "to fill the destination region in a tiled fashion." msgstr "" +"*to* 指定目的圖片中要受影響的矩形子區域。它必須是一個由 1 到 4 個整數組成的 " +"tuple 或 list,即 ``(x1, y1, x2, y2)``。如果未指定 *x2* 和 *y2*,則預設為 " +"``(x1, y1)`` 加上來源區域的大小(如果有指定次取樣和縮放,則為次取樣和縮放後的" +"大小)。如果有指定 *x2* 和 *y2*,且有必要的話,來源區域會以並排方式複製,以填" +"滿目的區域。" #: ../../library/tkinter.rst:5921 msgid "" @@ -7647,6 +9089,8 @@ msgid "" "necessary, so that the region being copied into is at the bottom-right " "corner of the image." msgstr "" +"如果 *shrink* 為 true,則會在必要時縮小目的圖片的大小,使被複製的區域位於圖片" +"的右下角。" #: ../../library/tkinter.rst:5929 msgid "" @@ -7657,10 +9101,14 @@ msgid "" "destination. With ``'set'``, the old contents of the destination image are " "discarded and the source image is used as-is." msgstr "" +"*compositingrule* 指定來源圖片中的透明像素要如何與目的圖片結合。使用預設值 " +"``'overlay'`` 時,目的圖片原有的內容仍然可見,如同來源圖片被印在一張透明底片" +"上,並疊放在目的圖片之上。使用 ``'set'`` 時,目的圖片原有的內容會被捨棄,並直" +"接使用來源圖片。" #: ../../library/tkinter.rst:5943 msgid "Return the image data." -msgstr "" +msgstr "回傳圖片資料。" #: ../../library/tkinter.rst:5945 msgid "" @@ -7669,6 +9117,9 @@ msgid "" "strings containing space-separated (one element per pixel/column) colors in " "``#RRGGBB`` format." msgstr "" +"*format* 指定要使用的圖片檔案格式處理常式名稱。如果未給定,則資料會以 tuple " +"形式回傳(每列一個元素),每個元素為一個字串,內含以空格分隔的顏色(每個像素/" +"欄一個元素),格式為 ``#RRGGBB``。" #: ../../library/tkinter.rst:5950 msgid "" @@ -7680,6 +9131,11 @@ msgid "" "and excluding ``(x2, y2)``. If *from_coords* is not given, the whole image " "is returned." msgstr "" +"*from_coords* 指定要回傳的圖片矩形區域。它必須是一個由 1 到 4 個整數組成的 " +"tuple 或 list,即 ``(x1, y1, x2, y2)``。如果只指定 *x1* 和 *y1*,則區域會從 " +"``(x1, y1)`` 延伸到圖片的右下角。如果指定了全部四個座標,則它們會指定該區域的" +"對角頂點,包含 ``(x1, y1)`` 但不包含 ``(x2, y2)``。如果未給定 *from_coords*," +"則會回傳整張圖片。" #: ../../library/tkinter.rst:5958 ../../library/tkinter.rst:6061 msgid "" @@ -7687,12 +9143,16 @@ msgid "" "information; in all transparent pixels the color is replaced by the " "specified color." msgstr "" +"如果有指定 *background*,資料就不會包含任何透明度資訊;所有透明像素的顏色都會" +"被替換為指定的顏色。" #: ../../library/tkinter.rst:5962 ../../library/tkinter.rst:6065 msgid "" "If *grayscale* is true, the data does not contain color information; all " "pixel data is transformed into grayscale." msgstr "" +"如果 *grayscale* 為 true,資料就不會包含顏色資訊;所有像素資料都會被轉換為灰" +"階。" #: ../../library/tkinter.rst:5970 msgid "" @@ -7700,6 +9160,8 @@ msgid "" "tuple of three integers between 0 and 255, representing the red, green and " "blue components respectively." msgstr "" +"以介於 0 到 255 之間的三個整數組成的 ``(r, g, b)`` tuple,回傳座標 (*x*, " +"*y*) 處像素的顏色,分別代表紅、綠、藍分量。" #: ../../library/tkinter.rst:5976 msgid "" @@ -7707,6 +9169,8 @@ msgid "" "string or a nested sequence of horizontal rows of pixel colors (for example " "``\"{red green} {blue yellow}\"``)." msgstr "" +"將圖片的像素設為 *data* 中給定的顏色,*data* 必須是一個字串,或是由像素顏色列" +"組成的巢狀序列(例如 ``\"{red green} {blue yellow}\"``)。" #: ../../library/tkinter.rst:5980 msgid "" @@ -7715,14 +9179,17 @@ msgid "" "y1)`` or ``(x1, y1, x2, y2)`` giving the top-left corner, and optionally the " "bottom-right corner, of the region. The default position is ``(0, 0)``." msgstr "" +"*to* 指定資料要被複製到的圖片區域座標。它必須是一個由 2 或 4 個整數組成的 " +"tuple 或 list,即 ``(x1, y1)`` 或 ``(x1, y1, x2, y2)``,用於給定該區域的左上" +"角,並可選擇性地給定右下角。預設位置為 ``(0, 0)``。" #: ../../library/tkinter.rst:5990 msgid "Read image data from the file named *filename* into the image." -msgstr "" +msgstr "從名為 *filename* 的檔案中讀取圖片資料到此圖片。" #: ../../library/tkinter.rst:5992 msgid "*format* specifies the format of the image data in the file." -msgstr "" +msgstr "*format* 指定檔案中圖片資料的格式。" #: ../../library/tkinter.rst:5994 msgid "" @@ -7734,12 +9201,17 @@ msgid "" "opposite corners of the region. If *from_coords* is not given, the whole of " "the image in the file is read." msgstr "" +"*from_coords* 指定要複製到目的圖片的圖片檔案資料矩形子區域。它必須是一個由 1 " +"到 4 個整數組成的 tuple 或 list,即 ``(x1, y1, x2, y2)``。如果只指定 *x1* 和 " +"*y1*,則區域會從 ``(x1, y1)`` 延伸到檔案中圖片的右下角。如果指定了全部四個座" +"標,則它們會指定該區域的對角頂點。如果未給定 *from_coords*,則會讀取檔案中的" +"整張圖片。" #: ../../library/tkinter.rst:6004 msgid "" "*to* specifies the coordinates of the top-left corner of the region of the " "image into which the data are read. The default is ``(0, 0)``." -msgstr "" +msgstr "*to* 指定資料要被讀入之圖片區域左上角的座標。預設為 ``(0, 0)``。" #: ../../library/tkinter.rst:6008 msgid "" @@ -7747,6 +9219,8 @@ msgid "" "the region into which the file data are read is at the bottom-right corner " "of the image." msgstr "" +"如果 *shrink* 為 true,則會在必要時縮小圖片的大小,使檔案資料被讀入的區域位於" +"圖片的右下角。" #: ../../library/tkinter.rst:6017 msgid "" @@ -7754,32 +9228,39 @@ msgid "" "*x*-th pixel in the X direction and every *y*-th pixel in the Y direction. " "If *y* is not given, it defaults to the same value as *x*." msgstr "" +"回傳一個新的 :class:`PhotoImage`,其以此圖片為基礎,但僅使用 X 方向每隔 *x* " +"個像素及 Y 方向每隔 *y* 個像素的像素。如果未給定 *y*,則預設與 *x* 相同。" #: ../../library/tkinter.rst:6025 ../../library/tkinter.rst:6081 msgid "Added the *from_coords* parameter." -msgstr "" +msgstr "新增了 *from_coords* 參數。" #: ../../library/tkinter.rst:6031 msgid "" "Return ``True`` if the pixel at coordinates (*x*, *y*) is fully transparent, " "``False`` otherwise." msgstr "" +"如果座標 (*x*, *y*) 處的像素完全透明,則回傳 ``True``,否則回傳 ``False``。" #: ../../library/tkinter.rst:6039 msgid "" "Make the pixel at coordinates (*x*, *y*) fully transparent if *boolean* is " "true, fully opaque otherwise." msgstr "" +"如果 *boolean* 為 true,則使座標 (*x*, *y*) 處的像素完全透明,否則使其完全不" +"透明。" #: ../../library/tkinter.rst:6048 msgid "Write image data from the image to the file named *filename*." -msgstr "" +msgstr "將圖片資料從圖片寫入到名為 *filename* 的檔案。" #: ../../library/tkinter.rst:6050 msgid "" "*format* specifies the name of the image file format handler to use. If it " "is not given, the format is guessed from the file extension." msgstr "" +"*format* 指定要使用的圖片檔案格式處理常式名稱。如果未給定,則會從檔案副檔名猜" +"測格式。" #: ../../library/tkinter.rst:6053 msgid "" @@ -7790,10 +9271,14 @@ msgid "" "specify diagonally opposite corners of the region. If *from_coords* is not " "given, the whole image is written." msgstr "" +"*from_coords* 指定要寫入的圖片矩形區域。它必須是一個由 1 到 4 個整數組成的 " +"tuple 或 list,即 ``(x1, y1, x2, y2)``。如果只指定 *x1* 和 *y1*,則區域會從 " +"``(x1, y1)`` 延伸到圖片的右下角。如果指定了全部四個座標,則它們會指定該區域的" +"對角頂點。如果未給定 *from_coords*,則會寫入整張圖片。" #: ../../library/tkinter.rst:6068 msgid "Added the *background* and *grayscale* parameters." -msgstr "" +msgstr "新增了 *background* 和 *grayscale* 參數。" #: ../../library/tkinter.rst:6074 msgid "" @@ -7801,6 +9286,8 @@ msgid "" "*x* in the X direction and *y* in the Y direction. If *y* is not given, it " "defaults to the same value as *x*." msgstr "" +"回傳一個新的 :class:`PhotoImage`,其為此圖片在 X 方向放大 *x* 倍、Y 方向放大 " +"*y* 倍後的結果。如果未給定 *y*,則預設與 *x* 相同。" #: ../../library/tkinter.rst:6088 msgid "" @@ -7808,6 +9295,8 @@ msgid "" "Each pixel displays a foreground color, a background color, or nothing " "(producing a transparent effect). Inherits from :class:`Image`." msgstr "" +"雙色圖片(Tk 的 ``bitmap`` 圖片型別),由 X11 點陣圖建立而成。每個像素會顯示" +"前景色、背景色,或什麼都不顯示(產生透明效果)。繼承自 :class:`Image`。" #: ../../library/tkinter.rst:6093 msgid "" @@ -7820,16 +9309,22 @@ msgid "" "zero. If *background* is set to an empty string, the background pixels are " "transparent." msgstr "" +"設定選項為 *data* 或 *file*(來源點陣圖,以 X11 點陣圖格式的字串或該格式檔案" +"的名稱給定)、*maskdata* 或 *maskfile*(遮罩點陣圖,形式相同),以及 " +"*foreground* 和 *background*(這兩種顏色)。對於遮罩為零的像素,圖片不顯示任" +"何內容;對於其他像素,來源為一的地方顯示前景色,來源為零的地方顯示背景色。如" +"果 *background* 設為空字串,則背景像素為透明。" #: ../../library/tkinter.rst:6103 msgid "" ":class:`!BitmapImage` has no methods of its own beyond those inherited from :" "class:`Image`." msgstr "" +":class:`!BitmapImage` 除了繼承自 :class:`Image` 的方法之外,沒有自己的方法。" #: ../../library/tkinter.rst:6108 msgid "Other classes" -msgstr "" +msgstr "其他類別" #: ../../library/tkinter.rst:6112 msgid "" @@ -7839,76 +9334,80 @@ msgid "" "event type, some attributes may be set to the string ``'??'`` to indicate " "that they are not meaningful. See :ref:`bindings-and-events`." msgstr "" +"綁定在 :meth:`Misc.bind` 上之回呼所傳入事件屬性的容器。:class:`!Event` 實例具" +"有以下屬性,每個屬性對應底層 Tk 事件的一個欄位;依事件型別的不同,有些屬性可" +"能會被設為字串 ``'??'``,以表示該屬性沒有意義。請參閱 :ref:`bindings-and-" +"events`。" #: ../../library/tkinter.rst:6122 msgid "The serial number of the event." -msgstr "" +msgstr "事件的序號。" #: ../../library/tkinter.rst:6126 msgid "The mouse button that was pressed or released (for button events)." -msgstr "" +msgstr "按下或釋放的滑鼠按鍵(用於按鍵事件)。" #: ../../library/tkinter.rst:6130 msgid "Whether the window has the focus (for ``Enter`` and ``Leave`` events)." -msgstr "" +msgstr "視窗是否具有焦點(用於 ``Enter`` 和 ``Leave`` 事件)。" #: ../../library/tkinter.rst:6135 msgid "" "The new height and width of the window (for ``Configure`` and ``Expose`` " "events)." -msgstr "" +msgstr "視窗新的高度和寬度(用於 ``Configure`` 和 ``Expose`` 事件)。" #: ../../library/tkinter.rst:6140 msgid "The keycode of the key that was pressed or released." -msgstr "" +msgstr "按下或釋放之按鍵的鍵碼。" #: ../../library/tkinter.rst:6144 msgid "" "The state of the event, as a number (for most events) or a string (for " "``Visibility`` events)." -msgstr "" +msgstr "事件的狀態,對大多數事件而言是數字,對 ``Visibility`` 事件而言是字串。" #: ../../library/tkinter.rst:6149 msgid "The timestamp of the event, in milliseconds." -msgstr "" +msgstr "事件的時間戳記,以毫秒為單位。" #: ../../library/tkinter.rst:6154 msgid "The pointer position relative to the widget, in pixels." -msgstr "" +msgstr "指標相對於元件的位置,以像素為單位。" #: ../../library/tkinter.rst:6159 msgid "" "The pointer position relative to the top-left corner of the screen, in " "pixels." -msgstr "" +msgstr "指標相對於螢幕左上角的位置,以像素為單位。" #: ../../library/tkinter.rst:6164 msgid "The character typed, as a string (for key events)." -msgstr "" +msgstr "輸入的字元,以字串表示(用於按鍵事件)。" #: ../../library/tkinter.rst:6168 msgid "``True`` if the event was sent by another application." -msgstr "" +msgstr "如果事件是由另一個應用程式傳送的,則為 ``True``。" #: ../../library/tkinter.rst:6172 msgid "The symbolic name of the key that was pressed or released." -msgstr "" +msgstr "按下或釋放之按鍵的符號名稱。" #: ../../library/tkinter.rst:6176 msgid "The numeric value of :attr:`keysym`." -msgstr "" +msgstr ":attr:`keysym` 的數值。" #: ../../library/tkinter.rst:6180 msgid "The :class:`EventType` of the event." -msgstr "" +msgstr "事件的 :class:`EventType`。" #: ../../library/tkinter.rst:6184 msgid "The widget on which the event occurred." -msgstr "" +msgstr "事件發生所在的元件。" #: ../../library/tkinter.rst:6188 msgid "The amount the mouse wheel was rotated (for ``MouseWheel`` events)." -msgstr "" +msgstr "滑鼠滾輪滾動的量(用於 ``MouseWheel`` 事件)。" #: ../../library/tkinter.rst:6193 msgid "" @@ -7918,6 +9417,11 @@ msgid "" "``Leave``, ``FocusIn``, ``FocusOut``, ``Configure``, ``Map``, ``Unmap``, " "``Expose``, ``Destroy`` and ``MouseWheel``." msgstr "" +"一個列舉 Tk 事件型別的 :class:`enum.StrEnum`,用作 :attr:`Event.type` 的值。" +"其成員包括(但不限於)\\ ``KeyPress``、``KeyRelease``、``ButtonPress``、" +"``ButtonRelease``、``Motion``、``Enter``、``Leave``、``FocusIn``、" +"``FocusOut``、``Configure``、``Map``、``Unmap``、``Expose``、``Destroy`` 和 " +"``MouseWheel``。" #: ../../library/tkinter.rst:6206 msgid "" @@ -7927,10 +9431,13 @@ msgid "" "reporting. Instances are created automatically by :meth:`Misc.register`; " "this class is not normally used directly." msgstr "" +"包裝 Python 回呼的內部輔助工具,使其可以從 Tcl 呼叫。*func* 是 Python 函式," +"*subst* 是一個選擇性的函式,用於預先處理 Tcl 引數,*widget* 則是用於錯誤回報" +"的元件。實例是由 :meth:`Misc.register` 自動建立;此類別通常不會直接被使用。" #: ../../library/tkinter.rst:6216 msgid "Module-level functions" -msgstr "" +msgstr "模組層級函式" #: ../../library/tkinter.rst:6220 msgid "" @@ -7957,12 +9464,18 @@ msgid "" "explicit *master* --- raise a :exc:`RuntimeError`. Call this early in larger " "applications to make the root window explicit." msgstr "" +"抑制隱含預設根視窗的建立。此後 :mod:`!tkinter` 不會再自動建立共用的預設根視" +"窗,且依賴預設根視窗的操作 --- 例如在未提供明確 *master* 的情況下建構元件 " +"--- 會引發 :exc:`RuntimeError`。請在較大型的應用程式中盡早呼叫此函式,以明確" +"指定根視窗。" #: ../../library/tkinter.rst:6240 msgid "" "Run the Tk main event loop on the default root window until all windows are " "destroyed. Equivalent to calling :meth:`Misc.mainloop` on the default root." msgstr "" +"在預設根視窗上執行 Tk 主事件迴圈,直到所有視窗都被摧毀為止。等同於在預設根視" +"窗上呼叫 :meth:`Misc.mainloop`。" #: ../../library/tkinter.rst:6246 msgid "" @@ -7970,26 +9483,30 @@ msgid "" "``'on'`` and similar, or their false counterparts) to a Python :class:" "`bool`. Raise :exc:`TclError` for an invalid value." msgstr "" +"將 Tcl 布林字串 *s*(``'1'``、``'true'``、``'yes'``、``'on'`` 及類似字串之" +"一,或其相反的字串)轉換為 Python 的 :class:`bool`。如果值無效,則引發 :exc:" +"`TclError`。" #: ../../library/tkinter.rst:6253 msgid "" "Convert *s* to a floating-point number. This is the built-in :class:`float`." -msgstr "" +msgstr "將 *s* 轉換為浮點數。這就是內建的 :class:`float`。" #: ../../library/tkinter.rst:6258 msgid "Convert *s* to an integer. This is the built-in :class:`int`." -msgstr "" +msgstr "將 *s* 轉換為整數。這就是內建的 :class:`int`。" #: ../../library/tkinter.rst:6263 msgid "" "Return the names of all existing images in the default root's interpreter." -msgstr "" +msgstr "回傳預設根視窗之直譯器中所有現存圖片的名稱。" #: ../../library/tkinter.rst:6267 msgid "" "Return the available image types (such as ``'photo'`` and ``'bitmap'``) in " "the default root's interpreter." msgstr "" +"回傳預設根視窗之直譯器中可用的圖片型別(例如 ``'photo'`` 和 ``'bitmap'``)。" #: ../../library/tkinter.rst:6274 msgid "File handlers" @@ -8068,21 +9585,23 @@ msgstr "用於 *mask* 引數的常數。" #: ../../library/tkinter.rst:6322 msgid "Constants" -msgstr "" +msgstr "常數" #: ../../library/tkinter.rst:6324 msgid "" "The following symbolic constants are available in both the :mod:`!tkinter` " "and :mod:`!tkinter.constants` namespaces." msgstr "" +"以下符號常數在 :mod:`!tkinter` 和 :mod:`!tkinter.constants` 命名空間中皆可使" +"用。" #: ../../library/tkinter.rst:6331 msgid "Truthy values, all equal to the integer ``1``." -msgstr "" +msgstr "真值,其值皆等於整數 ``1``。" #: ../../library/tkinter.rst:6337 msgid "Falsy values, all equal to the integer ``0``." -msgstr "" +msgstr "假值,其值皆等於整數 ``0``。" #: ../../library/tkinter.rst:6352 msgid "" @@ -8090,11 +9609,14 @@ msgid "" "edges) plus ``CENTER`` (``'center'``), used as values for the *anchor* and " "*sticky* options and by methods such as :meth:`Misc.grid_anchor`." msgstr "" +"羅盤方向(``'n'``、``'s'``、``'e'``、``'w'`` 及其對角線和邊)加上 " +"``CENTER``\\ (``'center'``),用作 *anchor* 和 *sticky* 選項的值,以及 :" +"meth:`Misc.grid_anchor` 等方法所使用。" #: ../../library/tkinter.rst:6361 msgid "" "Sides for the *side* option of the packer (see :meth:`Pack.pack_configure`)." -msgstr "" +msgstr "packer 之 *side* 選項的邊(請參閱 :meth:`Pack.pack_configure`)。" #: ../../library/tkinter.rst:6368 msgid "" @@ -8104,29 +9626,32 @@ msgstr "packer 的 *fill* 選項值:``'x'``、``'y'``、``'both'`` 或 ``'none #: ../../library/tkinter.rst:6378 msgid "Values for the *relief* option, which controls a widget's 3-D border." -msgstr "" +msgstr "*relief* 選項的值,用於控制元件的立體邊框。" #: ../../library/tkinter.rst:6383 msgid "" "Values for the *orient* option of widgets such as :class:`Scale`, :class:" "`Scrollbar` and :class:`PanedWindow`." msgstr "" +"用於 :class:`Scale`、:class:`Scrollbar` 和 :class:`PanedWindow` 等元件之 " +"*orient* 選項的值。" #: ../../library/tkinter.rst:6389 msgid "" "Values for the *wrap* option of the :class:`Text` widget, selecting line " "wrapping on character or word boundaries." -msgstr "" +msgstr ":class:`Text` 元件之 *wrap* 選項的值,用於選擇依字元或單字邊界換行。" #: ../../library/tkinter.rst:6394 msgid "The text-alignment value ``'baseline'``." -msgstr "" +msgstr "文字對齊值 ``'baseline'``。" #: ../../library/tkinter.rst:6399 msgid "" "Values for the *bordermode* option of the placer (see :meth:`Place." "place_configure`)." msgstr "" +"placer 之 *bordermode* 選項的值(請參閱 :meth:`Place.place_configure`)。" #: ../../library/tkinter.rst:6410 msgid "" @@ -8135,30 +9660,37 @@ msgid "" "``'current'``, ``'end'``, ``'anchor'`` and the bounds of the selection " "(``'sel.first'`` and ``'sel.last'``)." msgstr "" +":class:`Text`、:class:`Entry`、:class:`Listbox` 和 :class:`Canvas` 元件使用的" +"符號索引,例如 ``'insert'``\\ (插入游標)、``'current'``、``'end'``、" +"``'anchor'`` 以及選取範圍的邊界(``'sel.first'`` 和 ``'sel.last'``)。" #: ../../library/tkinter.rst:6417 msgid "" "The special tag ``'all'``, which matches every item of a :class:`Canvas` or " "every character of a :class:`Text` (for example ``canvas.delete(ALL)``)." msgstr "" +"特殊標籤 ``'all'``,用於符合 :class:`Canvas` 的所有項目或 :class:`Text` 的所" +"有字元(例如 ``canvas.delete(ALL)``)。" #: ../../library/tkinter.rst:6425 msgid "Values for the *state* option of various widgets and items." -msgstr "" +msgstr "各種元件與項目之 *state* 選項的值。" #: ../../library/tkinter.rst:6433 msgid "" "Menu entry types, used as the *itemType* argument of :meth:`Menu.add` and :" "meth:`Menu.insert`." msgstr "" +"選單項目型別,用作 :meth:`Menu.add` 和 :meth:`Menu.insert` 的 *itemType* 引" +"數。" #: ../../library/tkinter.rst:6441 msgid "Values for the *selectmode* option of the :class:`Listbox` widget." -msgstr "" +msgstr ":class:`Listbox` 元件之 *selectmode* 選項的值。" #: ../../library/tkinter.rst:6447 msgid "Values for the *style* option of :class:`Canvas` arc items." -msgstr "" +msgstr ":class:`Canvas` 弧形項目之 *style* 選項的值。" #: ../../library/tkinter.rst:6455 msgid "" @@ -8166,28 +9698,34 @@ msgid "" "*joinstyle* (``'round'``, ``'bevel'``, ``'miter'``) options of :class:" "`Canvas` line items." msgstr "" +":class:`Canvas` 線條項目之 *capstyle*(``'butt'``、``'projecting'``、" +"``'round'``)和 *joinstyle*(``'round'``、``'bevel'``、``'miter'``)選項的" +"值。" #: ../../library/tkinter.rst:6462 msgid "" "Values for the *arrow* option of :class:`Canvas` line items, indicating " "which ends have arrowheads." -msgstr "" +msgstr ":class:`Canvas` 線條項目之 *arrow* 選項的值,用於指示哪一端有箭頭。" #: ../../library/tkinter.rst:6468 msgid "" "The first argument passed by a :class:`Scrollbar` to the :meth:`XView.xview` " "or :meth:`YView.yview` method of the scrolled widget." msgstr "" +"由 :class:`Scrollbar` 傳給被捲動元件之 :meth:`XView.xview` 或 :meth:`YView." +"yview` 方法的第一個引數。" #: ../../library/tkinter.rst:6474 msgid "" "Values for the *what* argument of :meth:`XView.xview_scroll` and :meth:" "`YView.yview_scroll`." msgstr "" +":meth:`XView.xview_scroll` 和 :meth:`YView.yview_scroll` 的 *what* 引數的值。" #: ../../library/tkinter.rst:6481 msgid "Other option values: ``'underline'``, ``'numeric'`` and ``'dotbox'``." -msgstr "" +msgstr "其他選項值:``'underline'``、``'numeric'`` 和 ``'dotbox'``。" #: ../../library/tkinter.rst:579 msgid "packing (widgets)" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index 8ab35ffed35..c2b2f30faa5 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -41,6 +41,10 @@ msgid "" "class:`~tkinter.Frame` object. This allows the :class:`ScrolledText` widget " "to be used directly to achieve most normal geometry management behavior." msgstr "" +"文字小工具與捲軸被一起打包在 :class:`~tkinter.Frame` 中,其 :class:`~tkinter." +"Pack`、:class:`~tkinter.Grid` 和 :class:`~tkinter.Place` 幾何管理器的方法則是" +"從該 :class:`~tkinter.Frame` 物件取得。這讓 :class:`ScrolledText` 小工具能直" +"接用來達成大多數一般的幾何管理行為。" #: ../../library/tkinter.scrolledtext.rst:25 msgid "" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index e7a80f7e339..3b61b6fcd2e 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -92,6 +92,10 @@ msgid "" "Ttk widgets. Instead, use the :class:`ttk.Style