From cf7755a982291a35ef9a98e01c6a2af2b0713ba6 Mon Sep 17 00:00:00 2001 From: mindihx Date: Sat, 13 Jul 2024 09:50:42 +0800 Subject: [PATCH 1/3] Translate library/exceptions part 2/3 --- library/exceptions.po | 160 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 139 insertions(+), 21 deletions(-) diff --git a/library/exceptions.po b/library/exceptions.po index a8aa0b3b9e..b01c046fc5 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-07-20 00:03+0000\n" -"PO-Revision-Date: 2024-03-12 20:57+0800\n" +"PO-Revision-Date: 2024-07-13 09:45+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -353,8 +353,8 @@ msgid "" "module. Also raised when the \"from list\" in ``from ... import`` has a " "name that cannot be found." msgstr "" -"當 :keyword:`import` 陳述式嘗試載入模組遇到問題的時候會被引發。當 ``from … " -"import`` 裡的 “from list” 包含找不到的名稱時也會被引發。" +"當 :keyword:`import` 陳述式嘗試載入模組遇到問題的時候會被引發。當 ``from ... " +"import`` 裡的 \"from list\" 包含找不到的名稱時也會被引發。" #: ../../library/exceptions.rst:241 msgid "" @@ -435,10 +435,10 @@ msgid "" "stack traceback can be printed, in case a run-away program was the cause." msgstr "" "當一個操作用光了記憶體但情況還可能被修復 (rescued)(透過刪除一些物件)的時候" -"被引發。關聯的值是一個字串,表示什麼類型的(內部)操作用光了記憶體。需注意的" -"是因為底層的記憶體管理架構(C 的 :c:func:`malloc` 函式),直譯器可能無法總是" -"完整地從該情況中修復;僅管如此,它還是引發例外以讓堆疊回溯可以被印出,以防原" -"因出在失控的程式。" +"被引發。關聯值是一個字串,表示什麼類型的(內部)操作用光了記憶體。需注意的是" +"因為底層的記憶體管理架構(C 的 :c:func:`malloc` 函式),直譯器可能無法總是完" +"整地從該情況中修復;僅管如此,它還是引發例外以讓堆疊回溯可以被印出,以防原因" +"出在失控的程式。" #: ../../library/exceptions.rst:311 msgid "" @@ -447,7 +447,7 @@ msgid "" "the name that could not be found." msgstr "" "當找不到本地或全域的名稱時會被引發。這只應用在不合格的名稱 (unqualified " -"name) 上。關聯的值是一個錯誤訊息,包含那個無法被找到的名稱。" +"name) 上。關聯值是一個錯誤訊息,包含那個無法被找到的名稱。" #: ../../library/exceptions.rst:315 msgid "" @@ -469,6 +469,9 @@ msgid "" "derived classes to override the method, or while the class is being " "developed to indicate that the real implementation still needs to be added." msgstr "" +"此例外衍生自 :exc:`RuntimeError`。在使用者定義的基礎類別裡,當抽象方法要求衍" +"生類別覆寫該方法時應該要引發此例外,或者當類別正在開發中,可用此例外表示還需" +"要加入真正的實作。" #: ../../library/exceptions.rst:332 msgid "" @@ -476,6 +479,8 @@ msgid "" "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" +"此例外不應該用來表示根本沒有要支援的運算子或方法 — 在這個情況下可以讓該運算子" +"或方法保持未定義,或者如果是子類別的話將其設成 :data:`None`。" #: ../../library/exceptions.rst:338 msgid "" @@ -483,13 +488,17 @@ msgid "" "even though they have similar names and purposes. See :data:`!" "NotImplemented` for details on when to use it." msgstr "" +"``NotImplementedError`` 和 :data:`NotImplemented` 雖然有相似的名稱和目的但並" +"不是可互換的。參考 :data:`!NotImplemented` 裡關於何時使用的細節。" #: ../../library/exceptions.rst:347 msgid "" "This exception is raised when a system function returns a system-related " -"error, including I/O failures such as \"file not found\" or \"disk " -"full\" (not for illegal argument types or other incidental errors)." +"error, including I/O failures such as \"file not found\" or \"disk full\" " +"(not for illegal argument types or other incidental errors)." msgstr "" +"當系統函式回傳系統相關錯誤,包含像\"找不到檔案\"或\"硬碟已滿\"的 I/O 失敗會引" +"發此例外(而非不合法的引數或其他次要的錯誤)。" #: ../../library/exceptions.rst:351 msgid "" @@ -499,6 +508,9 @@ msgid "" "`~BaseException.args` attribute contains only a 2-tuple of the first two " "constructor arguments." msgstr "" +"建構函式的第二種形式會設定以下描述的相對應屬性。如果沒有給定則屬性預設為 :" +"const:`None`。為了向後相容,如果傳入三個引數,:attr:`~BaseException.args` 屬" +"性只會是包含建構函式前兩個引數的雙元素元組。" #: ../../library/exceptions.rst:357 msgid "" @@ -508,10 +520,14 @@ msgid "" "exc:`OSError` directly or via an alias, and is not inherited when " "subclassing." msgstr "" +"如同下面的\\ `作業系統例外 `_\\ 所描述,實際上建構函式通常回" +"傳 :exc:`OSError` 的子類別。會依據最後 :attr:`.errno` 的值決定特定子類別。這" +"個行為只發生在直接建構 :exc:`OSError` 或透過別名,且產生子類別的時候不會被繼" +"承。" #: ../../library/exceptions.rst:365 msgid "A numeric error code from the C variable :c:data:`errno`." -msgstr "" +msgstr "從 C 變數 :c:data:`errno` 而來的錯誤代碼數值。" #: ../../library/exceptions.rst:369 msgid "" @@ -519,6 +535,8 @@ msgid "" "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" +"在 Windows 下,這會提供你原生的 Windows 錯誤代碼。而 :attr:`.errno` 屬性是一" +"個該原生錯誤代碼對於 POSIX 來說的近似翻譯。" #: ../../library/exceptions.rst:373 msgid "" @@ -527,6 +545,9 @@ msgid "" "*errno* argument is ignored. On other platforms, the *winerror* argument is " "ignored, and the :attr:`winerror` attribute does not exist." msgstr "" +"在 Windows 下,如果建構函式引數 *winerror* 是整數,則 :attr:`.errno` 屬性會根" +"據該 Windows 錯誤代碼來決定,且 *errno* 引數會被忽略。在其他平台上," +"*winerror* 引數會被忽略,而 :attr:`winerror` 屬性會不存在。" #: ../../library/exceptions.rst:381 msgid "" @@ -534,6 +555,8 @@ msgid "" "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" "`FormatMessage` under Windows." msgstr "" +"作業系統提供的對應錯誤訊息。在 POSIX 下會使用 C 函式 :c:func:`perror` 做格式" +"化,而在 Windows 下會使用 :c:func:`FormatMessage`。" #: ../../library/exceptions.rst:389 msgid "" @@ -543,6 +566,9 @@ msgid "" "rename`), :attr:`filename2` corresponds to the second file name passed to " "the function." msgstr "" +"對於包含檔案系統路徑的例外(像是 :func:`open` 或 :func:`os.unlink`),:attr:" +"`filename` 是傳入函式的檔案名稱。對於包含兩個檔案系統路徑的函式(像是 :func:" +"`os.rename`),:attr:`filename2` 對應到傳入函式的第二個檔案名稱。" #: ../../library/exceptions.rst:396 msgid "" @@ -550,6 +576,9 @@ msgid "" "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" "`OSError`, and the constructor may return a subclass." msgstr "" +":exc:`EnvironmentError`、:exc:`IOError`、:exc:`WindowsError`、:exc:`socket." +"error`、:exc:`select.error` 及 :exc:`mmap.error` 已合併進 :exc:`OSError`,而" +"建構函式可能會回傳子類別。" #: ../../library/exceptions.rst:402 msgid "" @@ -558,6 +587,9 @@ msgid "" "`filesystem encoding and error handler`. Also, the *filename2* constructor " "argument and attribute was added." msgstr "" +":attr:`filename` 屬性現在是傳入函式的原始檔名,而不是從\\ :term:`檔案系統編碼" +"和錯誤處理函式 `\\ 編碼或解碼過的名" +"稱。並且新增 *filename2* 建構函式引數與屬性。" #: ../../library/exceptions.rst:411 msgid "" @@ -568,6 +600,10 @@ msgid "" "Because of the lack of standardization of floating-point exception handling " "in C, most floating-point operations are not checked." msgstr "" +"當運算操作的結果太大而無法表示的時候會引發此例外。這不會發生在整數上(會改成" +"引發 :exc:`MemoryError` 而不是放棄)。然而,因為一些歷史因素,OverflowError " +"有時候會因為整數在要求範圍之外而引發。因為在 C 裡面缺乏浮點數例外處理的標準" +"化,大部分的浮點數運算都沒有被檢查。" #: ../../library/exceptions.rst:421 msgid "" @@ -575,10 +611,12 @@ msgid "" "interpreter detects that the maximum recursion depth (see :func:`sys." "getrecursionlimit`) is exceeded." msgstr "" +"此例外衍生自 :exc:`RuntimeError`。當直譯器偵測到超過最大的遞迴深度(參考 :" +"func:`sys.getrecursionlimit`)時會引發此例外。" #: ../../library/exceptions.rst:425 msgid "Previously, a plain :exc:`RuntimeError` was raised." -msgstr "" +msgstr "在之前,會引發一般的 :exc:`RuntimeError`。" #: ../../library/exceptions.rst:431 msgid "" @@ -587,6 +625,9 @@ msgid "" "after it has been garbage collected. For more information on weak " "references, see the :mod:`weakref` module." msgstr "" +"當一個被 :func:`weakref.proxy` 函式建立的弱參照代理 (weak reference proxy) 被" +"用來存取已經被垃圾回收 (garbage collected) 的參照物屬性時會引發此例外。更多關" +"於弱參照的資訊參考 :mod:`weakref` 模組。" #: ../../library/exceptions.rst:439 msgid "" @@ -594,6 +635,8 @@ msgid "" "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" +"當偵測到一個不屬於任何其他種類的錯誤時會引發此例外。關聯值是一個表示確切什麼" +"地方出錯的字串。" #: ../../library/exceptions.rst:446 msgid "" @@ -601,6 +644,8 @@ msgid "" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" +"會被內建函式 :func:`next` 及 :term:`iterator` 的 :meth:`~iterator.__next__` " +"方法引發,用來表示疊代器沒有更多項目可以產生。" #: ../../library/exceptions.rst:452 msgid "" @@ -608,6 +653,8 @@ msgid "" "as an argument when constructing the exception, and defaults to :const:" "`None`." msgstr "" +"此例外物件有單一屬性 :attr:`!value`,當建構此例外時會以引數給定,預設為 :" +"const:`None`。" #: ../../library/exceptions.rst:456 msgid "" @@ -615,6 +662,9 @@ msgid "" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" +"當 :term:`generator` 或 :term:`coroutine` 函式回傳時,新的 :exc:" +"`StopIteration` 實例會被引發,而該函式的回傳值會被用來當作此例外建構函式的 :" +"attr:`value` 參數。" #: ../../library/exceptions.rst:461 msgid "" @@ -622,30 +672,38 @@ msgid "" "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" +"如果產生器程式直接或間接引發 :exc:`StopIteration`,則其會被轉換成 :exc:" +"`RuntimeError`\\ (保留 :exc:`StopIteration` 作為新例外的成因)。" #: ../../library/exceptions.rst:465 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." -msgstr "" +msgstr "新增 ``value`` 屬性且產生器函式可以用它來回傳值。" #: ../../library/exceptions.rst:469 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" +"透過 ``from __future__ import generator_stop`` 引入 RuntimeError 的轉換,參" +"考 :pep:`479`。" #: ../../library/exceptions.rst:473 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" +"預設對所有程式啟用 :pep:`479`:在產生器引發的 :exc:`StopIteration` 錯誤會轉換" +"成 :exc:`RuntimeError`。" #: ../../library/exceptions.rst:479 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" +"此例外必須被 :term:`asynchronous iterator` 物件的 :meth:`~object.__anext__` " +"方法引發來停止疊代。" #: ../../library/exceptions.rst:486 msgid "" @@ -654,44 +712,56 @@ msgid "" "`compile`, :func:`exec`, or :func:`eval`, or when reading the initial script " "or standard input (also interactively)." msgstr "" +"當剖析器遇到語法錯誤時會引發此例外。這可能發生在 :keyword:`import` 陳述式、在" +"呼叫內建函式 :func:`compile`、:func:`exec` 或 :func:`eval` 的時候,或者在讀取" +"初始腳本或標準輸入(也包含互動式)的時候。" #: ../../library/exceptions.rst:492 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" +"例外實例的 :func:`str` 只回傳錯誤訊息。Details 是個元組,其成員也能夠以分開的" +"屬性取得。" #: ../../library/exceptions.rst:497 msgid "The name of the file the syntax error occurred in." -msgstr "" +msgstr "發生語法錯誤所在的檔案名稱。" #: ../../library/exceptions.rst:501 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" +"發生錯誤所在檔案的行數。這是以 1 開始的索引:檔案第一行的 ``lineno`` 是 1。" #: ../../library/exceptions.rst:506 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" +"發生錯誤所在該行的列數。這是以 1 開始的索引:該行第一個字元的 ``offset`` 是 " +"1。" #: ../../library/exceptions.rst:511 msgid "The source code text involved in the error." -msgstr "" +msgstr "涉及該錯誤的原始程式碼文字。" #: ../../library/exceptions.rst:515 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." msgstr "" +"發生錯誤所在檔案的結束行數。這是以 1 開始的索引:檔案第一行的 ``lineno`` 是 " +"1。" #: ../../library/exceptions.rst:520 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." msgstr "" +"發生錯誤所在該結束行的列數。這是以 1 開始的索引:該行第一個字元的 ``offset`` " +"是 1。" #: ../../library/exceptions.rst:523 msgid "" @@ -700,6 +770,9 @@ msgid "" "expression. For example, compiling f'Bad {a b} field' results in this args " "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" +"對於發生在 f-string 欄位的錯誤,訊息會以 \"f-string: \" 為前綴,而位置 " +"(offset) 是從替代表達式建構的文字的位置。例如編譯 f'Bad {a b} field' 會得到這" +"個 args 屬性:('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))。" #: ../../library/exceptions.rst:528 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." @@ -710,12 +783,15 @@ msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" +"與不正確的縮排有關的語法錯誤的基礎類別。這是 :exc:`SyntaxError` 的子類別。" #: ../../library/exceptions.rst:539 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" +"當縮排包含 tab 和空白的不一致用法時會引發此例外。這是 :exc:" +"`IndentationError` 的子類別。" #: ../../library/exceptions.rst:545 msgid "" @@ -723,6 +799,8 @@ msgid "" "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" +"當直譯器找到一個內部錯誤,但該情況看起來沒有嚴重到要讓它放棄所有的希望時會引" +"發此例外。關聯值是一個表示什麼地方出錯的字串(以低階的方式表達)。" #: ../../library/exceptions.rst:549 msgid "" @@ -732,6 +810,9 @@ msgid "" "session), the exact error message (the exception's associated value) and if " "possible the source of the program that triggered the error." msgstr "" +"你應該向你的 Python 直譯器作者或維護者回報此錯誤。務必要回報該 Python 直譯器" +"的版本(``sys.version``;這也會在互動式 Python 會話的開頭被印出)、確切的錯誤" +"訊息(該例外的關聯值)及如果可能的話,觸發此錯誤的程式來源。" #: ../../library/exceptions.rst:558 msgid "" @@ -746,6 +827,13 @@ msgid "" "is zero; if it has another type (such as a string), the object's value is " "printed and the exit status is one." msgstr "" +"此例外會被 :func:`sys.exit` 函式引發。它繼承自 :exc:`BaseException` 而不是 :" +"exc:`Exception` 因此不會被捕捉 :exc:`Exception` 的程式意外地捕捉。這允許例外" +"可以正確地向上傳遞並導致直譯器結束。當它未被處理時,Python 直譯器會結束;不會" +"印出堆疊回溯。建構函式接受跟傳入 :func:`sys.exit` 一樣的可選引數。如果該值是" +"整數,它會指定系統的結束狀態(傳入 C 的 :c:func:`exit` 函式 );如果它是 " +"``None``,結束狀態會是 0;如果它是其他類型(例如字串),則物件的值會被印出而" +"結束狀態是 1。" #: ../../library/exceptions.rst:569 msgid "" @@ -756,12 +844,16 @@ msgid "" "absolutely positively necessary to exit immediately (for example, in the " "child process after a call to :func:`os.fork`)." msgstr "" +"對 :func:`sys.exit` 的呼叫會轉譯成例外讓負責清理的處理函式(:keyword:`try` 陳" +"述式的 :keyword:`finally` 子句)可以被執行,且讓除錯器可以在不冒著失去控制的" +"風險下執行腳本。如果在絕對有必要立即結束的情況(例如在子行程呼叫完 :func:`os." +"fork` 之後 )可以使用 :func:`os._exit` 函式。" #: ../../library/exceptions.rst:578 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" -msgstr "" +msgstr "傳入建構函式的結束狀態或錯誤訊息。(預設是 ``None``。 )" #: ../../library/exceptions.rst:584 msgid "" @@ -769,6 +861,8 @@ msgid "" "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" +"當一個操作或函式被用在不適合的類型的物件時會引發此例外。關聯值是一個字串,提" +"供關於不相符類型的細節。" #: ../../library/exceptions.rst:587 msgid "" @@ -777,6 +871,9 @@ msgid "" "object is meant to support a given operation but has not yet provided an " "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" +"此例外可能被使用者程式碼引發,以表示並不支援物件上所嘗試的操作,且本來就無意" +"這樣做。如果一個物件有意要支援某個給定的操作但尚未提供實作,該引發的正確例外" +"是 :exc:`NotImplementedError`。" #: ../../library/exceptions.rst:592 msgid "" @@ -785,6 +882,9 @@ msgid "" "arguments with the wrong value (e.g. a number outside expected boundaries) " "should result in a :exc:`ValueError`." msgstr "" +"傳入錯誤類型的引數(例如當預期傳入 :class:`int` 卻傳入 :class:`list`)應該要" +"導致 :exc:`TypeError`,但傳入帶有錯誤值的引數(例如超出預期範圍的數值)應該要" +"導致 :exc:`ValueError`。" #: ../../library/exceptions.rst:599 msgid "" @@ -792,12 +892,16 @@ msgid "" "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" +"當在函式或方法裡引用某個區域變數,但該變數尚未被繫結到任何值的時候會引發此例" +"外。這是 :exc:`NameError` 的子類別。" #: ../../library/exceptions.rst:606 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" +"當 Unicode 相關的編碼或解碼錯誤發生時會引發此例外。這是 :exc:`ValueError` 的" +"子類別。" #: ../../library/exceptions.rst:609 msgid "" @@ -805,44 +909,52 @@ msgid "" "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" +":exc:`UnicodeError` 有屬性描述編碼或解碼錯誤。例如 ``err.object[err.start:" +"err.end]`` 會提供讓編解碼器失敗的具體無效輸入。" #: ../../library/exceptions.rst:615 msgid "The name of the encoding that raised the error." -msgstr "" +msgstr "引發錯誤的編碼名稱。" #: ../../library/exceptions.rst:619 msgid "A string describing the specific codec error." -msgstr "" +msgstr "描述特定編解碼器錯誤的字串。" #: ../../library/exceptions.rst:623 msgid "The object the codec was attempting to encode or decode." -msgstr "" +msgstr "編解碼器嘗試編碼或解碼的物件。" #: ../../library/exceptions.rst:627 msgid "The first index of invalid data in :attr:`object`." -msgstr "" +msgstr "在 :attr:`object` 中無效資料的開始索引。" #: ../../library/exceptions.rst:631 msgid "The index after the last invalid data in :attr:`object`." -msgstr "" +msgstr "在 :attr:`object` 中最後的無效資料後的索引。" #: ../../library/exceptions.rst:636 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" +"在編碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" +"類別。" #: ../../library/exceptions.rst:642 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" +"在解碼當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" +"類別。" #: ../../library/exceptions.rst:648 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" +"在轉譯當中發生 Unicode 相關錯誤時會引發此例外。這是 :exc:`UnicodeError` 的子" +"類別。" #: ../../library/exceptions.rst:654 msgid "" @@ -850,6 +962,8 @@ msgid "" "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" +"當一個操作或函式收到引數是正確類型但是不適合的值,且該情況無法被更精確的例外" +"例如 :exc:`IndexError` 所描述時會引發此例外。" #: ../../library/exceptions.rst:661 msgid "" @@ -857,12 +971,16 @@ msgid "" "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" +"當除法或模數運算 (modulo operation) 的第二個引數是 0 的時候會引發此例外。關聯" +"值是一個字串,表示運算元及運算的類型。" #: ../../library/exceptions.rst:666 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" +"以下例外是為了相容於之前版本而保留;從 Python 3.3 開始,它們是 :exc:" +"`OSError` 的別名。" #: ../../library/exceptions.rst:675 msgid "Only available on Windows." From 41d8e59c7ef3893dd3bc75946f84b2462fb2aabe Mon Sep 17 00:00:00 2001 From: mindihx Date: Sat, 13 Jul 2024 10:05:02 +0800 Subject: [PATCH 2/3] Fix em dash --- library/exceptions.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/exceptions.po b/library/exceptions.po index b01c046fc5..5d1b7e0757 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -479,8 +479,8 @@ msgid "" "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -"此例外不應該用來表示根本沒有要支援的運算子或方法 — 在這個情況下可以讓該運算子" -"或方法保持未定義,或者如果是子類別的話將其設成 :data:`None`。" +"此例外不應該用來表示根本沒有要支援的運算子或方法 ── 在這個情況下可以讓該運算" +"子或方法保持未定義,或者如果是子類別的話將其設成 :data:`None`。" #: ../../library/exceptions.rst:338 msgid "" From b0abeea788c9c1f1c2227ea5aa2730598bd5196c Mon Sep 17 00:00:00 2001 From: mindihx Date: Sun, 8 Sep 2024 20:15:29 +0800 Subject: [PATCH 3/3] Refine translation for library/exceptions --- library/exceptions.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/library/exceptions.po b/library/exceptions.po index 5d1b7e0757..21682eccb8 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-07-20 00:03+0000\n" -"PO-Revision-Date: 2024-07-13 09:45+0800\n" +"PO-Revision-Date: 2024-09-08 20:13+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -145,7 +145,7 @@ msgid "" "exceptions so that the final line of the traceback always shows the last " "exception that was raised." msgstr "" -"在任一種情況下,例外本身總是會顯示在任何連鎖例外的後面,因此回溯的最後一行總" +"在任一種情況下,例外本身總是會顯示在任何連鎖例外的後面,因此回溯的最後一列總" "是顯示最後一個被引發的例外。" #: ../../library/exceptions.rst:86 @@ -527,7 +527,7 @@ msgstr "" #: ../../library/exceptions.rst:365 msgid "A numeric error code from the C variable :c:data:`errno`." -msgstr "從 C 變數 :c:data:`errno` 而來的錯誤代碼數值。" +msgstr "從 C 變數 :c:data:`errno` 而來的數值錯誤代碼。" #: ../../library/exceptions.rst:369 msgid "" @@ -733,15 +733,15 @@ msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -"發生錯誤所在檔案的行數。這是以 1 開始的索引:檔案第一行的 ``lineno`` 是 1。" +"發生錯誤所在檔案的列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 1。" #: ../../library/exceptions.rst:506 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -"發生錯誤所在該行的列數。這是以 1 開始的索引:該行第一個字元的 ``offset`` 是 " -"1。" +"發生錯誤所在該列的欄號 (column)。這是以 1 開始的索引:該列第一個字元的 " +"``offset`` 是 1。" #: ../../library/exceptions.rst:511 msgid "The source code text involved in the error." @@ -752,7 +752,7 @@ msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." msgstr "" -"發生錯誤所在檔案的結束行數。這是以 1 開始的索引:檔案第一行的 ``lineno`` 是 " +"發生錯誤所在檔案的結束列號。這是以 1 開始的索引:檔案第一列的 ``lineno`` 是 " "1。" #: ../../library/exceptions.rst:520 @@ -760,7 +760,7 @@ msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." msgstr "" -"發生錯誤所在該結束行的列數。這是以 1 開始的索引:該行第一個字元的 ``offset`` " +"發生錯誤所在該結束列的欄號。這是以 1 開始的索引:該列第一個字元的 ``offset`` " "是 1。" #: ../../library/exceptions.rst:523 @@ -770,9 +770,9 @@ msgid "" "expression. For example, compiling f'Bad {a b} field' results in this args " "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" -"對於發生在 f-string 欄位的錯誤,訊息會以 \"f-string: \" 為前綴,而位置 " -"(offset) 是從替代表達式建構的文字的位置。例如編譯 f'Bad {a b} field' 會得到這" -"個 args 屬性:('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))。" +"對於發生在 f-string 欄位的錯誤,訊息會以 \"f-string: \" 為前綴,而偏移量 " +"(offset) 是從替代表達式建構的文字的偏移量。例如編譯 f'Bad {a b} field' 會得到" +"這個 args 屬性:('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))。" #: ../../library/exceptions.rst:528 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." @@ -790,7 +790,7 @@ msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -"當縮排包含 tab 和空白的不一致用法時會引發此例外。這是 :exc:" +"當縮排包含製表符號 (tab) 和空白的不一致用法時會引發此例外。這是 :exc:" "`IndentationError` 的子類別。" #: ../../library/exceptions.rst:545