-
-
Notifications
You must be signed in to change notification settings - Fork 214
Translate tutorial/errors.po #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Completed and updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今天先看到 errors.rst:109,明天有請假會繼續看!
tutorial/errors.po
Outdated
|
||
#: ../../tutorial/errors.rst:17 | ||
msgid "" | ||
"Syntax errors, also known as parsing errors, are perhaps the most common " | ||
"kind of complaint you get while you are still learning Python::" | ||
msgstr "" | ||
"句法錯誤又稱剖析錯誤 (parsing error),它或許是學習 Python 的過程最常聽見的抱" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/句法/語法
tutorial/errors.po
Outdated
@@ -49,10 +58,15 @@ msgid "" | |||
"colon (``':'``) is missing before it. File name and line number are printed " | |||
"so you know where to look in case the input came from a script." | |||
msgstr "" | |||
"剖析器 (parser) 會重複犯錯的那一行,並用一個小「箭頭」指向該行檢測到的第一個" | |||
"錯誤點。錯誤是由箭頭\\ *之前*\\ 的符記 (token) 導致的(或至少是在這裡檢測到" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/符記/標記
tutorial/errors.po
Outdated
@@ -63,6 +77,11 @@ msgid "" | |||
"not handled by programs, however, and result in error messages as shown " | |||
"here::" | |||
msgstr "" | |||
"即使一段陳述式或運算式使用了正確的語法,嘗試執行時仍可能導致錯誤。執行時檢測" | |||
"到的錯誤稱為\\ *例外*\\ ,例外不一定都很嚴重:你很快就能學會在 Python 程式中" | |||
"如何處理它們。大多數的例外不會被程式處理,但會顯示如下的錯誤訊息:\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不過大多數的例外.....,並且會顯示.... (那個 however 是給前面那一句轉折,不是後面那一句)
tutorial/errors.po
Outdated
"`NameError` 和 :exc:`TypeError`\\ 。作為例外類型被印出的字串,就是發生的內建" | ||
"例外 (built-in exception) 的名稱。所有的內建例外都是如此運作,但對於使用者自" | ||
"定的例外則不一定需要遵守(雖然這是一個有用的慣例)。標準例外名稱是內建的識別" | ||
"符 (identifier),不是保留關鍵字 (reserved keyword)。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
稍微查了一下,台灣似乎比較常見的翻譯是「識別字」,如何?
tutorial/errors.po
Outdated
@@ -140,6 +181,9 @@ msgid "" | |||
"handler is found, it is an *unhandled exception* and execution stops with a " | |||
"message as shown above." | |||
msgstr "" | |||
"如果發生的例外未符合 except 子句中的例外名稱,則將其傳遞到外層的 :keyword:" | |||
"`try` 陳述式;如果仍無法找到 handler(處置器),則它是一個\\ *未處理例外 " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「如果仍無法找到相對應的處理器」應該就可以了,handler 並不是專有名詞,只是統稱專門處理某特定例外的一段程式碼(我覺得甚至如果把所有的 handler 都換成「相對應的 except 子句」也是合理的)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或者是處理者...? ¯\_(ツ)_/¯
tutorial/errors.po
Outdated
@@ -140,6 +181,9 @@ msgid "" | |||
"handler is found, it is an *unhandled exception* and execution stops with a " | |||
"message as shown above." | |||
msgstr "" | |||
"如果發生的例外未符合 except 子句中的例外名稱,則將其傳遞到外層的 :keyword:" | |||
"`try` 陳述式;如果仍無法找到 handler(處置器),則它是一個\\ *未處理例外 " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或者是處理者...? ¯\_(ツ)_/¯
tutorial/errors.po
Outdated
":keyword:`try` 陳述式可以有不只一個 except 子句,為不同的例外指定 handler,而" | ||
"最多只有一個 handler 會被執行。Handler 只處理對應的 try 子句中發生的例外,而" | ||
"不會處理同一 :keyword:`!try` 陳述式裡其他 handler 內的例外。一個 except 子句" | ||
"可以用一組括號內的 tuple 命名多個例外,例如:\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/命名/提名 or 列舉 or 指定
tutorial/errors.po
Outdated
"一個在 :keyword:`except` 子句中的 class(類別)和一個例外是可相容的,只要它與" | ||
"例外是同一個 class 或是為其 base class(基底類別);反之則無法成立——列出 " | ||
"derived class (衍生類別)的 except 子句並不能與 base class 相容。例如,以下" | ||
"程式碼會依序印出 B, C, D:\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這句以及下面一句請統一使用頓號:B、C、D
tutorial/errors.po
Outdated
@@ -172,6 +230,11 @@ msgid "" | |||
"message and then re-raise the exception (allowing a caller to handle the " | |||
"exception as well)::" | |||
msgstr "" | |||
"最後一個 except 子句可以省略例外名稱,以用作通配符 (wildcard)。但使用上要極其" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/以用作通配符/以統一處理所有其他例外
tutorial/errors.po
Outdated
@@ -172,6 +230,11 @@ msgid "" | |||
"message and then re-raise the exception (allowing a caller to handle the " | |||
"exception as well)::" | |||
msgstr "" | |||
"最後一個 except 子句可以省略例外名稱,以用作通配符 (wildcard)。但使用上要極其" | |||
"小心,因為這種方式容易遮蔽真正的程式設計錯誤!它也可用於印出錯誤訊息,然後重" | |||
"新引發 (re-raise) 例外(也容許一個呼叫程式 (caller) 處理例外):\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重新引發應該不需要註釋原文
tutorial/errors.po
Outdated
|
||
#: ../../tutorial/errors.rst:460 | ||
msgid "" | ||
"In real world applications, the :keyword:`finally` clause is useful for " | ||
"releasing external resources (such as files or network connections), " | ||
"regardless of whether the use of the resource was successful." | ||
msgstr "" | ||
"在真實應用程式中,\\ :keyword:`finally` 子句對於釋放外部資源(例如檔案或網路" | ||
"連接)很有用,無論該資源的使用是否成功。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/連接/連線
tutorial/errors.po
Outdated
|
||
#: ../../tutorial/errors.rst:320 | ||
msgid "User-defined Exceptions" | ||
msgstr "" | ||
msgstr "使用者自定的例外 (User-defined Exceptions)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感覺這個就不需要註釋原文了,畢竟也不是真正在使用 Python 時會看到的術語
tutorial/errors.po
Outdated
|
||
#: ../../tutorial/errors.rst:375 | ||
msgid "Defining Clean-up Actions" | ||
msgstr "" | ||
msgstr "定義清理動作 (Clean-up Actions)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這個我也覺得不需要註釋原文
tutorial/errors.po
Outdated
|
||
#: ../../tutorial/errors.rst:468 | ||
msgid "Predefined Clean-up Actions" | ||
msgstr "" | ||
msgstr "預定義 (Predefined) 的清理動作" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這個感覺也不需要註釋原文
tutorial/errors.po
Outdated
@@ -408,3 +576,5 @@ msgid "" | |||
"files, provide predefined clean-up actions will indicate this in their " | |||
"documentation." | |||
msgstr "" | |||
"陳述式執行完畢後,就算是在處理行 (line) 時遇到問題,檔案 *f* 總是會被關閉。和" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/處理行/處理內容
(沒有完全逐字翻譯但意思是一樣的)
All suggestions were applied.
All suggestions above were applied. |
感恩! |
* Translate tutorial/errors.po Completed and updated. * Update errors.po All suggestions were applied.
Continued from #49 , it's completed and updated of tutorial/errors.po
Thanks for reviewing.
The work load was reduced during lock down period in Taiwan, so the translation would be faster recently.
Reference: https://terms.naer.edu.tw/