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` 包含將被過濾掉的無效元件(例如相對路徑)時引發。"