diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 8e7184e42d..07a22f1e5f 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-01 22:24+0800\n" -"PO-Revision-Date: 2018-07-15 18:56+0800\n" +"PO-Revision-Date: 2025-06-27 00:11+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -14,10 +14,11 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" #: ../../c-api/contextvars.rst:6 msgid "Context Variables Objects" -msgstr "情境變數物件" +msgstr "情境變數物件(Context Variables Objects)" #: ../../c-api/contextvars.rst:15 msgid "" @@ -25,6 +26,9 @@ msgid "" "**changed** to use :c:type:`PyObject` pointers instead of :c:type:" "`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::" msgstr "" +"在 Python 3.7.1 中所有情境變數 C API 的簽名都被\\ **改為**\\ 使用 :c:type:" +"`PyObject` 指標,而不是 :c:type:`PyContext`、:c:type:`PyContextVar` 或 :c:" +"type:`PyContextToken`,例如:" #: ../../c-api/contextvars.rst:20 msgid "" @@ -34,6 +38,11 @@ msgid "" "// in 3.7.1+:\n" "PyObject *PyContext_New(void);" msgstr "" +"// 在 3.7.0:\n" +"PyContext *PyContext_New(void);\n" +"\n" +"// 在 3.7.1+:\n" +"PyObject *PyContext_New(void);" #: ../../c-api/contextvars.rst:26 msgid "See :issue:`34762` for more details." @@ -42,83 +51,90 @@ msgstr "更多細節請見 :issue:`34762`。" #: ../../c-api/contextvars.rst:29 msgid "" "This section details the public C API for the :mod:`contextvars` module." -msgstr "" +msgstr "本節詳述 :mod:`contextvars` 模組的公開 C API。" #: ../../c-api/contextvars.rst:33 msgid "" "The C structure used to represent a :class:`contextvars.Context` object." -msgstr "" +msgstr "用來代表 :class:`contextvars.Context` 物件的 C 結構。" #: ../../c-api/contextvars.rst:38 msgid "" "The C structure used to represent a :class:`contextvars.ContextVar` object." -msgstr "" +msgstr "用來代表 :class:`contextvars.ContextVar` 物件的 C 結構。" #: ../../c-api/contextvars.rst:43 msgid "The C structure used to represent a :class:`contextvars.Token` object." -msgstr "" +msgstr "用來代表 :class:`contextvars.Token` 物件的 C 結構。" #: ../../c-api/contextvars.rst:47 msgid "The type object representing the *context* type." -msgstr "" +msgstr "代表 *context* 型別的型別物件。" #: ../../c-api/contextvars.rst:51 msgid "The type object representing the *context variable* type." -msgstr "" +msgstr "代表 *情境變數* 型別的型別物件。" #: ../../c-api/contextvars.rst:55 msgid "The type object representing the *context variable token* type." -msgstr "" +msgstr "代表 *情境變數 token* 型別的型別物件。" #: ../../c-api/contextvars.rst:58 msgid "Type-check macros:" -msgstr "" +msgstr "型別檢查巨集:" #: ../../c-api/contextvars.rst:62 msgid "" "Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be " "``NULL``. This function always succeeds." msgstr "" +"如果 *o* 的型別為 :c:data:`PyContext_Type` 則回傳 true。*o* 不得為 ``NULL``。" +"此函式一定會成功回傳。" #: ../../c-api/contextvars.rst:67 msgid "" "Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be " "``NULL``. This function always succeeds." msgstr "" +"如果 *o* 的類型為 :c:data:`PyContextVar_Type` 則回傳 true。*o* 不得為 " +"``NULL``。此函式一定會成功回傳。" #: ../../c-api/contextvars.rst:72 msgid "" "Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be " "``NULL``. This function always succeeds." msgstr "" +"如果 *o* 的類型為 :c:data:`PyContextToken_Type` 則回傳 true。 *o* 不得為 " +"``NULL``。此函式一定會成功回傳。" #: ../../c-api/contextvars.rst:76 msgid "Context object management functions:" -msgstr "" +msgstr "情境物件管理函式:" #: ../../c-api/contextvars.rst:80 msgid "" "Create a new empty context object. Returns ``NULL`` if an error has " "occurred." -msgstr "" +msgstr "建立一個新的空的情境物件。 如果發生錯誤,則回傳 ``NULL``。" #: ../../c-api/contextvars.rst:85 msgid "" "Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` " "if an error has occurred." -msgstr "" +msgstr "建立傳入的 *ctx* 情境物件的淺層複製 (shallow copy)。如果發生錯誤,則回傳 ``NULL``。" #: ../../c-api/contextvars.rst:90 msgid "" "Create a shallow copy of the current thread context. Returns ``NULL`` if an " "error has occurred." -msgstr "" +msgstr "建立目前執行緒上的情境的淺層複製。如果發生錯誤,則回傳 ``NULL``。" #: ../../c-api/contextvars.rst:95 msgid "" "Set *ctx* as the current context for the current thread. Returns ``0`` on " "success, and ``-1`` on error." msgstr "" +"設定 *ctx* 為目前執行緒上的目前情境。成功時回傳 ``0``,錯誤時回傳 ``-1``。" #: ../../c-api/contextvars.rst:100 msgid "" @@ -126,10 +142,12 @@ msgid "" "context for the current thread. Returns ``0`` on success, and ``-1`` on " "error." msgstr "" +"關閉 *ctx* 情境,並將目前執行緒的目前情境設回之前的情境。 成功時回傳 ``0``," +"錯誤時回傳 ``-1``。" #: ../../c-api/contextvars.rst:105 msgid "Context variable functions:" -msgstr "" +msgstr "情境變數函式:" #: ../../c-api/contextvars.rst:109 msgid "" @@ -138,6 +156,9 @@ msgid "" "value for the context variable, or ``NULL`` for no default. If an error has " "occurred, this function returns ``NULL``." msgstr "" +"建立一個新的 ``ContextVar`` 物件。*name* 參數用於自我檢查(introspection)和" +"除錯目的。*def* 參數指定情境變數的預設值,亦可用 ``NULL`` 表示沒有預設值。 如" +"果發生錯誤,此函式會回傳 ``NULL``。" #: ../../c-api/contextvars.rst:116 msgid "" @@ -145,20 +166,24 @@ msgid "" "occurred during lookup, and ``0`` if no error occurred, whether or not a " "value was found." msgstr "" +"取得情境變數的值。如果在查找過程中發生錯誤則回傳 ``-1``,如果沒有發生錯誤則無" +"論是否找到值都會回傳 ``0``。" #: ../../c-api/contextvars.rst:120 msgid "" "If the context variable was found, *value* will be a pointer to it. If the " "context variable was *not* found, *value* will point to:" msgstr "" +"如果找到情境變數,*value* 將會是指向它的指標。如果 *沒有* 找到情境變數," +"*value* 將會指到:" #: ../../c-api/contextvars.rst:123 msgid "*default_value*, if not ``NULL``;" -msgstr "" +msgstr "*default_value* 預設值,但前提是預設值不是 ``NULL``;" #: ../../c-api/contextvars.rst:124 msgid "the default value of *var*, if not ``NULL``;" -msgstr "" +msgstr "*var* 的預設值,但前提是預設值不是 ``NULL``;" #: ../../c-api/contextvars.rst:125 msgid "``NULL``" @@ -166,13 +191,15 @@ msgstr "``NULL``" #: ../../c-api/contextvars.rst:127 msgid "Except for ``NULL``, the function returns a new reference." -msgstr "" +msgstr "除了 ``NULL`` 之外,此函式會回傳一個新的參照(reference)。" #: ../../c-api/contextvars.rst:131 msgid "" "Set the value of *var* to *value* in the current context. Returns a new " "token object for this change, or ``NULL`` if an error has occurred." msgstr "" +"在目前的情境中將 *var* 的值設為 *value*。會回傳一個用來代表此變更的新 token " +"物件,如果發生錯誤則回傳 ``NULL``。" #: ../../c-api/contextvars.rst:136 msgid "" @@ -180,3 +207,6 @@ msgid "" "func:`PyContextVar_Set` that returned the *token* was called. This function " "returns ``0`` on success and ``-1`` on error." msgstr "" +"將 *var* 情境變數的狀態設回之前的狀態,亦即上一次回傳 token 的 :c:func:" +"`PyContextVar_Set` 被呼叫前的狀態。此函式在成功時回傳 ``0``,錯誤時回傳 " +"``-1``。" diff --git a/library/trace.po b/library/trace.po index 6149b689ae..628ba22bb8 100644 --- a/library/trace.po +++ b/library/trace.po @@ -3,13 +3,15 @@ # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 +# 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 16:13+0000\n" -"Last-Translator: Adrian Liaw \n" +"PO-Revision-Date: 2025-05-28 14:00+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 +35,9 @@ msgid "" "list functions executed during a program run. It can be used in another " "program or from the command line." msgstr "" +":mod:`trace` 模組可用來追蹤程式執行過程、產生帶註解的陳述式涵蓋範圍清單、輸出" +"呼叫者/被呼叫者的關係,以及在程式執行期間被執行的函式串列。它可以在其他程式" +"中使用,也可以從命令列啟動。" #: ../../library/trace.rst:18 msgid "`Coverage.py `_" @@ -42,17 +47,17 @@ msgstr "`Coverage.py `_" msgid "" "A popular third-party coverage tool that provides HTML output along with " "advanced features such as branch coverage." -msgstr "" +msgstr "一款受歡迎的第三方涵蓋範圍工具,提供 HTML 輸出與分支涵蓋等進階功能。" #: ../../library/trace.rst:25 msgid "Command-Line Usage" -msgstr "" +msgstr "命令列用法" #: ../../library/trace.rst:27 msgid "" "The :mod:`trace` module can be invoked from the command line. It can be as " "simple as ::" -msgstr "" +msgstr ":mod:`trace` 模組可從命令列執行,用法可以非常簡單,如:::" #: ../../library/trace.rst:30 msgid "python -m trace --count -C . somefile.py ..." @@ -64,22 +69,24 @@ msgid "" "of all Python modules imported during the execution into the current " "directory." msgstr "" +"上述命令會執行 :file:`somefile.py`,並將產生執行期間所引入的所有 Python 模組" +"的帶註解串列,輸出至目前目錄。" #: ../../library/trace.rst:39 msgid "Display usage and exit." -msgstr "" +msgstr "顯示用法並結束程式。" #: ../../library/trace.rst:43 msgid "Display the version of the module and exit." -msgstr "" +msgstr "顯示模組版本並結束程式。" #: ../../library/trace.rst:45 msgid "Added ``--module`` option that allows to run an executable module." -msgstr "" +msgstr "新增 ``--module`` 選項,允許執行可執行模組。" #: ../../library/trace.rst:49 msgid "Main options" -msgstr "" +msgstr "主要選項" #: ../../library/trace.rst:51 msgid "" @@ -89,6 +96,10 @@ msgid "" "`--listfuncs <-l>` is provided, neither :option:`--count <-c>` nor :option:" "`--trace <-t>` are accepted, and vice versa." msgstr "" +"執行 :mod:`trace` 時,至少必須指定以下選項之一。:option:`--listfuncs <-l>` 選" +"項與 :option:`--trace <-t>` 及 :option:`--count <-c>` 選項互斥。當提供 :" +"option:`--listfuncs <-l>` 時,將不接受 :option:`--count <-c>` 或 :option:`--" +"trace <-t>`,反之亦然。" #: ../../library/trace.rst:61 msgid "" @@ -96,14 +107,17 @@ msgid "" "how many times each statement was executed. See also :option:`--coverdir <-" "C>`, :option:`--file <-f>` and :option:`--no-report <-R>` below." msgstr "" +"在程式執行結束時產生一組帶註解串列檔案,顯示每個陳述式被執行的次數。參見下方" +"的 :option:`--coverdir <-C>`、:option:`--file <-f>` 及 :option:`--no-report " +"<-R>`。" #: ../../library/trace.rst:68 msgid "Display lines as they are executed." -msgstr "" +msgstr "執行時即時顯示每一行。" #: ../../library/trace.rst:72 msgid "Display the functions executed by running the program." -msgstr "" +msgstr "顯示程式執行過程中被呼叫的函式。" #: ../../library/trace.rst:76 msgid "" @@ -111,38 +125,46 @@ msgid "" "`--count <-c>` and :option:`--file <-f>` option. This does not execute any " "code." msgstr "" +"從先前使用 :option:`--count <-c>` 與 :option:`--file <-f>` 選項執行過的程式生" +"成帶註解的串列,不會執行任何程式碼。" #: ../../library/trace.rst:82 msgid "Display the calling relationships exposed by running the program." -msgstr "" +msgstr "顯示程式執行時產生的呼叫關係。" #: ../../library/trace.rst:85 msgid "Modifiers" -msgstr "" +msgstr "修飾子(Modifier)" #: ../../library/trace.rst:91 msgid "" "Name of a file to accumulate counts over several tracing runs. Should be " "used with the :option:`--count <-c>` option." msgstr "" +"指定用來累積多次追蹤結果的檔案之名稱。應與 :option:`--count <-c>` 選項搭配使" +"用。" #: ../../library/trace.rst:96 msgid "" "Directory where the report files go. The coverage report for ``package." "module`` is written to file :file:`{dir}/{package}/{module}.cover`." msgstr "" +"報告檔案的輸出目錄。``package.module`` 的涵蓋範圍報告將寫入檔案::file:" +"`{dir}/{package}/{module}.cover`。" #: ../../library/trace.rst:101 msgid "" "When generating annotated listings, mark lines which were not executed with " "``>>>>>>``." -msgstr "" +msgstr "在產生帶註解的串列時,使用 ``>>>>>>`` 標記未被執行的程式碼行。" #: ../../library/trace.rst:106 msgid "" "When using :option:`--count <-c>` or :option:`--report <-r>`, write a brief " "summary to stdout for each file processed." msgstr "" +"使用 :option:`--count <-c>` 或 :option:`--report <-r>` 時,會將每個處理過的檔" +"案摘要輸出至 stdout。" #: ../../library/trace.rst:111 msgid "" @@ -150,36 +172,41 @@ msgid "" "several runs with :option:`--count <-c>`, and then produce a single set of " "annotated listings at the end." msgstr "" +"不產生帶註解的串列。若你打算多次使用 :option:`--count <-c>` 執行程式,並在最" +"後再統一產生串列,這會很有幫助。" #: ../../library/trace.rst:117 msgid "" "Prefix each line with the time since the program started. Only used while " "tracing." -msgstr "" +msgstr "在每一行前加上自程式啟動以來的經過時間。僅在追蹤時使用。" #: ../../library/trace.rst:121 msgid "Filters" -msgstr "" +msgstr "篩選子(Filter)" #: ../../library/trace.rst:123 msgid "These options may be repeated multiple times." -msgstr "" +msgstr "這些選項可以重複使用多次。" #: ../../library/trace.rst:129 msgid "" "Ignore each of the given module names and its submodules (if it is a " "package). The argument can be a list of names separated by a comma." msgstr "" +"忽略所指定的模組名稱及其子模組(若為套件)。引數可以是以逗號分隔的名稱串列。" #: ../../library/trace.rst:134 msgid "" "Ignore all modules and packages in the named directory and subdirectories. " "The argument can be a list of directories separated by :data:`os.pathsep`." msgstr "" +"忽略指定目錄及其子目錄中的所有模組與套件。引數可以是以 :data:`os.pathsep` 分" +"隔的目錄串列。" #: ../../library/trace.rst:140 msgid "Programmatic Interface" -msgstr "" +msgstr "程式介面" #: ../../library/trace.rst:145 msgid "" @@ -194,6 +221,12 @@ msgid "" "count information. *timing* enables a timestamp relative to when tracing " "was started to be displayed." msgstr "" +"建立一個物件以追蹤單一陳述式或運算式的執行。所有參數皆為可選的。*count* 啟用" +"行數統計,*trace* 啟用逐行追蹤執行,*countfuncs* 可列出執行期間呼叫的函式," +"*countcallers* 追蹤呼叫關係,*ignoremods* 是要忽略的模組或套件名稱串列," +"*ignoredirs* 是其模組或套件應被忽略的目錄串列,*infile* 是讀取儲存計數資料的" +"檔案名稱,*outfile* 是要寫入更新後計數資料的檔案名稱,*timing* 則會顯示自開始" +"追蹤以來的時間戳記。" #: ../../library/trace.rst:158 msgid "" @@ -201,6 +234,8 @@ msgid "" "current tracing parameters. *cmd* must be a string or code object, suitable " "for passing into :func:`exec`." msgstr "" +"執行命令,並依目前追蹤參數收集執行統計資料。*cmd* 必須是可傳入 :func:`exec` " +"的字串或程式碼物件。" #: ../../library/trace.rst:164 msgid "" @@ -208,12 +243,16 @@ msgid "" "current tracing parameters, in the defined global and local environments. " "If not defined, *globals* and *locals* default to empty dictionaries." msgstr "" +"在指定的全域與區域命名空間中,根據目前的追蹤參數執行命令並收集統計資料。若未" +"指定,*globals* 與 *locals* 預設為空字典。" #: ../../library/trace.rst:171 msgid "" "Call *func* with the given arguments under control of the :class:`Trace` " "object with the current tracing parameters." msgstr "" +"在目前的追蹤參數下,使用 :class:`Trace` 物件控制呼叫 *func*,並傳入指定的引" +"數。" #: ../../library/trace.rst:176 msgid "" @@ -221,16 +260,21 @@ msgid "" "results of all previous calls to ``run``, ``runctx`` and ``runfunc`` for the " "given :class:`Trace` instance. Does not reset the accumulated trace results." msgstr "" +"回傳一個 :class:`CoverageResults` 物件,包含指定 :class:`Trace` 實例中所有先" +"前對 ``run``、``runctx`` 與 ``runfunc`` 呼叫的累積結果。不會重設累積的追蹤結" +"果。" #: ../../library/trace.rst:183 msgid "" "A container for coverage results, created by :meth:`Trace.results`. Should " "not be created directly by the user." msgstr "" +"一個用來儲存涵蓋範圍結果的容器,由 :meth:`Trace.results` 建立。不應由使用者直" +"接建立。" #: ../../library/trace.rst:188 msgid "Merge in data from another :class:`CoverageResults` object." -msgstr "" +msgstr "合併來自另一個 :class:`CoverageResults` 物件的資料。" #: ../../library/trace.rst:193 msgid "" @@ -240,6 +284,10 @@ msgid "" "be output. If ``None``, the results for each source file are placed in its " "directory." msgstr "" +"寫入涵蓋範圍結果。將 *show_missing* 設為真可顯示未被執行的程式碼行;將 " +"*summary* 設為真則會在輸出中加入每個模組的涵蓋範圍摘要。*coverdir* 指定輸出涵" +"蓋範圍結果檔案的目錄,若為 ``None``,則每個原始檔案的結果會輸出至其所在目錄" +"中。" #: ../../library/trace.rst:199 msgid "" @@ -247,14 +295,16 @@ msgid "" "longer exist are silently ignored. Otherwise, a missing file will raise a :" "exc:`FileNotFoundError`." msgstr "" +"若 *ignore_missing_files* 為 ``True``,則會忽略那些已不存在的檔案的涵蓋範圍資" +"料,不會顯示任何錯誤。否則,缺少的檔案將會引發 :exc:`FileNotFoundError`。" #: ../../library/trace.rst:203 msgid "Added *ignore_missing_files* parameter." -msgstr "" +msgstr "新增 *ignore_missing_files* 參數。" #: ../../library/trace.rst:206 msgid "A simple example demonstrating the use of the programmatic interface::" -msgstr "" +msgstr "以下是一個簡單範例,展示如何使用程式介面:" #: ../../library/trace.rst:208 msgid "" @@ -275,3 +325,19 @@ msgid "" "r = tracer.results()\n" "r.write_results(show_missing=True, coverdir=\".\")" msgstr "" +"import sys\n" +"import trace\n" +"\n" +"# 建立一個 Trace 物件,指定要忽略的目錄,\n" +"# 並設定是否進行追蹤、行數統計或兩者皆做。\n" +"tracer = trace.Trace(\n" +" ignoredirs=[sys.prefix, sys.exec_prefix],\n" +" trace=0,\n" +" count=1)\n" +"\n" +"# 使用該 tracer 執行新的命令\n" +"tracer.run('main()')\n" +"\n" +"# 建立報告,將輸出放在目前目錄中\n" +"r = tracer.results()\n" +"r.write_results(show_missing=True, coverdir=\".\")" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index c86aa43ca4..afffe28d19 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -1,15 +1,15 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # +# Translators: +# Dr-XYZ , 2025 msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-10-11 00:13+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2025-06-21 20:00+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 +33,10 @@ msgid "" "if no system time zone data is available, the library will fall back to " "using the first-party :pypi:`tzdata` package available on PyPI." msgstr "" +":mod:`zoneinfo` 模組提供了一個具體的時區實作,以支援 :pep:`615` 中最初指定的 " +"IANA 時區資料庫。預設情況下,如果可用,:mod:`zoneinfo` 會使用系統的時區資料;" +"如果沒有可用的系統時區資料,該函式庫將轉而使用 PyPI 上可用的第一方 :pypi:" +"`tzdata` 套件。" #: ../../library/zoneinfo.rst:24 msgid "Module: :mod:`datetime`" @@ -43,6 +47,8 @@ msgid "" "Provides the :class:`~datetime.time` and :class:`~datetime.datetime` types " "with which the :class:`ZoneInfo` class is designed to be used." msgstr "" +"提供了 :class:`~datetime.time` 與 :class:`~datetime.datetime` 型別,這些型別" +"是設計來與 :class:`ZoneInfo` 類別一起使用的。" #: ../../library/zoneinfo.rst:28 msgid "Package :pypi:`tzdata`" @@ -52,11 +58,11 @@ msgstr ":pypi:`tzdata` 套件" msgid "" "First-party package maintained by the CPython core developers to supply time " "zone data via PyPI." -msgstr "" +msgstr "由 CPython 核心開發者維護的第一方套件,用於透過 PyPI 提供時區資料。" #: ../../includes/wasm-notavail.rst:3 msgid "Availability" -msgstr "" +msgstr "可用性" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -68,7 +74,7 @@ msgstr "" #: ../../library/zoneinfo.rst:35 msgid "Using ``ZoneInfo``" -msgstr "" +msgstr "使用 ``ZoneInfo``" #: ../../library/zoneinfo.rst:37 msgid "" @@ -78,14 +84,18 @@ msgid "" "replace>` method or :meth:`datetime.astimezone `::" msgstr "" +":class:`ZoneInfo` 是 :class:`datetime.tzinfo` 抽象基底類別的一個具體實作,旨" +"在透過建構函式、:meth:`datetime.replace ` 方法或 :" +"meth:`datetime.astimezone ` 方法附加到 " +"``tzinfo``: ::" #: ../../library/zoneinfo.rst:42 msgid "" ">>> from zoneinfo import ZoneInfo\n" ">>> from datetime import datetime, timedelta\n" "\n" -">>> dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo(\"America/" -"Los_Angeles\"))\n" +">>> dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo(\"America/Los_Angeles" +"\"))\n" ">>> print(dt)\n" "2020-10-31 12:00:00-07:00\n" "\n" @@ -95,8 +105,8 @@ msgstr "" ">>> from zoneinfo import ZoneInfo\n" ">>> from datetime import datetime, timedelta\n" "\n" -">>> dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo(\"America/" -"Los_Angeles\"))\n" +">>> dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo(\"America/Los_Angeles" +"\"))\n" ">>> print(dt)\n" "2020-10-31 12:00:00-07:00\n" "\n" @@ -108,6 +118,8 @@ msgid "" "Datetimes constructed in this way are compatible with datetime arithmetic " "and handle daylight saving time transitions with no further intervention::" msgstr "" +"以此方式建構的 Datetime 物件與 datetime 運算相容,並能處理日光節約時間轉換而" +"無需進一步干預: ::" #: ../../library/zoneinfo.rst:55 msgid "" @@ -135,6 +147,10 @@ msgid "" "offset from *before* the transition is used when ``fold=0``, and the offset " "*after* the transition is used when ``fold=1``, for example::" msgstr "" +"這些時區也支援 :pep:`495` 中引入的 :attr:`~datetime.datetime.fold` 屬性。在會" +"引發時間模糊的時差轉換期間(例如日光節約時間到標準時間的轉換),當 " +"``fold=0`` 時,會使用轉換\\ *前*\\ 的時差,而當 ``fold=1`` 時,會使用轉換\\ *" +"後*\\ 的時差,例如: ::" #: ../../library/zoneinfo.rst:69 msgid "" @@ -156,7 +172,7 @@ msgstr "" msgid "" "When converting from another time zone, the fold will be set to the correct " "value::" -msgstr "" +msgstr "當從另一個時區轉換時,fold 將被設定為正確的值: ::" #: ../../library/zoneinfo.rst:79 msgid "" @@ -172,10 +188,21 @@ msgid "" ">>> print((dt_utc + timedelta(hours=1)).astimezone(LOS_ANGELES))\n" "2020-11-01 01:00:00-08:00" msgstr "" +">>> from datetime import timezone\n" +">>> LOS_ANGELES = ZoneInfo(\"America/Los_Angeles\")\n" +">>> dt_utc = datetime(2020, 11, 1, 8, tzinfo=timezone.utc)\n" +"\n" +">>> # 在 PDT 轉換為 PST 之前\n" +">>> print(dt_utc.astimezone(LOS_ANGELES))\n" +"2020-11-01 01:00:00-07:00\n" +"\n" +">>> # 在 PDT 轉換為 PST 之後\n" +">>> print((dt_utc + timedelta(hours=1)).astimezone(LOS_ANGELES))\n" +"2020-11-01 01:00:00-08:00" #: ../../library/zoneinfo.rst:92 msgid "Data sources" -msgstr "" +msgstr "資料來源" #: ../../library/zoneinfo.rst:94 msgid "" @@ -188,10 +215,15 @@ msgid "" "system data nor tzdata are available, all calls to :class:`ZoneInfo` will " "raise :exc:`ZoneInfoNotFoundError`." msgstr "" +"``zoneinfo`` 模組不直接提供時區資料,而是從系統時區資料庫或可用的第一方 PyPI " +"套件 :pypi:`tzdata` 中提取時區資訊。某些系統,特別是 Windows 系統,沒有可用" +"的 IANA 資料庫,因此對於需要時區資料且目標為跨平台相容性的專案,建議宣告對 " +"tzdata 的依賴。如果系統資料和 tzdata 都不可用,所有對 :class:`ZoneInfo` 的呼" +"叫都將引發 :exc:`ZoneInfoNotFoundError` 例外。" #: ../../library/zoneinfo.rst:106 msgid "Configuring the data sources" -msgstr "" +msgstr "設定資料來源" #: ../../library/zoneinfo.rst:108 msgid "" @@ -200,28 +232,37 @@ msgid "" "failure looks for a match in the tzdata package. This behavior can be " "configured in three ways:" msgstr "" +"當呼叫 ``ZoneInfo(key)`` 時,建構函式會先在 :data:`TZPATH` 中指定的目錄中搜尋" +"符合 ``key`` 的檔案,如果失敗,則在 tzdata 套件中尋找符合的項目。此行為可以透" +"過三種方式設定:" #: ../../library/zoneinfo.rst:113 msgid "" "The default :data:`TZPATH` when not otherwise specified can be configured " "at :ref:`compile time `." msgstr "" +"未另外指定時的預設 :data:`TZPATH` 可以在\\ :ref:`編譯時期 " +"`\\ 設定。" #: ../../library/zoneinfo.rst:115 msgid "" ":data:`TZPATH` can be configured using :ref:`an environment variable " "`." msgstr "" +":data:`TZPATH` 可以使用 :ref:`環境變數 ` 來設" +"定。" #: ../../library/zoneinfo.rst:117 msgid "" "At :ref:`runtime `, the search path can be " "manipulated using the :func:`reset_tzpath` function." msgstr "" +"在 :ref:`runtime `,可以使用 :func:" +"`reset_tzpath` 函式來操作搜尋路徑。" #: ../../library/zoneinfo.rst:123 msgid "Compile-time configuration" -msgstr "" +msgstr "編譯時期設定" #: ../../library/zoneinfo.rst:125 msgid "" @@ -234,16 +275,24 @@ msgid "" "tzpath <--with-tzpath>`), which should be a string delimited by :data:`os." "pathsep`." msgstr "" +"預設的 :data:`TZPATH` 包含時區資料庫的幾個常見部署位置(Windows 除外,因為 " +"Windows 上沒有時區資料的「眾所周知」位置)。在 POSIX 系統上,下游發行者和從原" +"始碼建置 Python 且知道其系統時區資料部署位置的人,可以透過指定編譯時期選項 " +"``TZPATH``\\ (或更有可能的是使用 :option:`configure 旗標 --with-tzpath <--" +"with-tzpath>`)來變更預設時區路徑,它應該是一個由 :data:`os.pathsep` 分隔的字" +"串。" #: ../../library/zoneinfo.rst:134 msgid "" "On all platforms, the configured value is available as the ``TZPATH`` key " "in :func:`sysconfig.get_config_var`." msgstr "" +"在所有平台上,設定的值可以透過 :func:`sysconfig.get_config_var` 中的 " +"``TZPATH`` 鍵取得。" #: ../../library/zoneinfo.rst:140 msgid "Environment configuration" -msgstr "" +msgstr "環境設定" #: ../../library/zoneinfo.rst:142 msgid "" @@ -252,6 +301,9 @@ msgid "" "use the environment variable ``PYTHONTZPATH``, if it exists, to set the " "search path." msgstr "" +"在初始化 :data:`TZPATH` 時(無論是在引入時,或是在呼叫不帶引數的 :func:" +"`reset_tzpath` 時),如果環境變數 ``PYTHONTZPATH`` 存在,``zoneinfo`` 模組將" +"使用它來設定搜尋路徑。" #: ../../library/zoneinfo.rst:149 msgid "" @@ -263,16 +315,20 @@ msgid "" "other implementations are free to silently ignore the erroneous component or " "raise an exception." msgstr "" +"這是一個由 :data:`os.pathsep` 分隔的字串,包含要使用的時區搜尋路徑。它必須只" +"包含絕對路徑,而非相對路徑。在 ``PYTHONTZPATH`` 中指定的相對路徑元件將不會被" +"使用,但除此之外,指定相對路徑時的行為是實作定義的;CPython 將引發 :exc:" +"`InvalidTZPathWarning`,但其他實作可以自由地靜默忽略錯誤的元件或引發例外。" #: ../../library/zoneinfo.rst:157 msgid "" "To set the system to ignore the system data and use the tzdata package " "instead, set ``PYTHONTZPATH=\"\"``." -msgstr "" +msgstr "要讓系統忽略系統資料並改用 tzdata 套件,請設定 ``PYTHONTZPATH=\"\"``。" #: ../../library/zoneinfo.rst:163 msgid "Runtime configuration" -msgstr "" +msgstr "Runtime 設定" #: ../../library/zoneinfo.rst:165 msgid "" @@ -282,10 +338,13 @@ msgid "" "a specific time zone path (or require disabling access to the system time " "zones)." msgstr "" +"TZ 搜尋路徑也可以在 Runtime 使用 :func:`reset_tzpath` 函式進行設定。這通常不" +"是一個建議的操作,儘管在需要使用特定時區路徑(或需要停用對系統時區的存取)的" +"測試函式中使用它是合理的。" #: ../../library/zoneinfo.rst:172 msgid "The ``ZoneInfo`` class" -msgstr "" +msgstr "``ZoneInfo`` 類別" #: ../../library/zoneinfo.rst:176 msgid "" @@ -295,6 +354,10 @@ msgid "" "cache invalidation via :meth:`ZoneInfo.clear_cache`, for all values of " "``key``, the following assertion will always be true:" msgstr "" +"一個具體的 :class:`datetime.tzinfo` 子類別,代表由字串 ``key`` 指定的 IANA 時" +"區。對主要建構函式的呼叫將總是回傳比較結果相同的物件;換句話說,除非透過 :" +"meth:`ZoneInfo.clear_cache` 使快取失效,否則對於所有 ``key`` 的值,以下斷言將" +"永遠為真:" #: ../../library/zoneinfo.rst:182 msgid "" @@ -312,16 +375,20 @@ msgid "" "level references. The constructor will raise :exc:`ValueError` if a non-" "conforming key is passed." msgstr "" +"``key`` 必須是相對、正規化的 POSIX 路徑形式,且不含上層參照。如果傳入不符合規" +"範的鍵,建構函式將引發 :exc:`ValueError` 例外。" #: ../../library/zoneinfo.rst:192 msgid "" "If no file matching ``key`` is found, the constructor will raise :exc:" "`ZoneInfoNotFoundError`." msgstr "" +"如果找不到符合 ``key`` 的檔案,建構函式將引發 :exc:`ZoneInfoNotFoundError` 例" +"外。" #: ../../library/zoneinfo.rst:196 msgid "The ``ZoneInfo`` class has two alternate constructors:" -msgstr "" +msgstr "``ZoneInfo`` 類別有兩個備用建構函式:" #: ../../library/zoneinfo.rst:200 msgid "" @@ -329,17 +396,22 @@ msgid "" "g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike " "the primary constructor, this always constructs a new object." msgstr "" +"從回傳位元組的類檔案物件(例如以二進位模式開啟的檔案或一個 :class:`io." +"BytesIO` 物件)建構一個 ``ZoneInfo`` 物件。與主要建構函式不同,這個建構函式總" +"是會建構一個新物件。" #: ../../library/zoneinfo.rst:204 msgid "" "The ``key`` parameter sets the name of the zone for the purposes of :py:meth:" "`~object.__str__` and :py:meth:`~object.__repr__`." msgstr "" +"``key`` 參數設定了時區的名稱,用於 :py:meth:`~object.__str__` 和 :py:meth:" +"`~object.__repr__`。" #: ../../library/zoneinfo.rst:207 msgid "" "Objects created via this constructor cannot be pickled (see `pickling`_)." -msgstr "" +msgstr "透過此建構函式建立的物件無法被封裝(參閱 `pickling`_)。" #: ../../library/zoneinfo.rst:211 msgid "" @@ -349,22 +421,27 @@ msgid "" "it can also be used to create a system with a different cache invalidation " "strategy." msgstr "" +"一個繞過建構函式快取的備用建構函式。它與主要建構函式相同,但每次呼叫都會回傳" +"一個新物件。這對於測試或示範目的最可能有用,但它也可以用來建立一個具有不同快" +"取失效策略的系統。" #: ../../library/zoneinfo.rst:217 msgid "" "Objects created via this constructor will also bypass the cache of a " "deserializing process when unpickled." -msgstr "" +msgstr "透過此建構函式建立的物件,在拆封時也會繞過去序列化過程的快取。" #: ../../library/zoneinfo.rst:224 msgid "" "Using this constructor may change the semantics of your datetimes in " "surprising ways, only use it if you know that you need to." msgstr "" +"使用此建構函式可能會以意想不到的方式改變你的 datetime 物件的語意,只有在你確" +"定需要時才使用它。" #: ../../library/zoneinfo.rst:227 msgid "The following class methods are also available:" -msgstr "" +msgstr "以下類別方法也可用:" #: ../../library/zoneinfo.rst:231 msgid "" @@ -372,6 +449,8 @@ msgid "" "arguments are passed, all caches are invalidated and the next call to the " "primary constructor for each key will return a new instance." msgstr "" +"一個用於使 ``ZoneInfo`` 類別上的快取失效的方法。如果沒有傳入引數,所有快取都" +"會失效,且下一次對每個鍵的主要建構函式呼叫都將回傳一個新的實例。" #: ../../library/zoneinfo.rst:235 msgid "" @@ -379,6 +458,8 @@ msgid "" "the specified keys will be removed from the cache. Keys passed to " "``only_keys`` but not found in the cache are ignored." msgstr "" +"如果將一個包含鍵名的可疊代物件傳遞給 ``only_keys`` 參數,則只有指定的鍵會從快" +"取中移除。傳遞給 ``only_keys`` 但在快取中找不到的鍵會被忽略。" #: ../../library/zoneinfo.rst:243 msgid "" @@ -386,10 +467,12 @@ msgid "" "``ZoneInfo`` in surprising ways; this modifies module state and thus may " "have wide-ranging effects. Only use it if you know that you need to." msgstr "" +"呼叫此函式可能會以意想不到的方式改變使用 ``ZoneInfo`` 的 datetime 物件的語" +"意;這會修改模組狀態,因此可能產生廣泛的影響。只有在你確定需要時才使用它。" #: ../../library/zoneinfo.rst:248 msgid "The class has one attribute:" -msgstr "" +msgstr "該類別有一個屬性:" #: ../../library/zoneinfo.rst:252 msgid "" @@ -398,12 +481,15 @@ msgid "" "zone database (e.g. ``America/New_York``, ``Europe/Paris`` or ``Asia/" "Tokyo``)." msgstr "" +"這是一個唯讀 :term:`屬性 `,它回傳傳遞給建構函式的 ``key`` 值,該" +"值應為 IANA 時區資料庫中的查詢鍵(例如 ``America/New_York``、``Europe/" +"Paris`` 或 ``Asia/Tokyo``)。" #: ../../library/zoneinfo.rst:257 msgid "" "For zones constructed from file without specifying a ``key`` parameter, this " "will be set to ``None``." -msgstr "" +msgstr "對於從檔案建構且未指定 ``key`` 參數的時區,此屬性將被設定為 ``None``。" #: ../../library/zoneinfo.rst:262 msgid "" @@ -413,10 +499,13 @@ msgid "" "Unicode Common Locale Data Repository) can be used to get more user-friendly " "strings from these keys." msgstr "" +"雖然將這些值暴露給終端使用者是一種相當普遍的做法,但這些值被設計為表示相關時" +"區的主鍵,而不一定是面向使用者的元素。像 CLDR(Unicode 通用地區資料儲存庫)這" +"樣的專案可以用來從這些鍵中取得更友善的使用者字串。" #: ../../library/zoneinfo.rst:269 msgid "String representations" -msgstr "" +msgstr "字串表示" #: ../../library/zoneinfo.rst:271 msgid "" @@ -424,6 +513,8 @@ msgid "" "`ZoneInfo` object defaults to using the :attr:`ZoneInfo.key` attribute (see " "the note on usage in the attribute documentation)::" msgstr "" +"在 :class:`ZoneInfo` 物件上呼叫 :py:class:`str` 時回傳的字串表示,預設使用 :" +"attr:`ZoneInfo.key` 屬性(參閱屬性文件中的使用說明): ::" #: ../../library/zoneinfo.rst:275 msgid "" @@ -450,10 +541,13 @@ msgid "" "implementation-defined and not necessarily stable between versions, but it " "is guaranteed not to be a valid ``ZoneInfo`` key." msgstr "" +"對於從檔案建構且未指定 ``key`` 參數的物件,``str`` 會轉而呼叫 :func:`repr`。" +"``ZoneInfo`` 的 ``repr`` 是實作定義的,且不保證在不同版本之間保持穩定,但保證" +"它不會是一個有效的 ``ZoneInfo`` 鍵。" #: ../../library/zoneinfo.rst:291 msgid "Pickle serialization" -msgstr "" +msgstr "封裝(Pickle)序列化" #: ../../library/zoneinfo.rst:293 msgid "" @@ -461,10 +555,12 @@ msgid "" "serialized by key, and ``ZoneInfo`` objects constructed from files (even " "those with a value for ``key`` specified) cannot be pickled." msgstr "" +"``ZoneInfo`` 物件不是序列化所有轉換資料,而是按鍵進行序列化,而從檔案建構的 " +"``ZoneInfo`` 物件(即使是那些指定了 ``key`` 值的物件)也無法被封裝。" #: ../../library/zoneinfo.rst:297 msgid "The behavior of a ``ZoneInfo`` file depends on how it was constructed:" -msgstr "" +msgstr "``ZoneInfo`` 檔案的行為取決於它的建構方式:" #: ../../library/zoneinfo.rst:299 msgid "" @@ -476,6 +572,10 @@ msgid "" "constructed from ``ZoneInfo(\"Europe/Berlin\")``, one would expect the " "following behavior:" msgstr "" +"``ZoneInfo(key)``:當使用主要建構函式建構時,``ZoneInfo`` 物件會按鍵序列化," +"而在去序列化時,去序列化過程會使用主要建構函式,因此預期這些物件會與指向相同" +"時區的其他參照是同一個物件。例如,如果 ``europe_berlin_pkl`` 是一個包含從 " +"``ZoneInfo(\"Europe/Berlin\")`` 建構並封裝的字串,會預期以下行為:" #: ../../library/zoneinfo.rst:307 msgid "" @@ -498,6 +598,10 @@ msgid "" "constructed from ``ZoneInfo.no_cache(\"Europe/Berlin\")``, one would expect " "the following behavior:" msgstr "" +"``ZoneInfo.no_cache(key)``:當從繞過快取的建構函式建構時,``ZoneInfo`` 物件也" +"會按鍵序列化,但在去序列化時,去序列化過程會使用繞過快取的建構函式。如果 " +"``europe_berlin_pkl_nc`` 是一個包含從 ``ZoneInfo.no_cache(\"Europe/Berlin" +"\")`` 建構並封裝的字串,會預期以下行為:" #: ../../library/zoneinfo.rst:321 msgid "" @@ -519,6 +623,10 @@ msgid "" "use a wrapper type or a custom serialization function: either serializing by " "key or storing the contents of the file object and serializing that." msgstr "" +"``ZoneInfo.from_file(fobj, /, key=None)``:當從檔案建構時,``ZoneInfo`` 物件" +"在封裝時會引發例外。如果終端使用者想要封裝一個從檔案建構的 ``ZoneInfo``,建議" +"他們使用包裝器型別或自訂序列化函式:可以按鍵序列化,或儲存檔案物件的內容並將" +"其序列化。" #: ../../library/zoneinfo.rst:334 msgid "" @@ -530,6 +638,9 @@ msgid "" "a ``ZoneInfo`` pickled in an environment with a different version of the " "time zone data." msgstr "" +"這種序列化方法要求所需鍵的時區資料在序列化和去序列化兩端都可用,這與對類別和" +"函式的參照預期存在於序列化和去序列化環境中的方式相似。這也意味著,當在具有不" +"同版本時區資料的環境中拆封一個封裝的 ``ZoneInfo`` 時,不保證結果的一致性。" #: ../../library/zoneinfo.rst:342 msgid "Functions" @@ -541,6 +652,8 @@ msgid "" "anywhere on the time zone path. This is recalculated on every call to the " "function." msgstr "" +"取得一個集合,其中包含時區路徑上任何地方可用的所有 IANA 時區的有效鍵。這會在" +"每次呼叫函式時重新計算。" #: ../../library/zoneinfo.rst:350 msgid "" @@ -548,6 +661,8 @@ msgid "" "\"special\" zones such as those under the ``posix/`` and ``right/`` " "directories, or the ``posixrules`` zone." msgstr "" +"此函式僅包含規範的時區名稱,不包含「特殊」時區,例如 ``posix/`` 和 ``right/" +"`` 目錄下的時區,或 ``posixrules`` 時區。" #: ../../library/zoneinfo.rst:356 msgid "" @@ -555,6 +670,8 @@ msgid "" "if a file on the time zone path is a valid time zone is to read the \"magic " "string\" at the beginning." msgstr "" +"此函式可能會開啟大量檔案,因為確定時區路徑上的檔案是否為有效時區的最佳方法是" +"讀取開頭的「魔術字串」。" #: ../../library/zoneinfo.rst:362 msgid "" @@ -563,12 +680,17 @@ msgid "" "Locale Data Repository) to get more user-friendly strings. See also the " "cautionary note on :attr:`ZoneInfo.key`." msgstr "" +"這些值並非設計來暴露給終端使用者;對於面向使用者的元素,應用程式應使用像 " +"CLDR(Unicode 通用地區資料儲存庫)這樣的工具來取得更友善的使用者字串。另請參" +"閱關於 :attr:`ZoneInfo.key` 的警示說明。" #: ../../library/zoneinfo.rst:369 msgid "" "Sets or resets the time zone search path (:data:`TZPATH`) for the module. " "When called with no arguments, :data:`TZPATH` is set to the default value." msgstr "" +"為模組設定或重設時區搜尋路徑(:data:`TZPATH`)。當不帶引數呼叫時,:data:" +"`TZPATH` 會被設定為預設值。" #: ../../library/zoneinfo.rst:372 msgid "" @@ -576,6 +698,8 @@ msgid "" "and so calls to the primary ``ZoneInfo`` constructor will only use the new " "``TZPATH`` in the case of a cache miss." msgstr "" +"呼叫 ``reset_tzpath`` 不會使 :class:`ZoneInfo` 快取失效,因此對主要 " +"``ZoneInfo`` 建構函式的呼叫只會在快取未命中時才使用新的 ``TZPATH``。" #: ../../library/zoneinfo.rst:376 msgid "" @@ -584,10 +708,13 @@ msgid "" "`ValueError` will be raised if something other than an absolute path is " "passed." msgstr "" +"``to`` 參數必須是一個由字串或 :class:`os.PathLike` 組成的 :term:`序列 " +"`,而不是一個字串,其中所有元素都必須是絕對路徑。如果傳入的不是絕對" +"路徑,將會引發 :exc:`ValueError` 例外。" #: ../../library/zoneinfo.rst:382 msgid "Globals" -msgstr "" +msgstr "全域變數" #: ../../library/zoneinfo.rst:386 msgid "" @@ -595,12 +722,14 @@ msgid "" "constructing a ``ZoneInfo`` from a key, the key is joined to each entry in " "the ``TZPATH``, and the first file found is used." msgstr "" +"一個表示時區搜尋路徑的唯讀序列 —— 當從一個鍵建構 ``ZoneInfo`` 時,該鍵會與 " +"``TZPATH`` 中的每個條目結合,並使用找到的第一個檔案。" #: ../../library/zoneinfo.rst:390 msgid "" "``TZPATH`` may contain only absolute paths, never relative paths, regardless " "of how it is configured." -msgstr "" +msgstr "``TZPATH`` 只能包含絕對路徑,絕不能包含相對路徑,無論如何設定。" #: ../../library/zoneinfo.rst:393 msgid "" @@ -609,16 +738,20 @@ msgid "" "TZPATH`` rather than importing ``TZPATH`` from ``zoneinfo`` or assigning a " "long-lived variable to ``zoneinfo.TZPATH``." msgstr "" +"``zoneinfo.TZPATH`` 指向的物件可能會因應對 :func:`reset_tzpath` 的呼叫而改" +"變,因此建議使用 ``zoneinfo.TZPATH``,而不是從 ``zoneinfo`` 引入 ``TZPATH`` " +"或將一個長生命週期的變數賦值給 ``zoneinfo.TZPATH``。" #: ../../library/zoneinfo.rst:398 msgid "" "For more information on configuring the time zone search path, see :ref:" "`zoneinfo_data_configuration`." msgstr "" +"有關設定時區搜尋路徑的更多資訊,請參閱 :ref:`zoneinfo_data_configuration`。" #: ../../library/zoneinfo.rst:402 msgid "Exceptions and warnings" -msgstr "" +msgstr "例外與警告" #: ../../library/zoneinfo.rst:406 msgid "" @@ -626,9 +759,12 @@ msgid "" "specified key could not be found on the system. This is a subclass of :exc:" "`KeyError`." msgstr "" +"當建構 :class:`ZoneInfo` 物件因在系統上找不到指定的鍵而失敗時引發。這是 :exc:" +"`KeyError` 的一個子類別。" #: ../../library/zoneinfo.rst:412 msgid "" "Raised when :envvar:`PYTHONTZPATH` contains an invalid component that will " "be filtered out, such as a relative path." msgstr "" +"當 :envvar:`PYTHONTZPATH` 包含將被過濾掉的無效元件(例如相對路徑)時引發。"