From 12e5464eb50696d61e007a18b7ba161ea514a8a5 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Mon, 31 Jul 2023 00:39:22 +0800 Subject: [PATCH 1/2] Adds more translations of library/io --- library/io.po | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/library/io.po b/library/io.po index be5adcfaa4..9a1c71a3a2 100644 --- a/library/io.po +++ b/library/io.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2022, Python Software Foundation +s Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-07-17 17:38+0800\n" +"PO-Revision-Date: 2023-07-31 00:38+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -39,6 +39,11 @@ msgid "" "any of these categories is called a :term:`file object`. Other common terms " "are *stream* and *file-like object*." msgstr "" +":mod:`io` 模組替 Python 提供處理各種類型 IO 的主要工具。有三種主要的 IO 類" +"型: *文字 I/O (text I/O)*、*二進位 I/O (binary I/O)* 以及 *原始 I/O (raw I/" +"O)*。這些均為泛用 (generic) 類型,且每種類型都可以使用各式後端儲存 (backing " +"store)。任一種屬於這些類型的具體物件稱為 :term:`file object`。其它常見的名詞" +"還有 *資料串流 (stream)* 以及 *類檔案物件 (file-like objects)*。" #: ../../library/io.rst:34 msgid "" @@ -48,6 +53,9 @@ msgid "" "location), or only sequential access (for example in the case of a socket or " "pipe)." msgstr "" +"無論其類型為何,每個具體的資料串流物件也將具有各種能力:唯讀的、只接受寫入" +"的、或者讀寫兼具的。它還允許任意的隨機存取(向前或向後尋找至任意位置),或者" +"只能依順序存取(例如 socket 或 pipe 的情形下)。" #: ../../library/io.rst:40 msgid "" @@ -58,16 +66,16 @@ msgid "" msgstr "" "所有的資料串流都會謹慎處理你所提供的資料的型別。舉例來說,提供一個 :class:" "`str` 物件給二進位資料串流的 ``write()`` 方法將會引發 :exc:`TypeError`。同樣" -"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發同" -"樣的錯誤。" +"地,若提供一個 :class:`bytes` 物件給文字資料串流的 ``write()`` 方法,也會引發" +"同樣的錯誤。" #: ../../library/io.rst:45 msgid "" "Operations that used to raise :exc:`IOError` now raise :exc:`OSError`, " "since :exc:`IOError` is now an alias of :exc:`OSError`." msgstr "" -"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :" -"exc:`IOError` 現在是 :exc:`OSError` 的別名。" +"原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" +"`IOError` 現在是 :exc:`OSError` 的別名。" #: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1122 msgid "Text I/O" @@ -80,6 +88,9 @@ msgid "" "a file), encoding and decoding of data is made transparently as well as " "optional translation of platform-specific newline characters." msgstr "" +"文字 I/O 要求和產出 :class:`str` 物件。這意味著每當後端儲存為原生 bytes 時" +"(例如在檔案的情形下),資料的編碼與解碼會以清楚易懂的方式進行,也可選擇同時" +"轉換特定於平台的換行字元。" #: ../../library/io.rst:58 msgid "" @@ -116,6 +127,10 @@ msgid "" "be used for all kinds of non-text data, and also when manual control over " "the handling of text data is desired." msgstr "" +"二進位 I/O(也稱為 *緩衝 I/O (buffered I/O)*)要求的是 :term:`bytes-like " +"objects ` 且產生 :class:`bytes` 物件。不進行編碼、解碼或者" +"換行字元轉換。這種類型的資料串流可用於各種非文字資料,以及需要手動控制對文字" +"資料的處理時。" #: ../../library/io.rst:80 msgid "" @@ -160,6 +175,11 @@ msgid "" "manipulate a raw stream from user code. Nevertheless, you can create a raw " "stream by opening a file in binary mode with buffering disabled::" msgstr "" +"原始 I/O(也稱為 *無緩衝 I/O (unbuffered I/O)*)通常作為二進位以及文字資料串" +"流的低階 building-block 使用;在使用者程式碼中直接操作原始資料串流很少有用。" +"然而,你可以透過以無緩衝的二進位模式開啟一個檔案來建立一個原始資料串流:\n" +"\n" +"::" #: ../../library/io.rst:106 msgid "" @@ -302,6 +322,8 @@ msgid "" "This is a helper function for callables that use :func:`open` or :class:" "`TextIOWrapper` and have an ``encoding=None`` parameter." msgstr "" +"這是個輔助函數,適用於使用 :func:`open` 或 :class:`TextIOWrapper` 且具有 " +"``encoding=None`` 參數的 callables。" #: ../../library/io.rst:203 msgid "" From 3b526f0ee603b1e3fa3e846483c06ac13b6fd1b1 Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:24:25 +0800 Subject: [PATCH 2/2] Small Fixes --- library/io.po | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/library/io.po b/library/io.po index 9a1c71a3a2..2291d2cf67 100644 --- a/library/io.po +++ b/library/io.po @@ -1,4 +1,4 @@ -s Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-07-31 00:38+0800\n" +"PO-Revision-Date: 2023-07-31 18:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -40,10 +40,10 @@ msgid "" "are *stream* and *file-like object*." msgstr "" ":mod:`io` 模組替 Python 提供處理各種類型 IO 的主要工具。有三種主要的 IO 類" -"型: *文字 I/O (text I/O)*、*二進位 I/O (binary I/O)* 以及 *原始 I/O (raw I/" -"O)*。這些均為泛用 (generic) 類型,且每種類型都可以使用各式後端儲存 (backing " -"store)。任一種屬於這些類型的具體物件稱為 :term:`file object`。其它常見的名詞" -"還有 *資料串流 (stream)* 以及 *類檔案物件 (file-like objects)*。" +"型: *文字 I/O (text I/O)*、*二進位 I/O (binary I/O)* 以及\\ *原始 I/O (raw " +"I/O)*。這些均為泛用 (generic) 類型,且每種類型都可以使用各式後端儲存 " +"(backing store)。任一種屬於這些類型的具體物件稱為 :term:`file object`。其它常" +"見的名詞還有\\ *資料串流 (stream)* 以及\\ *類檔案物件 (file-like objects)*。" #: ../../library/io.rst:34 msgid "" @@ -127,10 +127,10 @@ msgid "" "be used for all kinds of non-text data, and also when manual control over " "the handling of text data is desired." msgstr "" -"二進位 I/O(也稱為 *緩衝 I/O (buffered I/O)*)要求的是 :term:`bytes-like " -"objects ` 且產生 :class:`bytes` 物件。不進行編碼、解碼或者" -"換行字元轉換。這種類型的資料串流可用於各種非文字資料,以及需要手動控制對文字" -"資料的處理時。" +"二進位 I/O(也稱為\\ *緩衝 I/O (buffered I/O)*)要求的是\\ :term:`類位元組物" +"件 (bytes-like objects) ` 且產生 :class:`bytes` 物件。不進" +"行編碼、解碼或者換行字元轉換。這種類型的資料串流可用於各種非文字資料,以及需" +"要手動控制對文字資料的處理時。" #: ../../library/io.rst:80 msgid "" @@ -175,9 +175,10 @@ msgid "" "manipulate a raw stream from user code. Nevertheless, you can create a raw " "stream by opening a file in binary mode with buffering disabled::" msgstr "" -"原始 I/O(也稱為 *無緩衝 I/O (unbuffered I/O)*)通常作為二進位以及文字資料串" -"流的低階 building-block 使用;在使用者程式碼中直接操作原始資料串流很少有用。" -"然而,你可以透過以無緩衝的二進位模式開啟一個檔案來建立一個原始資料串流:\n" +"原始 I/O(也稱為\\ *無緩衝 I/O (unbuffered I/O)*)通常作為二進位以及文字資料" +"串流的低階 building-block 使用;在使用者程式碼中直接操作原始資料串流很少有" +"用。然而,你可以透過以無緩衝的二進位模式開啟一個檔案來建立一個原始資料串" +"流:\n" "\n" "::" @@ -323,7 +324,7 @@ msgid "" "`TextIOWrapper` and have an ``encoding=None`` parameter." msgstr "" "這是個輔助函數,適用於使用 :func:`open` 或 :class:`TextIOWrapper` 且具有 " -"``encoding=None`` 參數的 callables。" +"``encoding=None`` 參數的可呼叫物件。" #: ../../library/io.rst:203 msgid ""