Skip to content
95 changes: 59 additions & 36 deletions library/array.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@
# Translators:
# Liang-Bo Wang <me@liang2.tw>, 2016
# 周 忠毅 <rilakcrc35@gmail.com>, 2016
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
# Benson Chen <bc842017@gmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"PO-Revision-Date: 2018-05-23 14:38+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"PO-Revision-Date: 2021-11-19 20:37+0800\n"
"Last-Translator: Benson Chen <bc842017@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.0\n"

#: ../../library/array.rst:2
msgid ":mod:`array` --- Efficient arrays of numeric values"
Expand All @@ -34,9 +37,9 @@ msgid ""
"following type codes are defined:"
msgstr ""
"這個模組定義了一個物件型別,可以簡潔的表達一個包含基本數值的陣列:字元、整"
"數、浮點數。陣列是一個非常類似 list 的序列型態,除了陣列會限制儲存的物件型"
"。在建立陣列時可以使用一個字元的 :dfn:`type code` 來指定儲存的資料型別。下"
"面是 type codes 的定義。"
"數、浮點數。陣列是一個非常類似 list(串列)的序列型別,除了陣列會限制儲存的物"
"件型別。在建立陣列時可以使用一個字元的 :dfn:`type code` 來指定儲存的資料型"
"別。下面是 type codes 的定義。"

#: ../../library/array.rst:19
msgid "Type code"
Expand Down Expand Up @@ -92,7 +95,7 @@ msgstr "``'u'``"

#: ../../library/array.rst:25
msgid "wchar_t"
msgstr ""
msgstr "wchar_t"

#: ../../library/array.rst:25
msgid "Unicode character"
Expand Down Expand Up @@ -204,14 +207,17 @@ msgstr "註解:"

#: ../../library/array.rst:51
msgid "It can be 16 bits or 32 bits depending on the platform."
msgstr ""
msgstr "根據平台的不同,他有可能是 16 位元或者 32 位元。"

#: ../../library/array.rst:53
msgid ""
"``array('u')`` now uses ``wchar_t`` as C type instead of deprecated "
"``Py_UNICODE``. This change doesn't affect to its behavior because "
"``Py_UNICODE`` is alias of ``wchar_t`` since Python 3.3."
msgstr ""
"目前 ``array(‘u’)`` 使用 ``wchar_t`` 取代已棄用的 ``Py_UNICODE`` 作為 C "
"type。這個異動並沒有影響到他的作用,因爲自從 Python 3.3 開始 ``Py_UNICODE`` "
"即為 ``wchar_t`` 的別名。"

#: ../../library/array.rst:61
msgid ""
Expand All @@ -233,8 +239,8 @@ msgid ""
"object`, or iterable over elements of the appropriate type."
msgstr ""
"一個新的陣列中的元素被 *typecode* 限制,並由選用的 *initializer* 參數初始"
"化, *initializer* 必須是一個 list、 :term:`bytes-like object` 或包含適當型別"
"變數的 iterable 。"
"化,\\ *initializer* 必須是一個 list、\\ :term:`bytes-like object` 或包含適當"
"型別變數的 iterable。"

#: ../../library/array.rst:75
msgid ""
Expand All @@ -243,7 +249,7 @@ msgid ""
"below) to add initial items to the array. Otherwise, the iterable "
"initializer is passed to the :meth:`extend` method."
msgstr ""
"如果指定一個 list 或 string ,新的陣列初始化時會傳入 :meth:`fromlist` :"
"如果指定一個 list 或 string,新的陣列初始化時會傳入 :meth:`fromlist`\\ 、\\ :"
"meth:`frombytes` 或 :meth:`fromunicode` 方法(參照下方)將元素新增到其中。其"
"他型態的變數則會傳入 :meth:`extend` 方法初始化。"

Expand All @@ -252,10 +258,12 @@ msgid ""
"Raises an :ref:`auditing event <auditing>` ``array.__new__`` with arguments "
"``typecode``, ``initializer``."
msgstr ""
"引發 :ref:`審核事件 (auditing event) <auditing>` ``array.__new__`` 並帶入引"
"數 ``typecode``, ``initializer``。"

#: ../../library/array.rst:84
msgid "A string with all available type codes."
msgstr "一個包含所有可用的 type code 的字串。"
msgstr "一個包含所有可用的 type codes 的字串。"

#: ../../library/array.rst:86
msgid ""
Expand All @@ -266,6 +274,11 @@ msgid ""
"interface, and may be used wherever :term:`bytes-like objects <bytes-like "
"object>` are supported."
msgstr ""
"陣列支援常見的序列操作,包含索引 (indexing)、切片 (slicing)、串接 "
"(concatenation)、相乘 (multiplication) 等。當使用切片進行賦值時,賦值的陣列必"
"須具備相同的 type code,其他型別的數值將導致 :exc:`TypeError`\\ 。陣列同時也"
"實作了緩衝區介面,可以在任何支援 :term:`bytes-like objects <bytes-like "
"object>` 的地方使用。"

#: ../../library/array.rst:92
msgid "The following data items and methods are also supported:"
Expand Down Expand Up @@ -295,7 +308,7 @@ msgid ""
"it."
msgstr ""
"回傳一個 tuple ``(address, length)`` 表示當前的記憶體位置和陣列儲存元素的緩衝"
"區記憶體長度。緩衝區的長度單位是 bytes ,並可以用 ``array.buffer_info()[1] * "
"區記憶體長度。緩衝區的長度單位是 bytes,並可以用 ``array.buffer_info()[1] * "
"array.itemsize`` 計算得到。這偶爾會在底層操作需要記憶體位置的輸出輸入時很有"
"用,例如 :c:func:`ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時,回"
"傳的數值就有效。"
Expand All @@ -308,9 +321,9 @@ msgid ""
"backward compatibility and should be avoided in new code. The buffer "
"interface is documented in :ref:`bufferobjects`."
msgstr ""
"當使用來自 C 或 C++ 程式碼(這是唯一使得這個資訊有效的途徑) 的陣列物件時,更"
"當使用來自 C 或 C++ 程式碼(這是唯一使得這個資訊有效的途徑)的陣列物件時,更"
"適當的做法是使用陣列物件支援的緩衝區介面。這個方法維護了向後兼容性,並應該在"
"新的程式碼中避免。關於緩衝區介面的文件在 :ref:`bufferobjects` 。"
"新的程式碼中避免。關於緩衝區介面的文件在 :ref:`bufferobjects`\\ 。"

#: ../../library/array.rst:130
msgid ""
Expand All @@ -320,8 +333,8 @@ msgid ""
"written on a machine with a different byte order."
msgstr ""
"\"Byteswap\" 所有陣列中的物件。這只有支援物件長度為 1、2、4 或 8 位元組的陣"
"列,其他型別的值會導致 :exc:`RuntimeError` 。這在從機器讀取位元順序不同的檔案"
"時很有用。"
"列,其他型別的值會導致 :exc:`RuntimeError`\\ 。這在從機器讀取位元順序不同的檔"
"案時很有用。"

#: ../../library/array.rst:138
msgid "Return the number of occurrences of *x* in the array."
Expand All @@ -335,9 +348,9 @@ msgid ""
"iterable and its elements must be the right type to be appended to the array."
msgstr ""
"從 *iterable* 中新增元素到陣列的尾端,如果 *iterable* 是另一個陣列,他必須有"
"完全相同的 type code ,如果不同會產生 :exc:`TypeError` 。如果 *iterable* 不是"
"一個陣列,他必須可以被迭代 (iterable) 且其中的元素必須是可以被加入陣列中的正"
"確型態。"
"完全相同的 type code ,如果不同會導致 :exc:`TypeError`\\ 。如果 *iterable* "
"是一個陣列,他必須可以被迭代 (iterable) 且其中的元素必須是可以被加入陣列中的"
"正確型別。"

#: ../../library/array.rst:151
msgid ""
Expand All @@ -350,7 +363,7 @@ msgstr ""

#: ../../library/array.rst:154
msgid ":meth:`fromstring` is renamed to :meth:`frombytes` for clarity."
msgstr "為了更明確,之前的 :meth:`fromstring` 被更名為 :meth:`frombytes` 。"
msgstr "為了更明確,之前的 :meth:`fromstring` 被更名為 :meth:`frombytes`\\ 。"

#: ../../library/array.rst:160
msgid ""
Expand All @@ -360,16 +373,16 @@ msgid ""
"inserted into the array."
msgstr ""
"從 :term:`file object` *f* 讀取 *n* 個 machine value 類型的元素,接著將這些元"
"素加入陣列的最尾端。如果只有少於 *n* 個有效的元素會產生 :exc:`EOFError`"
"誤,但有效的元素仍然會被加入陣列中。"
"素加入陣列的最尾端。如果只有少於 *n* 個有效的元素會導致 :exc:`EOFError`\\ ,"
"但有效的元素仍然會被加入陣列中。"

#: ../../library/array.rst:168
msgid ""
"Append items from the list. This is equivalent to ``for x in list: a."
"append(x)`` except that if there is a type error, the array is unchanged."
msgstr ""
"從 list 中新增元素。這等價於 ``for x in list: a.append(x)`` ,除了有型態錯誤"
"產生時,陣列會保持原狀不會被更改。"
"從 list 中新增元素。這等價於 ``for x in list: a.append(x)``,除了有型別錯誤產"
"生時,陣列會保持原狀不會被更改。"

#: ../../library/array.rst:174
msgid ""
Expand All @@ -378,9 +391,9 @@ msgid ""
"``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an "
"array of some other type."
msgstr ""
"用給定的 unicode 字串擴展這個陣列。陣列必須是型態 ``u`` 的陣列;其他的型態會"
"產生 :exc:`ValueError` 錯誤。使用 ``array.frombytes(unicodestring."
"encode(enc))`` 來新增 Unicode 資料到一個其他型態的陣列。"
"用給定的 unicode 字串擴展這個陣列。陣列必須是 ``u`` 型別的陣列;其他的型別會"
"導致 :exc:`ValueError` 錯誤。使用 ``array.frombytes(unicodestring."
"encode(enc))`` 來新增 Unicode 資料到一個其他型別的陣列。"

#: ../../library/array.rst:182
msgid ""
Expand All @@ -389,16 +402,19 @@ msgid ""
"specified to search for *x* within a subsection of the array. Raise :exc:"
"`ValueError` if *x* is not found."
msgstr ""
"回傳 *i* 的最小數值,使得 *i* 成為陣列之中第一次出現 *x* 的索引。選擇性的參"
"數 *start* 及 *stop* 則可以被用來在指定的陣列空間中搜尋 *x* 。如果 *x* 不存在"
"將導致 :exc:`ValueError`\\ 。"

#: ../../library/array.rst:187
msgid "Added optional *start* and *stop* parameters."
msgstr ""
msgstr "新增選擇性的參數 *start* 及 *stop*\\ 。"

#: ../../library/array.rst:192
msgid ""
"Insert a new item with value *x* in the array before position *i*. Negative "
"values are treated as being relative to the end of the array."
msgstr "在位置 *i* 之前插入一個元素 *x* 。負數的索引值會從陣列尾端開始數。"
msgstr "在位置 *i* 之前插入一個元素 *x*\\ 。負數的索引值會從陣列尾端開始數。"

#: ../../library/array.rst:198
msgid ""
Expand All @@ -411,7 +427,7 @@ msgstr ""

#: ../../library/array.rst:205
msgid "Remove the first occurrence of *x* from the array."
msgstr "從陣列中刪除第一個出現的 *x* 。"
msgstr "從陣列中刪除第一個出現的 *x*\\ 。"

#: ../../library/array.rst:210
msgid "Reverse the order of the items in the array."
Expand All @@ -428,24 +444,24 @@ msgstr ""

#: ../../library/array.rst:219
msgid ":meth:`tostring` is renamed to :meth:`tobytes` for clarity."
msgstr "為了明確性,過去的 :meth:`tostring` 已更名為 :meth:`tobytes` 。"
msgstr "為了明確性,過去的 :meth:`tostring` 已更名為 :meth:`tobytes`\\ 。"

#: ../../library/array.rst:225
msgid "Write all items (as machine values) to the :term:`file object` *f*."
msgstr "將所有元素 (以 machine code 的形式)寫入 :term:`file object` *f* 。"
msgstr "將所有元素(以 machine code 的形式)寫入 :term:`file object` *f*\\ 。"

#: ../../library/array.rst:230
msgid "Convert the array to an ordinary list with the same items."
msgstr "不更改元素,將陣列轉為一般的 list 。"
msgstr "不更改元素,將陣列轉為一般的 list。"

#: ../../library/array.rst:235
msgid ""
"Convert the array to a unicode string. The array must be a type ``'u'`` "
"array; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()."
"decode(enc)`` to obtain a unicode string from an array of some other type."
msgstr ""
"將陣列轉為一個字串。陣列的型態必須為 ``u`` 。其他型態的陣列會產生 :exc:"
"`ValueError` 錯誤。使用 ``array.tobytes().decode(enc)`` 將其他型態的陣列轉為"
"將陣列轉為一個字串。陣列的型態必須為 ``u`` 。其他型別的陣列會導致 :exc:"
"`ValueError` 錯誤。使用 ``array.tobytes().decode(enc)`` 將其他型別的陣列轉為"
"字串。"

#: ../../library/array.rst:240
Expand All @@ -458,6 +474,13 @@ msgid ""
"`eval`, so long as the :class:`~array.array` class has been imported using "
"``from array import array``. Examples::"
msgstr ""
"當一個陣列物件被列印或轉換成字串時,他會被表示為 ``array(typecode, "
"initializer)`` 。若為空陣列則參數 *initializer* 被省略,若 *typecode* 是 "
"``’u’`` 將被表示為字串,其他情況則被表示為數字 list。只要 :class:`~array."
"array` class(類別)透過 ``from array import array`` 的方式引入,使用 :func:"
"`eval` 便能確保其字串被轉換回一個擁有相同型別及數值的陣列。範例:\n"
"\n"
"::"

#: ../../library/array.rst:257
msgid "Module :mod:`struct`"
Expand Down Expand Up @@ -485,7 +508,7 @@ msgstr "`NumPy <https://numpy.org/>`_"

#: ../../library/array.rst:264
msgid "The NumPy package defines another array type."
msgstr "NumPy 套件定義了另一個陣列型態"
msgstr "NumPy 套件定義了另一個陣列型別"

#~ msgid ""
#~ "Return the smallest *i* such that *i* is the index of the first "
Expand Down