Skip to content

Commit ad4fff0

Browse files
committed
editing json.po, up to line 816.
1 parent 9c4d3ac commit ad4fff0

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

library/json.po

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ msgstr ""
104104
"JSON 語法是 `YAML <https://yaml.org/>`_ 1.2 語法的一種子集合。所以如果使用預"
105105
"設的設定的話(準確來說,使用預設的 *separators* 分隔符設定的話),這個模組的"
106106
"輸出也符合 YAML 1.0 和 1.1 的子集合規範。因此你也可以利用這個模組來當作 YAML "
107-
"的串聯化工具(serializer)。"
107+
"的串列化工具(serializer)。"
108108

109109
#: ../../library/json.rst:130
110110
msgid ""
@@ -124,7 +124,7 @@ msgid ""
124124
"supporting :term:`file-like object`) using this :ref:`conversion table <py-"
125125
"to-json-table>`."
126126
msgstr ""
127-
"參考這個\\ :ref:`轉換表 <py-to-json-table>`\\ 將 *obj* 串聯化為符合 JSON 格式"
127+
"參考這個\\ :ref:`轉換表 <py-to-json-table>`\\ 將 *obj* 串列化為符合 JSON 格式"
128128
"的字串流,並寫入到 *fp* (一個支援 ``.write()`` 方法的 :term:`file-like "
129129
"object`)"
130130

@@ -173,7 +173,7 @@ msgid ""
173173
"*allow_nan* is true, their JavaScript equivalents (``NaN``, ``Infinity``, ``-"
174174
"Infinity``) will be used."
175175
msgstr ""
176-
"如果 *allow_nan* 為 false(預設值:``True``\\ ),則串聯化超出嚴格 JSON 規範"
176+
"如果 *allow_nan* 為 false(預設值:``True``\\ ),則串列化超出嚴格 JSON 規範"
177177
"之範圍的 :class:`float` 值 (``nan``, ``inf``, ``-inf``) 會引發 :exc:"
178178
"`ValueError`。如果 *allow_nan* 為 true,則將使用它們的 JavaScript 等效項 "
179179
"(``NaN``, ``Infinity``, ``-Infinity``)。"
@@ -219,7 +219,7 @@ msgid ""
219219
"version of the object or raise a :exc:`TypeError`. If not specified, :exc:"
220220
"`TypeError` is raised."
221221
msgstr ""
222-
"如果有指定本參數,*default* 應該是一個為無法串聯化的物件呼叫的函式。它應該傳"
222+
"如果有指定本參數,*default* 應該是一個為無法串列化的物件呼叫的函式。它應該傳"
223223
"回物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會引發 :exc:"
224224
"`TypeError`。"
225225

@@ -237,7 +237,7 @@ msgid ""
237237
"it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used."
238238
msgstr ""
239239
"若要使用自訂 :class:`JSONEncoder` 子類別(例如覆寫 :meth:`~JSONEncoder."
240-
"default` 方法來串聯化其他型別的子類別),請使用關鍵字參數 *cls* 指定它;否則"
240+
"default` 方法來串列化其他型別的子類別),請使用關鍵字參數 *cls* 指定它;否則"
241241
"使用 :class:`JSONEncoder`。"
242242

243243
#: ../../library/json.rst:198 ../../library/json.rst:277
@@ -253,7 +253,7 @@ msgid ""
253253
"using the same *fp* will result in an invalid JSON file."
254254
msgstr ""
255255
"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 沒有二進位分框的協定,因此嘗試"
256-
"重複呼叫 :func:`dump` 來串聯化多個物件到同一個 *fp* 裡將導致無效的 JSON 檔"
256+
"重複呼叫 :func:`dump` 來串列化多個物件到同一個 *fp* 裡將導致無效的 JSON 檔"
257257
"案。"
258258

259259
# SkyLull: 我想這裡的 "framed protocol" 指的是 https://peps.python.org/pep-3154/#framing
@@ -263,7 +263,7 @@ msgid ""
263263
"table <py-to-json-table>`. The arguments have the same meaning as in :func:"
264264
"`dump`."
265265
msgstr ""
266-
"使用此\\ :ref:`轉換表 <json-to-py-table>`\\ 來將 *obj* 串聯化為 JSON 格式 :"
266+
"使用此\\ :ref:`轉換表 <json-to-py-table>`\\ 來將 *obj* 串列化為 JSON 格式 :"
267267
"class:`str`。這個參數的作用與 :func:`dump` 中的同名參數意義相同。"
268268

269269
#: ../../library/json.rst:218
@@ -287,7 +287,7 @@ msgid ""
287287
msgstr ""
288288
"使用此\\ :ref:`轉換表 <json-to-py-table>`\\ 來將 *fp*\\ (一個支援 ``."
289289
"read()``、包含 JSON 文件的\\ :term:`文字檔案 <text file>`\\\\ :term:`二進"
290-
"位檔案 <binary file>`\\去序列化為 Python 物件。"
290+
"位檔案 <binary file>`\\去串列化為 Python 物件。"
291291

292292
#: ../../library/json.rst:231
293293
msgid ""
@@ -383,7 +383,7 @@ msgid ""
383383
"If the data being deserialized is not a valid JSON document, a :exc:"
384384
"`JSONDecodeError` will be raised."
385385
msgstr ""
386-
"如果被去序列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:"
386+
"如果被去串列化(deserialized)的資料不符合 JSON 格式,將會引發 :exc:"
387387
"`JSONDecodeError` 例外。"
388388

389389
#: ../../library/json.rst:280
@@ -402,7 +402,7 @@ msgid ""
402402
msgstr ""
403403
"使用\\ :ref:`轉換表 <json-to-py-table>`\\ 將 *s* (一個含有 JSON 文件的 :"
404404
"class:`str`\\\\ :class:`bytes` 或 :class:`bytearray` 的實例(instance))"
405-
"去序列化(deserialize)為一個 Python 物件"
405+
"去串列化(deserialize)為一個 Python 物件"
406406

407407
#: ../../library/json.rst:290
408408
msgid "The other arguments have the same meaning as in :func:`load`."
@@ -683,6 +683,12 @@ msgid ""
683683
"example::"
684684
msgstr "回傳一個 Python 資料結構物件 *o* 的 JSON 的字串表示。例如::"
685685

686+
# 執行下列程式後能證明他的回傳物件是generator
687+
# >>> import json
688+
# >>> bigobject = list(range(100000))
689+
# >>> x = json.JSONEncoder().iterencode(bigobject)
690+
# >>> print(x)
691+
# <generator object _make_iterencode.<locals>._iterencode at 0x7293c4b48bc0>
686692
#: ../../library/json.rst:510
687693
msgid ""
688694
"Encode the given object, *o*, and yield each string representation as "
@@ -691,12 +697,6 @@ msgstr ""
691697
"將物件 *o* 編碼,並將結果統整為一個能依序產生(yield)各結果字串的生成器物件"
692698
"(generator)。如下例::"
693699

694-
# 執行下列程式後能證明他的回傳物件是generator
695-
# >>> import json
696-
# >>> bigobject = list(range(100000))
697-
# >>> x = json.JSONEncoder().iterencode(bigobject)
698-
# >>> print(x)
699-
# <generator object _make_iterencode.<locals>._iterencode at 0x7293c4b48bc0>
700700
#: ../../library/json.rst:518
701701
msgid "Exceptions"
702702
msgstr "例外"
@@ -707,7 +707,7 @@ msgstr ":exc:`ValueError` 的子類別具有下列額外屬性:"
707707

708708
#: ../../library/json.rst:526
709709
msgid "The unformatted error message."
710-
msgstr "未格式化的錯誤訊息。"
710+
msgstr "未受格式化的錯誤訊息。"
711711

712712
#: ../../library/json.rst:530
713713
msgid "The JSON document being parsed."
@@ -727,7 +727,7 @@ msgstr "*pos* 所在的列(column)數。"
727727

728728
#: ../../library/json.rst:548
729729
msgid "Standard Compliance and Interoperability"
730-
msgstr "標準守則與互通性"
730+
msgstr "合規性與互通性"
731731

732732
#: ../../library/json.rst:550
733733
msgid ""
@@ -737,47 +737,59 @@ msgid ""
737737
"simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and "
738738
"parameters other than those explicitly mentioned, are not considered."
739739
msgstr ""
740+
"JSON 格式是由 :rfc:`7159` 和 `ECMA-404 <https://www.ecma-international.org/"
741+
"publications-and-standards/standards/ecma-404/>` 規範的。本節詳細說明了本模組"
742+
"對 RFC 的遵循程度。簡單起見,:class:`JSONEncoder` 和 :class:`JSONDecoder` 子"
743+
"類別以及未明確提及的參數將不予考慮。"
740744

741745
#: ../../library/json.rst:556
742746
msgid ""
743747
"This module does not comply with the RFC in a strict fashion, implementing "
744748
"some extensions that are valid JavaScript but not valid JSON. In particular:"
745749
msgstr ""
750+
"這個模組的部份實作並未非常嚴格地遵循 RFC 規範。準確來說,下列實際實作符合 "
751+
"JavaScript 語法格式,但並不符合 JSON 格式:"
746752

747753
#: ../../library/json.rst:559
748754
msgid "Infinite and NaN number values are accepted and output;"
749-
msgstr ""
755+
msgstr "無限(Infinite)和非數字(NaN)值會被接受。"
750756

751757
#: ../../library/json.rst:560
752758
msgid ""
753759
"Repeated names within an object are accepted, and only the value of the last "
754760
"name-value pair is used."
755-
msgstr ""
761+
msgstr "同一個物件內可以有重複的名稱,但只有最後一個同名物件是有效的。"
756762

757763
#: ../../library/json.rst:563
758764
msgid ""
759765
"Since the RFC permits RFC-compliant parsers to accept input texts that are "
760766
"not RFC-compliant, this module's deserializer is technically RFC-compliant "
761767
"under default settings."
762768
msgstr ""
769+
"不過 RFC 准許遵循 RFC 的剖析器接受不合規的文字輸入,所以技術上來說若以預設設"
770+
"定運作,本模組的去串列化器是符合 RFC 規範的。"
763771

764772
#: ../../library/json.rst:568
765773
msgid "Character Encodings"
766-
msgstr ""
774+
msgstr "字元編碼格式"
767775

768776
#: ../../library/json.rst:570
769777
msgid ""
770778
"The RFC requires that JSON be represented using either UTF-8, UTF-16, or "
771779
"UTF-32, with UTF-8 being the recommended default for maximum "
772780
"interoperability."
773781
msgstr ""
782+
"RFC 規定要求 JSON 必須以 UTF-8、UTF-16 或 UTF-32 格式編碼。並推薦以 UTF-8 編"
783+
"碼以達成最良好的互通性。"
774784

775785
#: ../../library/json.rst:573
776786
msgid ""
777787
"As permitted, though not required, by the RFC, this module's serializer sets "
778788
"*ensure_ascii=True* by default, thus escaping the output so that the "
779789
"resulting strings only contain ASCII characters."
780790
msgstr ""
791+
"RFC 准許但並不要求編碼器的 *ensure_ascii=True* 是預設值,但本模組依然實作了此"
792+
"一選項作為預設,因此本模組會轉義所有非 ASCII 字元。"
781793

782794
#: ../../library/json.rst:577
783795
msgid ""
@@ -786,6 +798,8 @@ msgid ""
786798
"<str>`, and thus does not otherwise directly address the issue of character "
787799
"encodings."
788800
msgstr ""
801+
"除了 *ensure_ascii* 選項之外,本模組嚴格遵循 Python 物件與 :class:`Unicode "
802+
"strings <str>` 之間的轉換規範,因此並不另外處理字元編碼的問題。"
789803

790804
#: ../../library/json.rst:582
791805
msgid ""
@@ -795,6 +809,10 @@ msgid ""
795809
"in their input. This module's deserializer raises a :exc:`ValueError` when "
796810
"an initial BOM is present."
797811
msgstr ""
812+
"RFC 禁止在文件的開頭加上端序記號(BOM),因此本模組的串列化器(serializer)也"
813+
"不會在輸出中加入端序記號。RFC 允許但不強制 JSON 去串列化器(deserializer)忽"
814+
"略文件初始的端序記號,因此本模組的去串列化器將在遭遇端序記號時引發 :exc:"
815+
"`ValueError` 例外。"
798816

799817
#: ../../library/json.rst:588
800818
msgid ""

0 commit comments

Comments
 (0)