From 4f8f2805e39fb000966adf4473a595315f3a47b4 Mon Sep 17 00:00:00 2001 From: Payon Date: Wed, 20 Nov 2024 17:15:57 +0800 Subject: [PATCH] feat: translate time in 3.13 (#979) Co-authored-by: Wei-Hsiang (Matt) Wang --- library/time.po | 143 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 117 insertions(+), 26 deletions(-) diff --git a/library/time.po b/library/time.po index b110d06f95..a3390646e8 100644 --- a/library/time.po +++ b/library/time.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-11-01 00:15+0000\n" -"PO-Revision-Date: 2024-08-14 16:05+0800\n" +"PO-Revision-Date: 2024-11-20 15:25+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.4.4\n" +"X-Generator: Poedit 3.5\n" #: ../../library/time.rst:2 msgid ":mod:`!time` --- Time access and conversions" @@ -275,7 +275,7 @@ msgstr "" #: ../../library/time.rst:953 ../../library/time.rst:962 #: ../../library/time.rst:975 msgid "Availability" -msgstr "" +msgstr ":ref:`適用 `" #: ../../library/time.rst:151 msgid "" @@ -478,29 +478,32 @@ msgstr "" #: ../../library/time.rst:290 ../../library/time.rst:700 msgid "Clock:" -msgstr "" +msgstr "時鐘:" #: ../../library/time.rst:292 msgid "" "On Windows, call ``QueryPerformanceCounter()`` and " "``QueryPerformanceFrequency()``." msgstr "" +"在 Windows 上,呼叫 ``QueryPerformanceCounter()`` 和 " +"``QueryPerformanceFrequency()``。" #: ../../library/time.rst:294 msgid "On macOS, call ``mach_absolute_time()`` and ``mach_timebase_info()``." msgstr "" +"在 macOS 上,呼叫 ``mach_absolute_time()`` 和 ``mach_timebase_info()``。" #: ../../library/time.rst:295 msgid "On HP-UX, call ``gethrtime()``." -msgstr "" +msgstr "在 HP-UX 上,呼叫 ``gethrtime()``。" #: ../../library/time.rst:296 msgid "Call ``clock_gettime(CLOCK_HIGHRES)`` if available." -msgstr "" +msgstr "如果可以的話,呼叫 ``clock_gettime(CLOCK_HIGHRES)``。" #: ../../library/time.rst:297 msgid "Otherwise, call ``clock_gettime(CLOCK_MONOTONIC)``." -msgstr "" +msgstr "否則,呼叫 ``clock_gettime(CLOCK_MONOTONIC)``。" #: ../../library/time.rst:299 msgid "" @@ -537,6 +540,8 @@ msgid "" "On CPython, use the same clock as :func:`time.monotonic` and is a monotonic " "clock, i.e. a clock that cannot go backwards." msgstr "" +"在 CPython 上,使用與 :func:`time.monotonic` 相同的時鐘,且其為單調時鐘(即不" +"能倒轉的時鐘)。" #: ../../library/time.rst:333 msgid "" @@ -551,7 +556,7 @@ msgstr "在 Windows 上,此函式現在涵蓋整個系統。" #: ../../library/time.rst:341 msgid "Use the same clock as :func:`time.monotonic`." -msgstr "與 :func:`time.monotonic` 使用相同的時鐘。" +msgstr "使用與 :func:`time.monotonic` 相同的時鐘。" #: ../../library/time.rst:347 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." @@ -640,6 +645,8 @@ msgid "" "Raises an :ref:`auditing event ` ``time.sleep`` with argument " "``secs``." msgstr "" +"引發一個帶有引數 ``secs`` 的\\ :ref:`稽核事件 (auditing event) ` " +"``time.sleep``。" #: ../../library/time.rst:404 msgid "" @@ -660,7 +667,7 @@ msgstr "" #: ../../library/time.rst:413 msgid "Raises an auditing event." -msgstr "" +msgstr "引發一個稽核事件。" #: ../../library/time.rst:421 msgid "" @@ -941,6 +948,8 @@ msgid "" "calendar year). The year starts with the week that contains the first " "Thursday of the calendar year." msgstr "" +"ISO 8601 年(類似於 ``%Y``,但遵循 ISO 8601 日曆年的規則)。年份從包含該日曆" +"年第一個星期四的那一週開始。" #: ../../library/time.rst:526 msgid "``%V``" @@ -952,6 +961,8 @@ msgid "" "year is the one that contains the first Thursday of the year. Weeks start on " "Monday." msgstr "" +"ISO 8601 週數(以十進位數表示 [01,53])。年份的第一週是包含該年第一個星期四的" +"那一週。每週從星期一開始。" #: ../../library/time.rst:531 msgid "``%%``" @@ -1264,15 +1275,15 @@ msgstr "" #: ../../library/time.rst:702 msgid "On Windows, call ``GetSystemTimeAsFileTime()``." -msgstr "" +msgstr "在 Windows 上,呼叫 ``GetSystemTimeAsFileTime()``。" #: ../../library/time.rst:703 msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." -msgstr "" +msgstr "如果可以的話,呼叫 ``clock_gettime(CLOCK_REALTIME)``。" #: ../../library/time.rst:704 msgid "Otherwise, call ``gettimeofday()``." -msgstr "" +msgstr "否則,呼叫 ``gettimeofday()``。" #: ../../library/time.rst:706 msgid "" @@ -1294,20 +1305,24 @@ msgid "" "returned value is undefined, so that only the difference between the results " "of two calls in the same thread is valid." msgstr "" +"回傳當前執行緒的系統和用戶 CPU 時間之和(以帶有小數的秒數表示)。它不包括睡眠" +"期間經過的時間。根據定義,這是執行緒特定 (thread-specific) 的。回傳值的參照點" +"未定義,因此只有同一執行緒中兩次呼叫結果之間的差異才是有效的。" #: ../../library/time.rst:731 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" +"使用 :func:`thread_time_ns` 以避免 :class:`float` 型別造成的精確度損失。" #: ../../library/time.rst:736 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." -msgstr "" +msgstr "有支援 ``CLOCK_THREAD_CPUTIME_ID`` 的 Unix 系統。" #: ../../library/time.rst:743 msgid "Similar to :func:`thread_time` but return time as nanoseconds." -msgstr "" +msgstr "類似於 :func:`thread_time`,但回傳以奈秒為單位的時間。" #: ../../library/time.rst:750 msgid "" @@ -1319,6 +1334,12 @@ msgid "" "saving time rules, or to nonzero if there is a time, past, present or future " "when daylight saving time applies)." msgstr "" +"重置函式庫常式 (routine) 使用的時間轉換規則。環境變數 :envvar:`TZ` 指定了這一" +"過程的實施方式。它還會設定變數 ``tzname``\\ (來自 :envvar:`TZ` 環境變數)、" +"``timezone``\\ (非日光節約時間的 UTC 以西的時間偏移,單位為秒)、" +"``altzone``\\ (日光節約時間的 UTC 以西的時間偏移,單位為秒)和 " +"``daylight``\\ (如果該時區沒有日光節約時間規則,則設定為 0;如果在過去、現在" +"或未來的某個時間有日光節約時間規則,則設置為非零的值)。" #: ../../library/time.rst:762 msgid "" @@ -1326,16 +1347,19 @@ msgid "" "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" +"雖然在許多情況下,更改 :envvar:`TZ` 環境變數可能會在沒有呼叫 :func:`tzset` 的" +"情況下影響 :func:`localtime` 等函式的輸出,但是這種行為是不該被依賴的。" #: ../../library/time.rst:766 msgid "The :envvar:`TZ` environment variable should contain no whitespace." -msgstr "" +msgstr ":envvar:`TZ` 環境變數不應包含空格字元。" #: ../../library/time.rst:768 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" +":envvar:`TZ` 環境變數的標準格式為(為了清楚表達,中間增加了空格字元): ::" #: ../../library/time.rst:771 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" @@ -1343,7 +1367,7 @@ msgstr "std offset [dst [offset [,start[/time], end[/time]]]]" #: ../../library/time.rst:773 msgid "Where the components are:" -msgstr "" +msgstr "其中各個組成部分為:" #: ../../library/time.rst:775 msgid "``std`` and ``dst``" @@ -1354,6 +1378,8 @@ msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" +"三個或更多字母與數字 (alphanumerics) 組成的時區縮寫。這些縮寫會被傳播到 time." +"tzname 中。" #: ../../library/time.rst:779 msgid "``offset``" @@ -1366,6 +1392,9 @@ msgid "" "of the Prime Meridian; otherwise, it is west. If no offset follows dst, " "summer time is assumed to be one hour ahead of standard time." msgstr "" +"偏移量的格式為:``± hh[:mm[:ss]]``。這表示為達到 UTC 而增加到當地時間的值。如" +"果以 '-' 開頭,則表示該時區位於本初子午線以東;否則,位於其西。如果 dst 之後" +"沒有偏移量,則假定日光時間比標準時間快一小時。" #: ../../library/time.rst:785 msgid "``start[/time], end[/time]``" @@ -1376,6 +1405,7 @@ msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" +"表示何時切換至日光節約時間及何時切換回來。開始和結束日期的格式如以下其一:" #: ../../library/time.rst:789 msgid ":samp:`J{n}`" @@ -1386,6 +1416,8 @@ msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" +"儒略日 (Julian day) *n*(1 <= *n* <= 365)。閏日不計算,因此在所有年份中,2 " +"月 28 日是第 59 天,3 月 1 日是第 60 天。" #: ../../library/time.rst:793 msgid ":samp:`{n}`" @@ -1396,6 +1428,7 @@ msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" +"從 0 開始的儒略日 (0 <= *n* <= 365)。閏日會計算,因此可以適用至 2 月 29 日。" #: ../../library/time.rst:797 msgid ":samp:`M{m}.{n}.{d}`" @@ -1408,12 +1441,17 @@ msgid "" "*m*\" which may occur in either the fourth or the fifth week). Week 1 is the " "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" +"一年中第 *m* 月的第 *n* 週的第 *d* 天(0 <= *d* <= 6,1 <= *n* <= 5,1 <= " +"*m* <= 12,其中 *n* 為 5 表示「該月的最後一個第 *d* 天」,這可能出現在第四或" +"第五週)。第 1 週是 *d* 天首次出現的那一週。第零天為星期天。" #: ../../library/time.rst:804 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" +"``time`` 的格式與 ``offset`` 相同,但不允許出現前導符號('-' 或 '+')。如果未" +"指定時間,則預設為 02:00:00。" #: ../../library/time.rst:809 msgid "" @@ -1445,6 +1483,12 @@ msgid "" "located at :file:`/usr/share/zoneinfo`. For example, ``'US/Eastern'``, " "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" +"在許多 Unix 系統(包括 \\*BSD、Linux、Solaris 和 Darwin)上,使用系統的 " +"zoneinfo (:manpage:`tzfile(5)`) 資料庫來指定時區規則會更加方便。要這樣做,請" +"將 :envvar:`TZ` 環境變數設定為所需時區資料檔案的路徑,相對於系統 'zoneinfo' " +"時區資料庫的根目錄,通常位於 :file:`/usr/share/zoneinfo`。例如,``'US/" +"Eastern'``、``'Australia/Melbourne'``、``'Egypt'`` 或 ``'Europe/" +"Amsterdam'``。 ::" #: ../../library/time.rst:826 msgid "" @@ -1457,22 +1501,31 @@ msgid "" ">>> time.tzname\n" "('EET', 'EEST')" msgstr "" +">>> os.environ['TZ'] = 'US/Eastern'\n" +">>> time.tzset()\n" +">>> time.tzname\n" +"('EST', 'EDT')\n" +">>> os.environ['TZ'] = 'Egypt'\n" +">>> time.tzset()\n" +">>> time.tzname\n" +"('EET', 'EEST')" #: ../../library/time.rst:839 msgid "Clock ID Constants" -msgstr "" +msgstr "時鐘 ID 常數" #: ../../library/time.rst:841 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." -msgstr "" +msgstr "這些常數用作 :func:`clock_getres` 和 :func:`clock_gettime` 的參數。" #: ../../library/time.rst:846 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" +"與 :data:`CLOCK_MONOTONIC` 基本相同,不同之處在於它還包括系統暫停的任何時間。" #: ../../library/time.rst:849 msgid "" @@ -1481,6 +1534,9 @@ msgid "" "have discontinuities if the time is changed using ``settimeofday()`` or " "similar." msgstr "" +"這允許應用程式獲取一個能夠感知暫停的單調時鐘,而無需處理 :data:" +"`CLOCK_REALTIME` 的複雜情況,後者在使用 ``settimeofday()`` 或類似函式更改時間" +"時可能會出現不連續的情況。" #: ../../library/time.rst:861 msgid "" @@ -1488,50 +1544,61 @@ msgid "" "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" +"Solaris 作業系統具有 ``CLOCK_HIGHRES`` 計時器,它嘗試使用最佳的硬體資源,並可" +"能提供接近奈秒的解析度。``CLOCK_HIGHRES`` 是不可調整且高解析度的時鐘。" #: ../../library/time.rst:872 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." -msgstr "" +msgstr "該時鐘無法被設定,其表示自某個未指定起點以來的單調時間。" #: ../../library/time.rst:882 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" +"類似於 :data:`CLOCK_MONOTONIC`,但提供對基於硬體的原始時間的存取,此時間不受 " +"NTP 調整的影響。" #: ../../library/time.rst:891 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." msgstr "" +"類似於 :data:`CLOCK_MONOTONIC_RAW`,但讀取的是系統在情境切換時快取的值,因此" +"精準度較低。" #: ../../library/time.rst:901 ../../library/time.rst:910 msgid "High-resolution per-process timer from the CPU." -msgstr "" +msgstr "來自 CPU 的高解析度每個行程的計時器。" #: ../../library/time.rst:918 msgid "" "`International Atomic Time `_" msgstr "" +"`國際原子時間 `_" #: ../../library/time.rst:920 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" +"系統必須擁有當前的閏秒表才能給出正確答案。PTP 或 NTP 軟體可以維護閏秒表。" #: ../../library/time.rst:929 msgid "Thread-specific CPU-time clock." -msgstr "" +msgstr "執行緒相關的 CPU 時間時鐘。" #: ../../library/time.rst:938 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" +"表示系統運作且無暫停的絕對時間,提供包括絕對時間 (absolute) 和時間區間 " +"(interval) 的精確的正常上線時間 (uptime) 測量。" #: ../../library/time.rst:949 msgid "" @@ -1539,28 +1606,32 @@ msgid "" "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" +"單調增量的時鐘,從某個任意點開始計時,不受頻率或時間調整影響,並且在系統休眠" +"時不增量。" #: ../../library/time.rst:959 msgid "" "Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " "context switches and therefore has less accuracy." msgstr "" +"類似於 :data:`CLOCK_UPTIME_RAW`,但該值在情境切換時由系統快取,因此精準度較" +"低。" #: ../../library/time.rst:966 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." -msgstr "" +msgstr "以下常數是唯一可以傳遞給 :func:`clock_settime` 的參數。" #: ../../library/time.rst:972 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." -msgstr "" +msgstr "涵蓋整個系統的即時時鐘。設定此時鐘需要適當的權限。" #: ../../library/time.rst:983 msgid "Timezone Constants" -msgstr "" +msgstr "時區常數" #: ../../library/time.rst:987 msgid "" @@ -1569,10 +1640,13 @@ msgid "" "Western Europe, including the UK). Only use this if ``daylight`` is " "nonzero. See note below." msgstr "" +"如果本地 DST 時區有被定義,則此值為本地 DST 時區相對於 UTC 以西的偏移量(以秒" +"為單位)。若本地 DST 時區位於 UTC 以東(例如包括英國在內的西歐),則此值為負" +"值。僅在 ``daylight`` 為非零時使用此值。詳情請參見下方註釋。" #: ../../library/time.rst:993 msgid "Nonzero if a DST timezone is defined. See note below." -msgstr "" +msgstr "如果定義了 DST 時區,則為非零值。詳情請參見下方註釋。" #: ../../library/time.rst:997 msgid "" @@ -1580,6 +1654,8 @@ msgid "" "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" +"本地(非 DST)時區相對於 UTC 以西的偏移量(以秒為單位),西歐大多數地區為負," +"美國為正,英國為零。詳情請參見下方註釋。" #: ../../library/time.rst:1002 msgid "" @@ -1587,6 +1663,8 @@ msgid "" "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" +"一個包含兩個字串的元組:第一個是本地非 DST 時區的名稱,第二個是本地 DST 時區" +"的名稱。如果沒有定義 DST 時區,則不應使用第二個字串。詳情請參見下方註釋。" #: ../../library/time.rst:1008 msgid "" @@ -1597,6 +1675,10 @@ msgid "" "attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :" "func:`localtime` to obtain timezone information." msgstr "" +"對於上述時區常數(:data:`altzone`、:data:`daylight`、:data:`timezone` 和 :" +"data:`tzname`),其值由模組載入時或 :func:`tzset` 最後一次被呼叫時的時區規則" +"決定,且過去的時間可能會不準確。建議使用 :func:`localtime` 回傳的 :attr:" +"`~struct_time.tm_gmtoff` 和 :attr:`~struct_time.tm_zone` 來獲取時區資訊。" #: ../../library/time.rst:1017 msgid "Module :mod:`datetime`" @@ -1604,7 +1686,7 @@ msgstr ":mod:`datetime` 模組" #: ../../library/time.rst:1018 msgid "More object-oriented interface to dates and times." -msgstr "" +msgstr "更多物件導向的日期和時間介面。" #: ../../library/time.rst:1020 msgid "Module :mod:`locale`" @@ -1616,6 +1698,8 @@ msgid "" "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" +"國際化服務。區域設定會影響 :func:`strftime` 和 :func:`strptime` 中許多格式指" +"定符號 (format specifiers) 的解譯。" #: ../../library/time.rst:1024 msgid "Module :mod:`calendar`" @@ -1626,6 +1710,8 @@ msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" +"通用的日曆相關函式。:func:`~calendar.timegm` 是本模組中 :func:`gmtime` 的反函" +"式。" #: ../../library/time.rst:1029 msgid "Footnotes" @@ -1641,6 +1727,11 @@ msgid "" "the 4-digit year has been first recommended by :rfc:`1123` and then mandated " "by :rfc:`2822`." msgstr "" +"現在 ``%Z`` 已被棄用,``%z`` 藉由擴展為偏好的小時/分鐘偏移而逃離了被棄用的命" +"運,但其並不是被所有 ANSI C 函式庫支援。此外,嚴格按照 1982 年的 :rfc:`822` " +"標準,應該使用兩位數年份(``%y`` 而不是 ``%Y``),但實作中在 2000 年之前就已" +"經轉向使用四位數年份。之後,:rfc:`822` 被淘汰,四位數年份首先由 :rfc:`1123` " +"推薦,然後由 :rfc:`2822` 正式批准。" #: ../../library/time.rst:22 msgid "epoch"