8000 Translate `library/marshal.po` (#176) · python/python-docs-zh-tw@20f09e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 20f09e0

Browse files
authored
Translate library/marshal.po (#176)
1 parent 12fcb63 commit 20f09e0

File tree

1 file changed

+66
-7
lines changed

1 file changed

+66
-7
lines changed

library/marshal.po

Lines changed: 66 additions & 7 deletions
+
"引發一個附帶引數 ``bytes`` 的\\ :ref:`稽核事件 <auditing>` ``marshal.loads``"
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
7+
# Matt Wang <mattwang44@gmail.com>, 2021
8+
#
69
msgid ""
710
msgstr ""
811
"Project-Id-Version: Python 3.10\n"
912
"Report-Msgid-Bugs-To: \n"
1013
"POT-Creation-Date: 2021-09-13 00:11+0000\n"
11-
"PO-Revision-Date: 2018-05-23 16:05+0000\n"
12-
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
14+
"PO-Revision-Date: 2021-12-15 12:53+0800\n"
15+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1316
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1417
"tw)\n"
1518
"Language: zh_TW\n"
1619
"MIME-Version: 1.0\n"
1720
"Content-Type: text/plain; charset=UTF-8\n"
1821
"Content-Transfer-Encoding: 8bit\n"
1922
"Plural-Forms: nplurals=1; plural=0;\n"
23+
"X-Generator: Poedit 3.0.1\n"
2024

2125
#: ../../library/marshal.rst:2
2226
msgid ":mod:`marshal` --- Internal Python object serialization"
23-
msgstr ""
27+
msgstr ":mod:`marshal` --- 内部 Python 物件序列化"
2428

2529
#: ../../library/marshal.rst:10
2630
msgid ""
@@ -31,6 +35,10 @@ msgid ""
3135
"are undocumented on purpose; it may change between Python versions (although "
3236
"it rarely does). [#]_"
3337
msgstr ""
38+
"此 module(模組)包含一個能以二進位制格式來讀寫 Python 值的函式。這種格式是 "
39+
"Python 專屬但獨立於機器架構的(例如,你可以在一臺 PC 上寫入某個 Python 值,再"
40+
"將檔案傳到一臺 Sun 上並在那裡讀取它)。這種格式的細節是有意地不在文件上說明"
41+
"的;它可能在不同 Python 版本中被改變(雖然這種情況極少發生)。\\ [#]_"
3442

3543
#: ../../library/marshal.rst:21
3644
msgid ""
@@ -45,13 +53,22 @@ msgid ""
4553
"guaranteed, and pickle supports a substantially wider range of objects than "
4654
"marshal."
4755
msgstr ""
56+
"這不是一個通用「持續性 (persistence)」module 。關於通用持續性以及透過 RPC 呼"
57+
"叫傳遞 Python 物件,請參閱 :mod:`pickle` 和 :mod:`shelve` 等 module 。\\ :"
58+
"mod:`marshal` module 主要是為了支援用來讀寫「偽編譯 (pseudo-compiled)」 :"
59+
"file:`.pyc` 檔案的 Python module。因此,Python 維護者保留了在必要時以不向後相"
60+
"容的方式修改 marshal 格式的權利。如果你要序列化和反序列化 Python 物件,請改"
61+
"用 :mod:`pickle` module -- 其執行效率相當、有保證版本獨立性,且實質上 "
62+
"pickle 還支援比 marshal 更多樣的物件。"
4863

4964
#: ../../library/marshal.rst:33
5065
msgid ""
5166
"The :mod:`marshal` module is not intended to be secure against erroneous or "
5267
"maliciously constructed data. Never unmarshal data received from an "
5368
"untrusted or unauthenticated source."
5469
msgstr ""
70+
":mod:`marshal` module 對於錯誤或惡意構建的資料來說是不安全的。永遠不要 "
71+
"unmarshal 來自不受信任的或來源未經驗證的資料。"
5572

5673
#: ../../library/marshal.rst:39
5774
msgid ""
@@ -67,22 +84,34 @@ msgid ""
6784
"*version* lower than 3, recursive lists, sets and dictionaries cannot be "
6885
"written (see below)."
6986
msgstr ""
87+
"不是所有 Python 物件型別都有支援;一般來說,此 module 只能寫入和讀取不依賴於"
88+
"特定 Python 調用 (invocation) 的物件。下列型別是有支援的:布林 (boolean)、整"
89+
"數、浮點數 (floating point number)、複數、字串、位元組串 (bytes)、位元組陣列 "
90+
"(bytearray)、元組 (tuple)、list、集合 (set)、凍結集合 (frozenset)、"
91+
"dictionary 和程式碼物件,需要了解的一點是元組、list、集合、凍結集合和 "
92+
"dictionary 只在其所包含的值也屬於這些型別時才會支援。單例 (singleton) 物件 :"
93+
"const:`None`\\\\ :const:`Ellipsis` 和 :exc:`StopIteration` 也可以被 "
94+
"marshal 和 unmarshal。對於 *version* 低於 3 的格式,遞迴 list、集合和 "
95+
"dictionary 無法被寫入(見下文)。"
7096

7197
#: ../../library/marshal.rst:51
7298
msgid ""
7399
"There are functions that read/write files as well as functions operating on "
74100
"bytes-like objects."
75101
msgstr ""
102+
"有些函式可以讀/寫檔案,還有些函式可以操作類位元組串物件 (bytes-like object)。"
76103

77104
#: ../../library/marshal.rst:54
78105
msgid "The module defines these functions:"
79-
msgstr ""
106+
msgstr "這個 module 定義了以下函式:"
80107

81108
#: ../../library/marshal.rst:59
82109
msgid ""
83110
"Write the value on the open file. The value must be a supported type. The "
84111
"file must be a writeable :term:`binary file`."
85112
msgstr ""
113+
"將值寫入被開啟的檔案。值必須為受支援的型別,檔案必須為可寫入的 :term:`binary "
114+
"file`。"
86115

87116
#: ../../library/marshal.rst:62
88117
msgid ""
@@ -91,18 +120,23 @@ msgid ""
91120
"written to the file. The object will not be properly read back by :func:"
92121
"`load`."
93122
msgstr ""
123+
"如果值具有(或其所包含的物件具有)不支援的型別,則會引發 :exc:`ValueError` 例"
124+
"外 --- 但是垃圾資料 (garbage data) 也將寫入檔案,物件也無法正確地透過 :func:"
125+
"`load` 重新讀取。"
94126

95127
#: ../../library/marshal.rst:66
96128
msgid ""
97129
"The *version* argument indicates the data format that ``dump`` should use "
98130
"(see below)."
99-
msgstr ""
131+
msgstr "*version* 引數指明 ``dump`` 應該使用的資料格式(見下文)。"
100132

101133
#: ../../library/marshal.rst:69 ../../library/marshal.rst:101
102134
msgid ""
103135
"Raises an :ref:`auditing event <auditing>` ``marshal.dumps`` with arguments "
104136
"``value``, ``version``."
105137
msgstr ""
138+
"引發一個附帶引數 ``value`` 與 ``version`` 的\\ :ref:`稽核事件 (auditing "
139+
"event) <auditing>` ``marshal.dumps``\\ 。"
106140

107141
#: ../../library/marshal.rst:74
108142
msgid ""
@@ -111,60 +145,78 @@ msgid ""
111145
"format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. The "
112146
"file must be a readable :term:`binary file`."
113147
msgstr ""
148+
"從開啟的檔案讀取一個值並回傳。如果讀不到有效的值(例如,由於資料為不同 "
149+
"Python 版本的不相容 marshal 格式),則會引發 :exc:`EOFError`\\\\ :exc:"
150+
"`ValueError` 或 :exc:`TypeError`。檔案必須為可讀取的 :term:`binary file`\\ 。"
114151

115152
#: ../../library/marshal.rst:79
116153
msgid ""
117154
"Raises an :ref:`auditing event <auditing>` ``marshal.load`` with no "
118155
"arguments."
119156
msgstr ""
157+
"引發一個沒有附帶引數的\\ :ref:`稽核事件 <auditing>` ``marshal.load``\\ 。"
120158

121159
#: ../../library/marshal.rst:83
122160
msgid ""
123161
"If an object containing an unsupported type was marshalled with :func:"
124162
"`dump`, :func:`load` will substitute ``None`` for the unmarshallable type."
125163
msgstr ""
164+
"如果透過 :func:`dump` marshal 了一個包含不支援型別的物件,\\ :func:`load` 會"
165+
"將不可 marshal 的型別替換為 ``None``\\ 。"
126166

127167
#: ../../library/marshal.rst:88
128168
msgid ""
129169
"This call used to raise a ``code.__new__`` audit event for each code object. "
130170
"Now it raises a single ``marshal.load`` event for the entire load operation."
131171
msgstr ""
172+
"使用此呼叫為每個程式碼物件引發一個 ``code.__new__`` 稽核事件。現在它會為整個"
173+
"載入操作引發單個 ``marshal.load`` 事件。"
132174

133175
#: ../../library/marshal.rst:94
134176
msgid ""
135177
"Return the bytes object that would be written to a file by ``dump(value, "
136178
"file)``. The value must be a supported type. Raise a :exc:`ValueError` "
137179
"exception if value has (or contains an object that has) an unsupported type."
138180
msgstr ""
181+
"回傳將透過 ``dump(value, file)`` 來被寫入一個檔案的位元組串物件,其值必須是有"
182+
"支援的型別,如果值(或其包含的任一物件)為不支援的型別則會引發 :exc:"
183+
"`ValueError`\\ 。"
139184

140185
#: ../../library/marshal.rst:98
141186
msgid ""
142187
"The *version* argument indicates the data format that ``dumps`` should use "
143188
"(see below)."
144-
msgstr ""
189+
msgstr "*version* 引數指明 ``dumps`` 應當使用的資料型別(見下文)。"
145190

146191
#: ../../library/marshal.rst:106
147192
msgid ""
148193
"Convert the :term:`bytes-like object` to a value. If no valid value is "
149194
"found, raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. Extra "
150195
"bytes in the input are ignored."
151196
msgstr ""
197+
"將 :term:`bytes-like object` 轉換為一個值。如果找不到有效的值,則會引發 :exc:"
198+
"`EOFError`\\\\ :exc:`ValueError` 或 :exc:`TypeError`\\ 。輸入中額外的位元"
199+
"組串會被忽略。"
152200

153201
#: ../../library/marshal.rst:110
154202
msgid ""
155203
"Raises an :ref:`auditing event <auditing>` ``marshal.loads`` with argument "
156204
"``bytes``."
157205
msgstr ""
206
207+
"\\ 。"
158208

159209
#: ../../library/marshal.rst:114
160210
msgid ""
161211
"This call used to raise a ``code.__new__`` audit event for each code object. "
162212
"Now it raises a single ``marshal.loads`` event for the entire load operation."
163213
msgstr ""
214+
"使用此呼叫為每個程式碼物件引發一個 ``code.__new__`` 稽核事件。現在它會為整個"
215+
"載入操作引發單個 ``marshal.loads`` 事件。"
164216

165217
#: ../../library/marshal.rst:118
166218
msgid "In addition, the following constants are defined:"
167-
msgstr ""
219+
msgstr "此外,還定義了以下常數:"
168220

169221
#: ../../library/marshal.rst:122
170222
msgid ""
@@ -173,6 +225,9 @@ msgid ""
173225
"for floating point numbers. Version 3 adds support for object instancing and "
174226
"recursion. The current version is 4."
175227
msgstr ""
228+
"表示 module 所使用的格式。第 0 版為歷史格式,第 1 版共享了駐留字串 (interned "
229+
"string),第 2 版對浮點數使用二進位制格式。第 3 版添加了對於物件實例化和遞迴的"
230+
"支援。目前使用的是第 4 版。"
176231

177232
#: ../../library/marshal.rst:130
178233
msgid "Footnotes"
@@ -186,3 +241,7 @@ msgid ""
186241
"marshal\" means to convert some data from internal to external form (in an "
187242
"RPC buffer for instance) and \"unmarshalling\" for the reverse process."
188243
msgstr ""
244+
"此 module 的名稱來源於 Modula-3 (及其他語言) 的設計者所使用的術語,他們使用 "
245+
"\"marshal\" 來表示自包含 (self-contained) 形式資料的傳輸。嚴格來說,將資料從"
246+
"內部形式轉換為外部形式 (例如用於 RPC 緩衝區) 稱為 \"marshal\",而其反向過程則"
247+
"稱為 \"unmarshal\"。"

0 commit comments

Comments
 (0)
0