Skip to content

Commit

Permalink
Completed translation of class io.BufferedIOBase of library/io.po (py…
Browse files Browse the repository at this point in the history
…thon#845)

* Completed translation of class io.BufferedIOBase of library/io.po

* Fix translation issues as per reviewer's suggestions
  • Loading branch information
cschan1828 committed Mar 10, 2024
1 parent 286cece commit f0b8d94
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions library/io.po
Original file line number Diff line number Diff line change
Expand Up @@ -955,28 +955,35 @@ msgid ""
"`BufferedIOBase` deals with. This is not part of the :class:"
"`BufferedIOBase` API and may not exist on some implementations."
msgstr ""
"底層的原始串流(一個 :class:`RawIOBase` 實例),:class:`BufferedIOBase` 處理"
"的對象。這不是 :class:`BufferedIOBase` API 的一部分,且在某些實作可能不存在。"

#: ../../library/io.rst:552
msgid "Separate the underlying raw stream from the buffer and return it."
msgstr ""
msgstr "將底層的原始串流從緩衝區中分離出來,並回傳它。"

#: ../../library/io.rst:554
msgid ""
"After the raw stream has been detached, the buffer is in an unusable state."
msgstr ""
msgstr "在原始串流被分離後,緩衝區處於一個不可用的狀態。"

#: ../../library/io.rst:557
msgid ""
"Some buffers, like :class:`BytesIO`, do not have the concept of a single raw "
"stream to return from this method. They raise :exc:`UnsupportedOperation`."
msgstr ""
"某些緩衝區,如 :class:`BytesIO`,沒有單一原始串流的概念可從此方法回傳。它們會"
"引發 :exc:`UnsupportedOperation`。"

#: ../../library/io.rst:565
msgid ""
"Read and return up to *size* bytes. If the argument is omitted, ``None``, "
"or negative, data is read and returned until EOF is reached. An empty :"
"class:`bytes` object is returned if the stream is already at EOF."
msgstr ""
"讀取並回傳最多 *size* 個位元組。如果引數被省略、為 ``None`` 或為負值,將讀取"
"並回傳資料直到達到 EOF 為止。如果串流已經處於 EOF,則回傳一個空的 :class:"
"`bytes` 物件。"

#: ../../library/io.rst:569
msgid ""
Expand All @@ -986,12 +993,17 @@ msgid ""
"raw read will be issued, and a short result does not imply that EOF is "
"imminent."
msgstr ""
"如果引數為正數,且底層原始串流不是互動式的,可能會發出多次原始讀取來滿足位元"
"組數量(除非首先達到 EOF)。但對於互動式原始串流,最多只會發出一次原始讀取,"
"且短少的資料不表示 EOF 即將到來。"

#: ../../library/io.rst:575 ../../library/io.rst:598 ../../library/io.rst:608
msgid ""
"A :exc:`BlockingIOError` is raised if the underlying raw stream is in non "
"blocking-mode, and has no data available at the moment."
msgstr ""
"如果底層原始串流處於非阻塞模式,且當前沒有可用資料,則會引發 :exc:"
"`BlockingIOError`。"

#: ../../library/io.rst:580
msgid ""
Expand All @@ -1000,25 +1012,34 @@ msgid ""
"method. This can be useful if you are implementing your own buffering on "
"top of a :class:`BufferedIOBase` object."
msgstr ""
"讀取並回傳最多 *size* 個位元組,最多呼叫一次底層原始串流的 :meth:`~RawIOBase."
"read` (或 :meth:`~RawIOBase.readinto`) 方法。如果你正在 :class:"
"`BufferedIOBase` 物件之上實作自己的緩衝區,這可能會很有用。"

#: ../../library/io.rst:586
msgid ""
"If *size* is ``-1`` (the default), an arbitrary number of bytes are returned "
"(more than zero unless EOF is reached)."
msgstr ""
"如果 *size* 為 ``-1`` (預設值),則會回傳任意數量的位元組(除非達到 EOF,否"
"則會超過零)。"

#: ../../library/io.rst:591
msgid ""
"Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and "
"return the number of bytes read. For example, *b* might be a :class:"
"`bytearray`."
msgstr ""
"讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 當中,並回傳"
"讀取的位元組數量。例如,*b* 可能是一個 :class:`bytearray`。"

#: ../../library/io.rst:595
msgid ""
"Like :meth:`read`, multiple reads may be issued to the underlying raw "
"stream, unless the latter is interactive."
msgstr ""
"類似於 :meth:`read`,除非後者是互動式的,否則可能會對底層原始串流發出多次讀"
"取。"

#: ../../library/io.rst:603
msgid ""
Expand All @@ -1027,6 +1048,9 @@ msgid ""
"read` (or :meth:`~RawIOBase.readinto`) method. Return the number of bytes "
"read."
msgstr ""
"讀取位元組到一個預先分配的、可寫的 :term:`bytes-like object` *b* 中,最多呼叫"
"一次底層原始串流的 :meth:`~RawIOBase.read` (或 :meth:`~RawIOBase.readinto`)"
"方法。此方法回傳讀取的位元組數量。"

#: ../../library/io.rst:615
msgid ""
Expand All @@ -1036,19 +1060,27 @@ msgid ""
"implementation, these bytes may be readily written to the underlying stream, "
"or held in a buffer for performance and latency reasons."
msgstr ""
"寫入給定的 :term:`bytes-like object`,*b*,並回傳寫入的位元組數量(總是等於 "
"*b* 的長度,以位元組計,因為如果寫入失敗將會引發 :exc:`OSError`)。根據實際的"
"實作,這些位元組可能會立即寫入底層串流,或出於性能和延遲的緣故而被留在緩衝區"
"當中。"

#: ../../library/io.rst:622
msgid ""
"When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data "
"needed to be written to the raw stream but it couldn't accept all the data "
"without blocking."
msgstr ""
"當處於非阻塞模式時,如果需要將資料寫入原始串流,但它無法接受所有資料而不阻"
"塞,則會引發 :exc:`BlockingIOError`。"

#: ../../library/io.rst:626
msgid ""
"The caller may release or mutate *b* after this method returns, so the "
"implementation should only access *b* during the method call."
msgstr ""
"呼叫者可以在此方法回傳後釋放或變更 *b*,因此實作應該僅在方法呼叫期間存取 "
"*b*。"

#: ../../library/io.rst:631
msgid "Raw File I/O"
Expand Down

0 comments on commit f0b8d94

Please sign in to comment.