From 99b67e8d90f98d631af028bbec8783e493d08c9f Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:51:32 +0800 Subject: [PATCH 1/3] Add more translations of library/io --- library/io.po | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/library/io.po b/library/io.po index d8f43c3f63..83bcd2d756 100644 --- a/library/io.po +++ b/library/io.po @@ -652,7 +652,7 @@ msgstr "為了方便起見,允許多次呼叫這個方法;然而,只有第 #: ../../library/io.rst:362 msgid "``True`` if the stream is closed." -msgstr "" +msgstr "如果串流已關閉,則為 ``True``。" #: ../../library/io.rst:366 msgid "" @@ -660,30 +660,36 @@ msgid "" "exists. An :exc:`OSError` is raised if the IO object does not use a file " "descriptor." msgstr "" +"如果串流存在,則回傳其底層的檔案描述符(一個整數)。如果 IO 物件不使用檔案描" +"述符,則會引發一個 :exc:`OSError` 例外。" #: ../../library/io.rst:372 msgid "" "Flush the write buffers of the stream if applicable. This does nothing for " "read-only and non-blocking streams." msgstr "" +"如果適用,清空串流的寫入緩衝區。對於唯讀和非阻塞串流,此操作不會執行任何操" +"作。" #: ../../library/io.rst:377 msgid "" "Return ``True`` if the stream is interactive (i.e., connected to a terminal/" "tty device)." -msgstr "" +msgstr "如果串流是互動式的(即,連接到終端機/tty 設備),則回傳 ``True``。" #: ../../library/io.rst:382 msgid "" "Return ``True`` if the stream can be read from. If ``False``, :meth:`!read` " "will raise :exc:`OSError`." msgstr "" +"如果串流可以被讀取,則回傳 ``True``。如果是 ``False``,:meth:`!read` 將會引" +"發 :exc:`OSError` 例外。" #: ../../library/io.rst:387 msgid "" "Read and return one line from the stream. If *size* is specified, at most " "*size* bytes will be read." -msgstr "" +msgstr "從串流讀取並回傳一行。如果指定了 *size*,則最多讀取 *size* 個位元組。" #: ../../library/io.rst:390 msgid "" @@ -691,6 +697,8 @@ msgid "" "the *newline* argument to :func:`open` can be used to select the line " "terminator(s) recognized." msgstr "" +"對於二進位檔案,行結束符總是 ``b'\\n'``;對於文字檔案,可以使用 :func:`open` " +"函式的 *newline* 參數來選擇識別的行結束符號。" #: ../../library/io.rst:396 msgid "" @@ -698,17 +706,22 @@ msgid "" "control the number of lines read: no more lines will be read if the total " "size (in bytes/characters) of all lines so far exceeds *hint*." msgstr "" +"從串流讀取並回傳一個含有一或多行的 list。可以指定 *hint* 來控制讀取的行數:如" +"果到目前為止所有行的總大小(以位元組/字元計)超過 *hint*,則不會再讀取更多" +"行。" #: ../../library/io.rst:400 msgid "" "*hint* values of ``0`` or less, as well as ``None``, are treated as no hint." -msgstr "" +msgstr "*hint* 值為 ``0`` 或更小,以及 ``None``,都被視為沒有提供 hint。" #: ../../library/io.rst:403 msgid "" "Note that it's already possible to iterate on file objects using ``for line " "in file: ...`` without calling :meth:`!file.readlines`." msgstr "" +"請注意,已經可以使用 ``for line in file: ...`` 在檔案物件上進行迭代,而不一定" +"需要呼叫 :meth:`!file.readlines`。" #: ../../library/io.rst:408 msgid "" From 9960a13f75b091d76af88d988697f566e7505288 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Thu, 14 Dec 2023 01:33:20 +0800 Subject: [PATCH 2/3] Revise the translations of library/io --- library/io.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/io.po b/library/io.po index 83bcd2d756..cb0d9a4d6f 100644 --- a/library/io.po +++ b/library/io.po @@ -660,7 +660,7 @@ msgid "" "exists. An :exc:`OSError` is raised if the IO object does not use a file " "descriptor." msgstr "" -"如果串流存在,則回傳其底層的檔案描述符(一個整數)。如果 IO 物件不使用檔案描" +"如果串流存在,則回傳其底層的檔案描述器(一個整數)。如果 IO 物件不使用檔案描" "述符,則會引發一個 :exc:`OSError` 例外。" #: ../../library/io.rst:372 @@ -675,7 +675,7 @@ msgstr "" msgid "" "Return ``True`` if the stream is interactive (i.e., connected to a terminal/" "tty device)." -msgstr "如果串流是互動式的(即,連接到終端機/tty 設備),則回傳 ``True``。" +msgstr "如果串流是互動式的(即連接到終端機/tty 設備),則回傳 ``True``。" #: ../../library/io.rst:382 msgid "" @@ -698,7 +698,7 @@ msgid "" "terminator(s) recognized." msgstr "" "對於二進位檔案,行結束符總是 ``b'\\n'``;對於文字檔案,可以使用 :func:`open` " -"函式的 *newline* 參數來選擇識別的行結束符號。" +"函式的 *newline* 引數來選擇識別的行結束符號。" #: ../../library/io.rst:396 msgid "" @@ -720,7 +720,7 @@ msgid "" "Note that it's already possible to iterate on file objects using ``for line " "in file: ...`` without calling :meth:`!file.readlines`." msgstr "" -"請注意,已經可以使用 ``for line in file: ...`` 在檔案物件上進行迭代,而不一定" +"請注意,已經可以使用 ``for line in file: ...`` 在檔案物件上進行疊代,而不一定" "需要呼叫 :meth:`!file.readlines`。" #: ../../library/io.rst:408 From 80257e9682d9efd15033121436750680264d8681 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Thu, 14 Dec 2023 02:54:47 +0800 Subject: [PATCH 3/3] Apply suggestions from code review --- library/io.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/io.po b/library/io.po index cb0d9a4d6f..799a6543b7 100644 --- a/library/io.po +++ b/library/io.po @@ -661,7 +661,7 @@ msgid "" "descriptor." msgstr "" "如果串流存在,則回傳其底層的檔案描述器(一個整數)。如果 IO 物件不使用檔案描" -"述符,則會引發一個 :exc:`OSError` 例外。" +"述器,則會引發一個 :exc:`OSError` 例外。" #: ../../library/io.rst:372 msgid ""