From 35efc49661b7f224224d1c6b94ff7efaccbd1514 Mon Sep 17 00:00:00 2001 From: "Dr.XYZ" Date: Wed, 14 May 2025 06:32:34 +0000 Subject: [PATCH 1/4] translate 13-99 --- library/cmd.po | 51 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/library/cmd.po b/library/cmd.po index 5a99032492..218b7ac09c 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -3,13 +3,14 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Dr-XYZ , 2025 msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-23 07:52+0800\n" -"PO-Revision-Date: 2018-05-23 14:40+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2025-05-14 14:32+0800\n" +"Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -33,6 +34,8 @@ msgid "" "administrative tools, and prototypes that will later be wrapped in a more " "sophisticated interface." msgstr "" +":class:`Cmd` 類別提供了一個簡單的架構,用於撰寫行導向的命令直譯器。這類直譯器" +"常用於測試框架、管理工具以及日後將包裝於更高階介面的原型中。" #: ../../library/cmd.rst:20 msgid "" @@ -42,6 +45,9 @@ msgid "" "yourself in order to inherit :class:`Cmd`'s methods and encapsulate action " "methods." msgstr "" +":class:`Cmd` 實例或其子類別實例是一種行導向的直譯器架構。通常沒有必要直接實例" +"化 :class:`Cmd` 本身;它更適合作為你自定義的直譯器類別的父類別,讓你能繼承 :" +"class:`Cmd` 的方法,並封裝動作方法。" #: ../../library/cmd.rst:25 msgid "" @@ -50,6 +56,9 @@ msgid "" "`None` and :mod:`readline` is available, command completion is done " "automatically." msgstr "" +"可選引數 *completekey* 是 :mod:`readline` 模組中用於自動完成的按鍵名稱;預設" +"為 :kbd:`Tab`。若 *completekey* 不為 :const:`None` 且 :mod:`readline`可用,則" +"會自動啟用命令自動完成功能。" #: ../../library/cmd.rst:29 msgid "" @@ -59,6 +68,10 @@ msgid "" "``'tab'``. Note that other values are not treated this way, and might only " "work with a specific backend." msgstr "" +"預設值 ``'tab'`` 會被特殊處理,使其在所有的 :data:`readline.backend` 中皆代" +"表 :kbd:`Tab` 鍵。具體來說,若 :data:`readline.backend` 為 ``editline``,則 " +"``Cmd`` 會改用 ``'^I'`` 取代 ``'tab'``。請注意,其他值不會有此處理方式,且可" +"能僅能在特定的後端中適用。" #: ../../library/cmd.rst:36 msgid "" @@ -67,6 +80,8 @@ msgid "" "and output. If not specified, they will default to :data:`sys.stdin` and :" "data:`sys.stdout`." msgstr "" +"可選引數 *stdin* 與 *stdout* 用來指定 Cmd 實例或其子類別實例所使用的輸入與輸" +"出檔案物件。若未指定,預設為 :data:`sys.stdin` 與 :data:`sys.stdout`。" #: ../../library/cmd.rst:41 msgid "" @@ -74,10 +89,12 @@ msgid "" "attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be " "ignored." msgstr "" +"若你希望使用指定的 *stdin*,請務必將該實例的 :attr:`use_rawinput` 屬性設為 " +"``False``,否則*stdin* 會被忽略。" #: ../../library/cmd.rst:45 msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." -msgstr "" +msgstr "對於 ``editline``,``completekey='tab'`` 會被替換為 ``'^I'``。" #: ../../library/cmd.rst:52 msgid "Cmd Objects" @@ -85,7 +102,7 @@ msgstr "Cmd 物件" #: ../../library/cmd.rst:54 msgid "A :class:`Cmd` instance has the following methods:" -msgstr "" +msgstr ":class:`Cmd` 實例具有以下方法:" #: ../../library/cmd.rst:59 msgid "" @@ -93,12 +110,16 @@ msgid "" "received input, and dispatch to action methods, passing them the remainder " "of the line as argument." msgstr "" +"重複顯示提示字元、接收輸入、剖析接收到的輸入字串前綴,並將剩餘部分作為引數傳" +"遞給對應的動作方法來進行調度。" #: ../../library/cmd.rst:63 msgid "" "The optional argument is a banner or intro string to be issued before the " "first prompt (this overrides the :attr:`intro` class attribute)." msgstr "" +"此可選引數為橫幅或導言字串,會在首次顯示提示字元前輸出(此值會覆寫 :attr:" +"`intro` 類別屬性)。" #: ../../library/cmd.rst:66 msgid "" @@ -108,10 +129,14 @@ msgid "" "`Control-F` moves the cursor to the right non-destructively, :kbd:`Control-" "B` moves the cursor to the left non-destructively, etc.)." msgstr "" +"如果已載入 :mod:`readline` 模組,輸入行將自動繼承類似 :program:`bash` 的歷史" +"紀錄編輯功能(例如 :kbd:`Control-P` 可向上捲動至上一個指令,:kbd:`Control-N` " +"向下捲動至下一個指令,:kbd:`Control-F` 非破壞性地將游標向右移動,:kbd:" +"`Control-B` 非破壞性地將游標向左移動等)。" #: ../../library/cmd.rst:72 msgid "An end-of-file on input is passed back as the string ``'EOF'``." -msgstr "" +msgstr "當輸入為檔案結尾(EOF)時,會傳回字串 ``'EOF'``。" #: ../../library/cmd.rst:78 msgid "" @@ -121,6 +146,10 @@ msgid "" "another special case, a line beginning with the character ``'!'`` is " "dispatched to the method :meth:`!do_shell` (if such a method is defined)." msgstr "" +"直譯器實例僅當存在 :meth:`!do_foo` 方法時,才會識別命令名稱 ``foo``。作為特殊" +"情況,以字元 ``'?'`` 開頭的行會被派發至 :meth:`do_help` 方法;另一個特殊情況" +"是,以字元 ``'!'`` 開頭的行會被派發至 :meth:`!do_shell` 方法(若該方法已定" +"義)。" #: ../../library/cmd.rst:84 msgid "" @@ -128,6 +157,8 @@ msgid "" "value. The *stop* argument to :meth:`postcmd` is the return value from the " "command's corresponding :meth:`!do_\\*` method." msgstr "" +"當 :meth:`postcmd` 方法回傳真值時,此方法將會結束。傳遞給 :meth:`postcmd` 的 " +"*stop* 引數是該命令對應的 :meth:`!do_\\*` 方法的回傳值。" #: ../../library/cmd.rst:88 msgid "" @@ -140,6 +171,11 @@ msgid "" "could be used to provide different completion depending upon which position " "the argument is in." msgstr "" +"如果啟用了自動完成,命令的自動完成將會自動執行,而命令引數的自動完成則是透過" +"呼叫 :meth:`!complete_foo` 方法並傳入 *text*、*line*、*begidx* 和 *endidx* 引" +"數來處理。*text* 是要比對的字串前綴:所有回傳的符合項都必須以此字串開頭。" +"*line* 是目前的輸入行(前置空白會被移除),*begidx* 和 *endidx* 則分別是前綴" +"字串的起始與結束索引,可用來根據引數所在的位置提供不同的自動完成結果。" #: ../../library/cmd.rst:99 msgid "" @@ -151,6 +187,11 @@ msgid "" "help_\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" +"所有 :class:`Cmd` 的子類別都會繼承預先定義的 :meth:`!do_help` 方法。當此方法" +"接收到引數 ``'bar'`` 時,會呼叫對應的 :meth:`!help_bar` 方法;若該方法不存" +"在,則會列印 :meth:`!do_bar` 的說明字串(若有的話)。若未提供任何引數,:meth:" +"`!do_help` 會列出所有可用的說明主題(也就是所有具有對應 :meth:`!help_\\*` 方" +"法或有說明字串的命令),並且也會列出所有尚未記錄的命令。" #: ../../library/cmd.rst:110 msgid "" From 8e76554baac1d1d51b41f61c908247f79c960003 Mon Sep 17 00:00:00 2001 From: "Dr.XYZ" Date: Wed, 14 May 2025 07:17:13 +0000 Subject: [PATCH 2/4] fix reST --- library/cmd.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cmd.po b/library/cmd.po index 218b7ac09c..37be0dc329 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -57,8 +57,8 @@ msgid "" "automatically." msgstr "" "可選引數 *completekey* 是 :mod:`readline` 模組中用於自動完成的按鍵名稱;預設" -"為 :kbd:`Tab`。若 *completekey* 不為 :const:`None` 且 :mod:`readline`可用,則" -"會自動啟用命令自動完成功能。" +"為 :kbd:`Tab`。若 *completekey* 不為 :const:`None` 且 :mod:`readline` 可用," +"則會自動啟用命令自動完成功能。" #: ../../library/cmd.rst:29 msgid "" From f5de548146c9882d11436fa6c1944019eac8a9b0 Mon Sep 17 00:00:00 2001 From: "Dr.XYZ" Date: Wed, 14 May 2025 10:29:31 +0000 Subject: [PATCH 3/4] fix --- library/cmd.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/cmd.po b/library/cmd.po index 37be0dc329..ca798499a4 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -35,7 +35,7 @@ msgid "" "sophisticated interface." msgstr "" ":class:`Cmd` 類別提供了一個簡單的架構,用於撰寫行導向的命令直譯器。這類直譯器" -"常用於測試框架、管理工具以及日後將包裝於更高階介面的原型中。" +"常用於測試控制工具、管理工具以及日後將包裝於更高階介面的原型中。" #: ../../library/cmd.rst:20 msgid "" @@ -90,7 +90,7 @@ msgid "" "ignored." msgstr "" "若你希望使用指定的 *stdin*,請務必將該實例的 :attr:`use_rawinput` 屬性設為 " -"``False``,否則*stdin* 會被忽略。" +"``False``,否則 *stdin* 會被忽略。" #: ../../library/cmd.rst:45 msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." @@ -110,8 +110,8 @@ msgid "" "received input, and dispatch to action methods, passing them the remainder " "of the line as argument." msgstr "" -"重複顯示提示字元、接收輸入、剖析接收到的輸入字串前綴,並將剩餘部分作為引數傳" -"遞給對應的動作方法來進行調度。" +"重複顯示提示字元、接收輸入、剖析接收到的輸入字串前綴,並派發給動作方法,將其" +"餘部分作為引數傳遞給它們" #: ../../library/cmd.rst:63 msgid "" @@ -183,8 +183,8 @@ msgid "" "method, called with an argument ``'bar'``, invokes the corresponding method :" "meth:`!help_bar`, and if that is not present, prints the docstring of :meth:" "`!do_bar`, if available. With no argument, :meth:`!do_help` lists all " -"available help topics (that is, all commands with corresponding :meth:`!" -"help_\\*` methods or commands that have docstrings), and also lists any " +"available help topics (that is, all commands with corresponding :meth:`!help_" +"\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" "所有 :class:`Cmd` 的子類別都會繼承預先定義的 :meth:`!do_help` 方法。當此方法" From 81af15ab7d4894a3c4e363581bf073a01062bc9d Mon Sep 17 00:00:00 2001 From: "Dr.XYZ" Date: Wed, 14 May 2025 10:31:46 +0000 Subject: [PATCH 4/4] fix --- library/cmd.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cmd.po b/library/cmd.po index ca798499a4..238f25b3ca 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -183,8 +183,8 @@ msgid "" "method, called with an argument ``'bar'``, invokes the corresponding method :" "meth:`!help_bar`, and if that is not present, prints the docstring of :meth:" "`!do_bar`, if available. With no argument, :meth:`!do_help` lists all " -"available help topics (that is, all commands with corresponding :meth:`!help_" -"\\*` methods or commands that have docstrings), and also lists any " +"available help topics (that is, all commands with corresponding :meth:`!" +"help_\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" "所有 :class:`Cmd` 的子類別都會繼承預先定義的 :meth:`!do_help` 方法。當此方法"