@@ -162,11 +162,10 @@ msgid ""
162162"*allow_nan* is true, their JavaScript equivalents (``NaN``, ``Infinity``, ``-"
163163"Infinity``) will be used."
164164msgstr ""
165- "如果 *allow_nan* 設為 False(預設值為 ``True``),那麼序列化 (serialize):"
166- "class:`float` 的特殊值 (``nan``, ``inf``, ``-inf``) 會觸發 :exc:"
167- "`ValueError`,這麼設定是為了遵守較嚴格的 JSON 規範。如果設為 True,則序列化這"
168- "些極值不會出錯,而是會被自動代換成 JavaScript 上等價的值 (``NaN``, "
169- "``Infinity``, ``-Infinity``)"
165+ "如果 *allow_nan* 為 false(預設值:``True``\\ )且嚴格遵守 JSON 規範,則序列"
166+ "化超出範圍的 :class:`float` 值 (``nan``, ``inf``, ``-inf``) 會引發 :exc:"
167+ "`ValueError`。如果 *allow_nan* 為 true,則將使用它們的 JavaScript 等效項 "
168+ "(``NaN``, ``Infinity``, ``-Infinity``)。"
170169
171170#: ../../library/json.rst:168 ../../library/json.rst:452
172171msgid ""
@@ -177,12 +176,14 @@ msgid ""
177176"indent indents that many spaces per level. If *indent* is a string (such as "
178177"``\"\\ t\" ``), that string is used to indent each level."
179178msgstr ""
180- "如果 *indent* 是一個非負整數或字串,那麼 JSON 序列及其所含元素,會以pretty-"
181- "print 的方式顯示,並會有幾個。"
179+ "如果 *indent* 是非負整數或字串,則 JSON 陣列元素和物件成員將使用該縮排等級進"
180+ "行漂亮列印。縮排等級 0、負數或 ``\"\" `` 只會插入換行符號。``None``\\ (預設"
181+ "值)選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如果 "
182+ "*indent* 是一個字串(例如 ``\"\\ t\" ``\\ ),則該字串用於縮排每個層級。"
182183
183184#: ../../library/json.rst:175 ../../library/json.rst:459
184185msgid "Allow strings for *indent* in addition to integers."
185- msgstr "允許字串作為 *indent* 的值,而不只是允許整數 。"
186+ msgstr "除了整數之外,還允許使用字串進行 *indent*。"
186187
187188#: ../../library/json.rst:178 ../../library/json.rst:462
188189msgid ""
@@ -191,10 +192,9 @@ msgid ""
191192"': ')`` otherwise. To get the most compact JSON representation, you should "
192193"specify ``(',', ':')`` to eliminate whitespace."
193194msgstr ""
194- "*separator* 是分隔符號,``( 項跟項 (item) 之間的分隔符號, 鍵值 (key) 之間的分"
195- "隔符號)`` 的 tuple。 如果 *indent* 是 ``None``,則預設值為 ``(', ', ': ')``,"
196- "否則預設值為 ``(',', ': ')``。如果希望 JSON 更省空間,建議指定為 ``(',', "
197- "':')``,這樣可以消除空白。"
195+ "如果有指定,*separators* 應該是一個 ``(item_separator, key_separator)`` 元"
196+ "組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': ')``,否則預設為 ``(',', "
197+ "': ')``。要獲得最緊湊的 JSON 表示形式,你應該指定 ``(',', ':')`` 來消除空格。"
198198
199199#: ../../library/json.rst:183 ../../library/json.rst:467
200200msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``."
@@ -207,53 +207,50 @@ msgid ""
207207"version of the object or raise a :exc:`TypeError`. If not specified, :exc:"
208208"`TypeError` is raised."
209209msgstr ""
210- "*default* 必須一個函式,如果你有設定它的話,遇到無法 JSON 序列化的物件時會呼"
211- "叫你 *default* 設定的函式。該函式只能有兩種狀況:要不就回傳一個可以被 JSON 序"
212- "列化的物件,要不就拋出 :exc:`TypeError`。如果 *default* 沒有指定值,則只要遇"
213- "到無法 JSON 序列化的物件就會丟出 :exc:`TypeError`。"
210+ "如果有指定,*default* 應該是一個為無法序列化的物件呼叫的函式。它應該傳回物件"
211+ "的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會引發 :exc:"
212+ "`TypeError`。"
214213
215214#: ../../library/json.rst:191
216215msgid ""
217216"If *sort_keys* is true (default: ``False``), then the output of dictionaries "
218217"will be sorted by key."
219218msgstr ""
220- "如果 *sort_keys* 設為 True(預設值為 False),那麼字典的輸出會按照 "
221- "*sort_keys* 排序。"
219+ "如果 *sort_keys* 為 true(預設值:``False``),則字典的輸出將按鍵排序。"
222220
223221#: ../../library/json.rst:194
224222msgid ""
225223"To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :"
226224"meth:`~JSONEncoder.default` method to serialize additional types), specify "
227225"it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used."
228226msgstr ""
229- "如果要使用自訂的 :class:`JSONEncoder`子類別去改寫 (overrides)原來預設的 "
230- "meth:`~JSONEncoder. default`,請標明 *cls* 以序列化更多不同的型別。如果沒有標 "
231- "的話,就會使用 :class:`JSONEncoder` 來序列化 。"
227+ "若要使用自訂 :class:`JSONEncoder`子類別(例如覆寫 :meth:`~JSONEncoder. "
228+ "default` 方法來序列化其他型別的子類別),請使用 *cls*kwarg 指定它;否則使 "
229+ "用 :class:`JSONEncoder`。"
232230
233231#: ../../library/json.rst:198 ../../library/json.rst:277
234232msgid ""
235233"All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`."
236234msgstr ""
237- "所有非必要參數現在都是 :ref:`keyword-only <keyword-only_parameter>` 了。"
235+ "所有可選參數現在都是 \\ :ref:`僅限關鍵字 <keyword-only_parameter>`\\ 了。"
238236
239237#: ../../library/json.rst:203
240238msgid ""
241239"Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so "
242240"trying to serialize multiple objects with repeated calls to :func:`dump` "
243241"using the same *fp* will result in an invalid JSON file."
244242msgstr ""
245- "JSON 和 :mod:`pickle` 跟 :mod:`marshal` 不同,JSON不是一個框架協定,所以如果"
246- "你試著用同一個 *fp* 來重複呼叫 :func:`dump` 來序列化多個物件,會導致無效的"
247- "JSON檔案。"
243+ "與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 不是框架協定,因此嘗試使用相同"
244+ "的 *fp* 重複呼叫 :func:`dump` 來序列化多個物件將導致無效的 JSON 檔案。"
248245
249246#: ../../library/json.rst:212
250247msgid ""
251248"Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion "
252249"table <py-to-json-table>`. The arguments have the same meaning as in :func:"
253250"`dump`."
254251msgstr ""
255- "用這個 :ref:`conversion table <py -to-json -table>`來把 *obj*序列化成JSON 格 "
256- "式的 : class:`str`。 裡面所有引數和 :func: `dump`裡的意義相同 。"
252+ "使用此 \\ :ref:`轉換表 <json -to-py -table>`來將 *obj*序列化為 JSON 格式化 : "
253+ "class:`str`。這些引數與 :func:`dump`中的意義相同 。"
257254
258255#: ../../library/json.rst:218
259256msgid ""
@@ -263,20 +260,20 @@ msgid ""
263260"JSON and then back into a dictionary, the dictionary may not equal the "
264261"original one. That is, ``loads(dumps(x)) != x`` if x has non-string keys."
265262msgstr ""
266- "在 JSON的 鍵值/值對 (key/value pairs) 中,鍵值一定是 :class:`str`。當一個字 "
267- "典物件 (dictionary) 被轉換成 JSON 時,字典的所有鍵都會被強制轉換成字串。因 "
268- "此,如果一個字典被轉換成 JSON 然後再轉回字典,該字典可能不等於原來的字典。也 "
269- "就是說,如果字典 x 有些鍵值不是字串,那麼 ``loads(dumps(x)) != x``。"
263+ "JSON鍵/值對中的鍵始終為 :class:`str` 型別。當字典轉換為 JSON 時,字典的所有 "
264+ "鍵都被強制轉換為字串。因此,如果將字典轉換為 JSON,然後再轉換回字典,則該字典 "
265+ "可能不等於原始字典。也就是說,如果 x 有非字串鍵,則 ``loads(dumps(x)) != "
266+ "x``。"
270267
271268#: ../../library/json.rst:227
272269msgid ""
273270"Deserialize *fp* (a ``.read()``-supporting :term:`text file` or :term:"
274271"`binary file` containing a JSON document) to a Python object using this :ref:"
275272"`conversion table <json-to-py-table>`."
276273msgstr ""
277- "將 fp(一個支持.read() 的 :term:`text file` 或包含 JSON 的:term:`binary "
278- "file` 反序列化 (deserialize) 為 Python 物件,轉換規則使用`conversion table "
279- "<json-to-py-table>` 。"
274+ "使用此 \\ :ref:`轉換表 <json-to-py-table>` 來將 *fp* \\ (一個支援 ``. "
275+ "read()``、包含 JSON 文件的 :term:`文字檔案 <text file>` 或 :term:`二進位檔案 "
276+ "<binary file>` \\ )反序列化為 Python 物件 。"
280277
281278#: ../../library/json.rst:231
282279msgid ""
@@ -286,10 +283,10 @@ msgid ""
286283"be used to implement custom decoders (e.g. `JSON-RPC <https://www.jsonrpc."
287284"org>`_ class hinting)."
288285msgstr ""
289- "*object_hook*是一個非必要性的函式,用來解碼物件 object_literal。如果沒有值 "
290- "時,物件會被解碼成 :class: `dict`。如果有值,會 *object_hook*的回傳值會被用來 "
291- "取代原來的 :class:`dict`。因此,改寫 *object_hook* 就能自訂的解碼器(例如 "
292- "`JSON-RPC <https://www.jsonrpc.org>`_ 類別提示 )。"
286+ "*object_hook*是一個可選函式,將使用任何物件文本解碼的結果(一個 :class: "
287+ "`dict`\\ )來呼叫它。將使用 *object_hook*的回傳值而不是 :class:`dict`。此功 "
288+ "能可用於實作自訂解碼器(例如 `JSON-RPC <https://www.jsonrpc.org>`_ 類別提 "
289+ "示 )。"
293290
294291#: ../../library/json.rst:237
295292msgid ""
@@ -299,10 +296,10 @@ msgid ""
299296"`dict`. This feature can be used to implement custom decoders. If "
300297"*object_hook* is also defined, the *object_pairs_hook* takes priority."
301298msgstr ""
302- "*object_pairs_hook*是一個非必要函式,會在解碼物件成有序值對陣列(暫譯, "
303- "ordered list of pairs),如果有值,JSON 會使用 *object_pairs_hook*的回傳值而 "
304- "非原本的 :class:`dict`。此功能可以用來自訂解碼器。如果 *object_hook*也有值, "
305- "*object_pairs_hook* 的值會優先採用 。"
299+ "*object_pairs_hook*是一個可選函式,將使用使用有序對列表解碼的任何物件文本的 "
300+ "結果來呼叫該函式。將使用 *object_pairs_hook*的回傳值而不是 :class:`dict`。此 "
301+ "功能可用於實作自訂解碼器。如果也定義了 *object_hook*,則 *object_pairs_hook* "
302+ "優先 。"
306303
307304#: ../../library/json.rst:243 ../../library/json.rst:348
308305msgid "Added support for *object_pairs_hook*."
@@ -315,9 +312,9 @@ msgid ""
315312"This can be used to use another datatype or parser for JSON floats (e.g. :"
316313"class:`decimal.Decimal`)."
317314msgstr ""
318- "如果 *parse_float* 有值,含浮點數的 JSON文字會被解析。預設是 "
319- "``float(num_str)``,但可以設成別的資料型別或 JSON浮點數文字解析器,例如: "
320- "class:`decimal.Decimal`。"
315+ "如有指定 *parse_float*,將使用要解碼的每個 JSON浮點數字串進行呼叫。預設情況 "
316+ "下,這相當於 ``float(num_str)``。這可用於將另一種資料型別或剖析器用於 JSON浮 "
317+ "點(例如 : class:`decimal.Decimal`\\ ) 。"
321318
322319#: ../../library/json.rst:251 ../../library/json.rst:356
323320msgid ""
@@ -326,31 +323,33 @@ msgid ""
326323"can be used to use another datatype or parser for JSON integers (e.g. :class:"
327324"`float`)."
328325msgstr ""
329- "如果 *parse_int* 有值,含整數的 JSON 文字會被解析。預設是``int(num_str)``,但"
330- "可以設成別的資料型別或 JSON 整數文字解析器,例如:class:`float`。"
326+ "如有指定 *parse_int*,將使用要解碼的每個 JSON 整數字串進行呼叫。預設情況下,"
327+ "這相當於 ``int(num_str)``。這可用於對 JSON 整數使用另一種資料型別或剖析器(例"
328+ "如 :class:`float`\\ )。"
331329
332330#: ../../library/json.rst:256
333331msgid ""
334332"The default *parse_int* of :func:`int` now limits the maximum length of the "
335333"integer string via the interpreter's :ref:`integer string conversion length "
336334"limitation <int_max_str_digits>` to help avoid denial of service attacks."
337335msgstr ""
338- ":func:`int` 預設的 *parse_int* 現在有字數上限了,上限是直譯器的:ref:`integer "
339- "string conversion length limitation <int_max_str_digits>`"
336+ ":func:`int` 預設的 *parse_int* 現在對於整數字串有長度上限,上限是直譯器的\\ :"
337+ "ref:`整數字串轉換長度限制 <int_max_str_digits>`,這能防止阻斷服務攻擊 "
338+ "(denial of service attacks)。"
340339
341340#: ../../library/json.rst:262 ../../library/json.rst:361
342341msgid ""
343342"*parse_constant*, if specified, will be called with one of the following "
344343"strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to "
345344"raise an exception if invalid JSON numbers are encountered."
346345msgstr ""
347- "如果 *parse_constant* 有值,那麼遇到 ``'-Infinity'``、``'Infinity'``或 "
348- "``'NaN'``等字串時,會被呼叫用以解析它們。 *parse_constant* 也可是設定成在遇在 "
349- "遇無效的 JSON 數字時出錯 。"
346+ "如果 *parse_constant* 有值,那麼以 ``'-Infinity'``、``'Infinity'`` 或 "
347+ "``'NaN'`` 字串其中之一來呼叫。這也可用於在遇到無效的 JSON 數字時引發一個例 "
348+ "外 。"
350349
351350#: ../../library/json.rst:267
352351msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore."
353- msgstr "*parse_constant*不再在遇到 'null'、 'true'、 'false' 呼叫了。"
352+ msgstr "*parse_constant*不再以 'null'、 'true'、 'false' 呼叫了。"
354353
355354#: ../../library/json.rst:270
356355msgid ""