From a564941062b7d36b60472e04f019cf51be028cf5 Mon Sep 17 00:00:00 2001 From: j21869297-commits <282223615+j21869297-commits@users.noreply.github.com> Date: Tue, 1 Dec 2026 15:42:15 +0900 Subject: [PATCH] Translate using/windows.po (part 2: configuration and shebang lines) Translate the Configuration and Shebang lines sections (37 entries). Part of #946. Co-Authored-By: Claude Opus 5.5 --- using/windows.po | 100 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 10 deletions(-) diff --git a/using/windows.po b/using/windows.po index 295897d465..d2b9ce2d6f 100644 --- a/using/windows.po +++ b/using/windows.po @@ -737,12 +737,17 @@ msgid "" "are administrator-only and will override configuration files. Command-line " "options override all other settings, but not every option is available." msgstr "" +"Python 安裝管理員透過階層式的設定檔、環境變數、命令列選項與登錄檔設定來設定。" +"一般而言,設定檔可以設定所有項目,包括其他設定檔的位置;而登錄檔設定只供管理" +"員使用,並會覆寫設定檔。命令列選項會覆寫所有其他設定,但並非每個選項都有對應" +"的命令列選項。" #: ../../using/windows.rst:394 msgid "" "This section will describe the defaults, but be aware that modified or " "overridden installs may resolve settings differently." msgstr "" +"本節會說明預設值,但請注意,經過修改或覆寫的安裝可能會以不同的方式解析設定。" #: ../../using/windows.rst:397 msgid "" @@ -755,6 +760,12 @@ msgid "" "line option (but not both). These locations may be modified by " "administrative customization options listed later." msgstr "" +"管理員可以設定一個全域設定檔,它會最先被讀取。使用者設定檔儲存" +"在 :file:`%AppData%\\\\Python\\\\pymanager.json`\\ (注意這個位置位於 " +"``Roaming`` 底下,而不是 ``Local``),接著被讀取,並覆寫先前檔案中的任何設" +"定。另外還可以透過 ``PYTHON_MANAGER_CONFIG`` 環境變數或 ``--config`` 命令列選" +"項(但不能兩者同時使用)指定一個額外的設定檔。這些位置可以透過後面列出的管理" +"用自訂選項來修改。" #: ../../using/windows.rst:407 msgid "" @@ -762,18 +773,19 @@ msgid "" "in normal use. Later sections list those that are intended for " "administrative customization." msgstr "" +"以下是一般使用時可能會修改的設定。後面的章節會列出供管理員自訂用的設定。" #: ../../using/windows.rst:415 msgid "Standard configuration options" -msgstr "" +msgstr "標準設定選項" #: ../../using/windows.rst:419 ../../using/windows.rst:756 msgid "Config Key" -msgstr "" +msgstr "設定鍵" #: ../../using/windows.rst:420 msgid "Environment Variable" -msgstr "" +msgstr "環境變數" #: ../../using/windows.rst:421 ../../using/windows.rst:757 #: ../../using/windows.rst:1624 ../../using/windows.rst:1644 @@ -790,6 +802,8 @@ msgid "" "The preferred default version to launch or install. By default, this is " "interpreted as the most recent non-prerelease version from the CPython team." msgstr "" +"偏好啟動或安裝的預設版本。預設情況下,這會被解讀為 CPython 團隊最新的非預發布" +"版本。" #: ../../using/windows.rst:429 msgid "``default_platform``" @@ -806,6 +820,9 @@ msgid "" "install for ``3.14-64`` if it exists (and ``default_platform`` is ``-64``), " "but will use ``3.14`` if no tagged install exists." msgstr "" +"偏好啟動或安裝的預設平台。它會被當作指定標籤的後綴,因此如果 ``3.14-64`` 的安" +"裝存在(且 ``default_platform`` 為 ``-64``),``py -V:3.14`` 會優先使用它;如" +"果沒有帶這個後綴的安裝,則會使用 ``3.14``。" #: ../../using/windows.rst:437 msgid "``logs_dir``" @@ -817,7 +834,7 @@ msgstr "``PYTHON_MANAGER_LOGS``" #: ../../using/windows.rst:439 msgid "The location where log files are written. By default, :file:`%TEMP%`." -msgstr "" +msgstr "寫入日誌檔的位置。預設為 :file:`%TEMP%`。" #: ../../using/windows.rst:442 msgid "``automatic_install``" @@ -829,6 +846,8 @@ msgid "" "when no runtimes are installed yet). Other commands will not automatically " "install, regardless of this setting. By default, true." msgstr "" +"設為 true 時,允許在使用 ``py exec`` 啟動時(或在尚未安裝任何 runtime 時使用 " +"``py``)自動安裝。不論此設定為何,其他命令都不會自動安裝。預設為 true。" #: ../../using/windows.rst:450 msgid "``include_unmanaged``" @@ -843,6 +862,8 @@ msgid "" "True to allow listing and launching runtimes that were not installed by the " "Python install manager, or false to exclude them. By default, true." msgstr "" +"設為 true 時,允許列出並啟動不是由 Python 安裝管理員安裝的 runtime;設為 " +"false 則排除它們。預設為 true。" #: ../../using/windows.rst:456 msgid "``shebang_can_run_anything``" @@ -857,10 +878,12 @@ msgid "" "True to allow shebangs in ``.py`` files to launch applications other than " "Python runtimes, or false to prevent it. By default, true." msgstr "" +"設為 true 時,允許 ``.py`` 檔案中的 shebang 啟動 Python runtime 以外的應用程" +"式;設為 false 則禁止。預設為 true。" #: ../../using/windows.rst:462 msgid "``shebang_templates``" -msgstr "" +msgstr "``shebang_templates``" #: ../../using/windows.rst:463 ../../using/windows.rst:487 #: ../../using/windows.rst:500 ../../using/windows.rst:506 @@ -874,6 +897,8 @@ msgid "" "`` or a substitute string. See :ref:`pymanager-shebang` for more " "details." msgstr "" +"從 shebang 行範本對應到替代命令的對映,例如 ``py -V:`` 或替代字串。更多" +"細節請參閱\\ :ref:`pymanager-shebang`。" #: ../../using/windows.rst:468 msgid "``log_level``" @@ -890,6 +915,8 @@ msgid "" "additional output during startup that is later suppressed by other " "configuration." msgstr "" +"設定輸出的預設層級 (0-50)。預設為 20。數值越低,輸出越多。這些環境變數為 " +"boolean,可能會在啟動期間產生額外的輸出,之後才被其他設定抑制。" #: ../../using/windows.rst:476 msgid "``confirm``" @@ -904,6 +931,8 @@ msgid "" "True to confirm certain actions before taking them (such as uninstall), or " "false to skip the confirmation. By default, true." msgstr "" +"設為 true 時,在執行某些動作(例如解除安裝)之前要求確認;設為 false 則略過確" +"認。預設為 true。" #: ../../using/windows.rst:482 msgid "``install.source``" @@ -915,7 +944,7 @@ msgstr "``PYTHON_MANAGER_SOURCE_URL``" #: ../../using/windows.rst:484 msgid "Override the index feed to obtain new installs from." -msgstr "" +msgstr "覆寫用來取得新安裝的索引來源 (index feed)。" #: ../../using/windows.rst:486 msgid "``install.enable_entrypoints``" @@ -928,6 +957,9 @@ msgid "" "the Python interpreter has global commands created. By default, true. You " "should run ``py install --refresh`` after changing this setting." msgstr "" +"設為 true 時,會為已安裝的套件產生全域命令(例如 ``pip.exe``)。這些命令由套" +"件本身定義。如果設為 false,只會為 Python 直譯器建立全域命令。預設為 true。變" +"更此設定後,你應該執行 ``py install --refresh``。" #: ../../using/windows.rst:494 msgid "``list.format``" @@ -941,7 +973,7 @@ msgstr "``PYTHON_MANAGER_LIST_FORMAT``" msgid "" "Specify the default format used by the ``py list`` command. By default, " "``table``." -msgstr "" +msgstr "指定 ``py list`` 命令使用的預設格式。預設為 ``table``。" #: ../../using/windows.rst:499 msgid "``install_dir``" @@ -953,6 +985,8 @@ msgid "" "change this setting, previously installed runtimes will not be usable unless " "you move them to the new location." msgstr "" +"指定 runtime 要安裝到的根目錄。如果你變更此設定,先前安裝的 runtime 將無法使" +"用,除非你把它們移到新的位置。" #: ../../using/windows.rst:505 msgid "``global_dir``" @@ -964,6 +998,8 @@ msgid "" "``pip.exe``) are stored. This directory should be added to your :envvar:" "`PATH` to make the commands available from your terminal." msgstr "" +"指定全域命令(例如 ``python3.14.exe`` 和 ``pip.exe``)的存放目錄。應將此目錄" +"加入你的 :envvar:`PATH`,才能在終端機中使用這些命令。" #: ../../using/windows.rst:512 msgid "``download_dir``" @@ -973,17 +1009,19 @@ msgstr "``download_dir``" msgid "" "Specify the directory where downloaded files are stored. This directory is a " "temporary cache, and can be cleaned up from time to time." -msgstr "" +msgstr "指定下載檔案的存放目錄。這個目錄是暫存的快取,可以不時清理。" #: ../../using/windows.rst:519 msgid "" "Dotted names should be nested inside JSON objects, for example, ``list." "format`` would be specified as ``{\"list\": {\"format\": \"table\"}}``." msgstr "" +"以點分隔的名稱應巢狀放在 JSON 物件中,例如 ``list.format`` 應寫成 " +"``{\"list\": {\"format\": \"table\"}}``。" #: ../../using/windows.rst:525 ../../using/windows.rst:1990 msgid "Shebang lines" -msgstr "" +msgstr "Shebang 行" #: ../../using/windows.rst:527 msgid "" @@ -993,6 +1031,9 @@ msgid "" "indicate how a script should be executed. The ``python`` and ``py`` commands " "allow the same facilities to be used with Python scripts on Windows." msgstr "" +"如果腳本檔案的第一行以 ``#!`` 開頭,它就被稱為「shebang」行。Linux 和其他類 " +"Unix 作業系統原生支援這類行,在這些系統上通常用來指示腳本應該如何執行。" +"``python`` 和 ``py`` 命令讓 Windows 上的 Python 腳本也能使用相同的功能。" #: ../../using/windows.rst:533 msgid "" @@ -1000,6 +1041,8 @@ msgid "" "Windows, a number of 'virtual' commands are supported to specify which " "interpreter to use. The supported virtual commands are:" msgstr "" +"為了讓 Python 腳本中的 shebang 行能在 Unix 和 Windows 之間移植,支援了一些" +"「虛擬」命令來指定要使用哪個直譯器。支援的虛擬命令有:" #: ../../using/windows.rst:537 msgid "``/usr/bin/env ``" @@ -1023,7 +1066,7 @@ msgstr "````" #: ../../using/windows.rst:543 ../../using/windows.rst:2008 msgid "For example, if the first line of your script starts with" -msgstr "" +msgstr "例如,如果你的腳本第一行以下列內容開頭" #: ../../using/windows.rst:545 ../../using/windows.rst:2010 msgid "#! /usr/bin/python" @@ -1038,6 +1081,10 @@ msgid "" "be useful on Unix, you should use one of the shebang lines starting with ``/" "usr``." msgstr "" +"就會找到並使用預設的 Python 或目前啟用的虛擬環境。由於許多為 Unix 撰寫的 " +"Python 腳本已經有這一行,你應該會發現這些腳本不需修改就能由啟動器執行。如果你" +"在 Windows 上撰寫新的腳本,並希望它也能在 Unix 上使用,你應該使用以 ``/usr`` " +"開頭的 shebang 行之一。" #: ../../using/windows.rst:555 msgid "" @@ -1048,6 +1095,10 @@ msgid "" "envvar:`PATH`. This allows the use of shebangs like ``/usr/bin/python3.12`` " "to select a particular runtime." msgstr "" +"上述任何虛擬命令中的 ```` 都可以替換為已安裝 runtime 的別名。也就是" +"說,任何產生在全域別名目錄(你可能已將它加入 :envvar:`PATH` 環境變數)中的命" +"令,都可以用在 shebang 中,即使它不在你的 :envvar:`PATH` 上。這讓你可以使用" +"像 ``/usr/bin/python3.12`` 這樣的 shebang 來選擇特定的 runtime。" #: ../../using/windows.rst:561 msgid "" @@ -1055,6 +1106,8 @@ msgid "" "requested runtime will be installed if necessary. See :ref:`pymanager-" "config` for information about configuration settings." msgstr "" +"如果沒有安裝任何 runtime,或者啟用了自動安裝,必要時會安裝所要求的 runtime。" +"關於設定的資訊,請參閱\\ :ref:`pymanager-config`。" #: ../../using/windows.rst:565 msgid "" @@ -1065,6 +1118,10 @@ msgid "" "searching for arbitrary executables, and this search may be disabled by the " "``shebang_can_run_anything`` configuration option." msgstr "" +"``/usr/bin/env`` 形式的 shebang 行,也會在 :envvar:`PATH` 環境變數中搜尋無法" +"辨識的命令。這對應到 Unix ``env`` 程式的行為,它會進行相同的搜尋,但會優先啟" +"動已知的 Python 命令。搜尋任意可執行檔時可能會顯示警告,而這個搜尋可以透過 " +"``shebang_can_run_anything`` 設定選項停用。" #: ../../using/windows.rst:572 msgid "" @@ -1077,6 +1134,11 @@ msgid "" "will be appended. This functionality may be disabled by the " "``shebang_can_run_anything`` configuration option." msgstr "" +"不符合任何模式的 shebang 行,會被視為 *Windows* 可執行檔的路徑,可以是絕對路" +"徑,或相對於腳本檔案所在目錄的路徑。這是為了方便僅限 Windows 的腳本(例如由安" +"裝程式產生的腳本),因為這種行為與 Unix 風格的 shell 不相容。這些路徑可以加上" +"引號,也可以包含多個引數,之後會再附加腳本的路徑和任何額外的引數。這項功能可" +"以透過 ``shebang_can_run_anything`` 設定選項停用。" #: ../../using/windows.rst:581 msgid "" @@ -1088,6 +1150,11 @@ msgid "" "`` form is also allowed, as is a plain ``py`` to launch the " "default. No other arguments are supported." msgstr "" +"從 Python 安裝管理員 26.3 版開始,可以在你的設定檔中新增自訂的 shebang 範本。" +"新增 ``shebang_templates`` 物件,其中每個範本對應一個成員:成員名稱是要比對的" +"字串,值是比對成功時要使用的命令。大多數命令應該是 ``py -V:``\\ (或 " +"``pyw``),用來啟動你已安裝的其中一個 runtime。也可以使用 ``py -3." +"`` 的形式,或單純使用 ``py`` 來啟動預設版本。不支援其他引數。" #: ../../using/windows.rst:589 msgid "" @@ -1098,6 +1165,12 @@ msgid "" " }\n" "}" msgstr "" +"{\n" +" \"shebang_templates\": {\n" +" \"/usr/bin/python\": \"py\",\n" +" \"/usr/bin/my_custom_python\": \"py -V:MyCustomPython/3\"\n" +" }\n" +"}" #: ../../using/windows.rst:598 msgid "" @@ -1108,6 +1181,9 @@ msgid "" "entire line (ignoring leading and trailing whitespace), or up to the first " "space in the shebang line." msgstr "" +"如果替代命令不是 ``py`` 或 ``pyw``,它會被寫回 shebang 中,並繼續一般的處理。" +"如果允許啟動任意可執行檔,提供完整路徑就能讓你從 Python 轉向任何可執行檔。範" +"本應該比對整行(忽略前後的空白),或比對到 shebang 行中第一個空格為止的內容。" #: ../../using/windows.rst:607 msgid "" @@ -1118,6 +1194,10 @@ msgid "" "launcher's ``py`` command will override PyManager's one by default, and you " "will need to use ``pymanager`` commands for installing and uninstalling." msgstr "" +"Python 安裝管理員中 shebang 的行為與先前的 ``py.exe`` 啟動器有些微妙的差異," +"舊的設定選項也不再適用。如果你特別依賴舊的行為或設定,我們建議安裝\\ `舊版啟" +"動器 `_。舊版啟動器的 ``py`` 命令預設會覆寫 PyManager 的 " +"``py`` 命令,而你需要使用 ``pymanager`` 命令來進行安裝和解除安裝。" #: ../../using/windows.rst:625 msgid "Advanced installation"