Skip to content

Commit dad1898

Browse files
committed
docs(library/json.po): Completly translated and refined
closes #942
1 parent 9d0513c commit dad1898

File tree

1 file changed

+65
-66
lines changed

1 file changed

+65
-66
lines changed

library/json.po

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ msgstr "自訂特殊的 JSON 解碼方式: ::"
8484

8585
#: ../../library/json.rst:90
8686
msgid "Extending :class:`JSONEncoder`::"
87-
msgstr " :class:`JSONEncoder` 裡自行擴充額外的編碼方法: ::"
87+
msgstr "繼承 :class:`JSONEncoder` 類別並自行擴充額外的編碼方法: ::"
8888

8989
#: ../../library/json.rst:108
9090
msgid "Using :mod:`json.tool` from the shell to validate and pretty-print:"
91-
msgstr "在命令列介面裡使用 :mod:`json.tool` 來驗證 JSON 語法和美化"
91+
msgstr "在命令列介面裡使用 :mod:`json.tool` 來驗證 JSON 語法和美化呈現方式:"
9292

9393
#: ../../library/json.rst:119
9494
msgid "See :ref:`json-commandline` for detailed documentation."
@@ -112,7 +112,7 @@ msgid ""
112112
"default. Order is only lost if the underlying containers are unordered."
113113
msgstr ""
114114
"這個模組的編、解碼器預設會保存輸入與輸出資料的順序關係,除非一開始的輸入本身"
115-
"就是無序的。(例如集合 :class:`set`)"
115+
"就是無序的。(例如集合)"
116116

117117
#: ../../library/json.rst:135
118118
msgid "Basic Usage"
@@ -136,15 +136,15 @@ msgid ""
136136
msgstr ""
137137
"如果 *skipkeys* 被設為 true(預設值:``False``),那麼非基本型別(:class:"
138138
"`str`,:class:`int`,:class:`float`,:class:`bool`,``None``)的 dictionary"
139-
"(字典)鍵值將被略過,而不會引發 :exc:`TypeError`。"
139+
"(字典)鍵值將被略過而不會引發 :exc:`TypeError`。"
140140

141141
#: ../../library/json.rst:150
142142
msgid ""
143143
"The :mod:`json` module always produces :class:`str` objects, not :class:"
144144
"`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` input."
145145
msgstr ""
146146
":mod:`json` 模組總是產生 :class:`str` 物件,而非 :class:`bytes` 物件。因此,"
147-
"``fp.write()`` 必須支援 :class:`str` 的輸入。"
147+
"``fp.write()`` 必須支援 :class:`str` 輸入。"
148148

149149
#: ../../library/json.rst:154 ../../library/json.rst:433
150150
msgid ""
@@ -162,7 +162,7 @@ msgid ""
162162
"will result in a :exc:`RecursionError` (or worse)."
163163
msgstr ""
164164
"如果 *check_circular* 設為 false(預設是 ``True``),則針對不同容器型別的循環"
165-
"參照 (circular reference) 的檢查將會被跳過,若有循環參照則最後將引發 :exc:"
165+
"參照 (circular reference) 檢查將會被跳過,若有循環參照則最後將引發 :exc:"
166166
"`RecursionError` (或其他更糟的錯誤)。"
167167

168168
#: ../../library/json.rst:162
@@ -173,9 +173,9 @@ msgid ""
173173
"*allow_nan* is true, their JavaScript equivalents (``NaN``, ``Infinity``, ``-"
174174
"Infinity``) will be used."
175175
msgstr ""
176-
"如果 *allow_nan* 為 false(預設值:``True``\\ ),則串列化超出嚴格 JSON 規範"
177-
"之範圍的 :class:`float` 值 (``nan``, ``inf``, ``-inf``) 會引發 :exc:"
178-
"`ValueError`。如果 *allow_nan* 為 true,則將使用它們的 JavaScript 等效項 "
176+
"如果 *allow_nan* 為 false(預設值:``True``\\ ),則串列化不符合嚴格 JSON "
177+
"範的 :class:`float` 值 (``nan``, ``inf``, ``-inf``) 會引發 :exc:"
178+
"`ValueError`。如果 *allow_nan* 為 true,則將使用它們的 JavaScript 等效表示 "
179179
"(``NaN``, ``Infinity``, ``-Infinity``)。"
180180

181181
#: ../../library/json.rst:168 ../../library/json.rst:452
@@ -188,9 +188,9 @@ msgid ""
188188
"``\"\\t\"``), that string is used to indent each level."
189189
msgstr ""
190190
"如果 *indent* 是非負整數或字串,則 JSON 陣列元素和物件成員將使用該縮排等級進"
191-
"行漂亮列印。縮排等級 0、負數或 ``\"\"`` 只會插入換行符號。``None``\\ (預設"
192-
"值)選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。如果 "
193-
"*indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。"
191+
"行格式美化。縮排等級 0、負數或 ``\"\"`` 只會插入換行符號。``None``\\ (預設"
192+
"值)等於是選擇最緊湊的表示法。使用正整數縮排可以在每層縮排數量相同的空格。"
193+
"*indent* 是一個字串(例如 ``\"\\t\"``\\ ),則該字串用於縮排每個層級。"
194194

195195
#: ../../library/json.rst:175 ../../library/json.rst:459
196196
msgid "Allow strings for *indent* in addition to integers."
@@ -204,13 +204,13 @@ msgid ""
204204
"specify ``(',', ':')`` to eliminate whitespace."
205205
msgstr ""
206206
"如果有指定本參數,*separators* 應該是一個 ``(item_separator, "
207-
"key_separator)`` 元組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': ')``,"
208-
"否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你應該指定 "
209-
"``(',', ':')`` 來消除空格。"
207+
"key_separator)`` 二元組。如果 *indent* 為 ``None`` 則預設為 ``(', ', ': "
208+
"')``,否則預設為 ``(',', ': ')``。想要獲得最緊湊的 JSON 表示形式,你可以改成"
209+
"指定 ``(',', ':')`` 來消除尾隨的空格。"
210210

211211
#: ../../library/json.rst:183 ../../library/json.rst:467
212212
msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``."
213-
msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 當預設值"
213+
msgstr "如果 *indent* 不是 ``None``,則使用 ``(',', ': ')`` 作為預設值"
214214

215215
#: ../../library/json.rst:186 ../../library/json.rst:470
216216
msgid ""
@@ -219,45 +219,45 @@ msgid ""
219219
"version of the object or raise a :exc:`TypeError`. If not specified, :exc:"
220220
"`TypeError` is raised."
221221
msgstr ""
222-
"如果有指定本參數,*default* 應該是一個為無法串列化的物件呼叫的函式。它應該傳"
223-
"回物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會引發 :exc:"
224-
"`TypeError`。"
222+
"如果有指定本參數,*default* 會是一個遭遇無法串列化的物件時會被呼叫的函式。它"
223+
"應該傳回該物件的 JSON 可編碼版本或引發 :exc:`TypeError`。如果未指定,則會直接"
224+
"引發 :exc:`TypeError`。"
225225

226226
#: ../../library/json.rst:191
227227
msgid ""
228228
"If *sort_keys* is true (default: ``False``), then the output of dictionaries "
229229
"will be sorted by key."
230230
msgstr ""
231-
"如果 *sort_keys* 為 true(預設值:``False``),則字典的輸出將按鍵排序。"
231+
"如果 *sort_keys* 為 true(預設值:``False``),則字典的輸出將按鍵值排序。"
232232

233233
#: ../../library/json.rst:194
234234
msgid ""
235235
"To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the :"
236236
"meth:`~JSONEncoder.default` method to serialize additional types), specify "
237237
"it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used."
238238
msgstr ""
239-
"若要使用自訂 :class:`JSONEncoder` 子類別(例如覆寫 :meth:`~JSONEncoder."
240-
"default` 方法來串列化其他型別的子類別),請使用關鍵字參數 *cls* 指定它;否則"
241-
"使用 :class:`JSONEncoder`。"
239+
"若要使用繼承自 :class:`JSONEncoder` 的自訂子類別(例如覆寫 :meth:"
240+
"`~JSONEncoder.default` 方法來串列化其他型別的一個子類別物件),請使用關鍵字參"
241+
"數 *cls* 指定該類別物件;否則預設使用 :class:`JSONEncoder`。"
242242

243243
#: ../../library/json.rst:198 ../../library/json.rst:277
244244
msgid ""
245245
"All optional parameters are now :ref:`keyword-only <keyword-only_parameter>`."
246246
msgstr ""
247247
"所有可選參數現在都是\\ :ref:`僅限關鍵字 <keyword-only_parameter>`\\ 參數了。"
248248

249+
# SkyLull: 我想這裡的 "framed protocol" 指的是
250+
# https://peps.python.org/pep-3154/#framing
249251
#: ../../library/json.rst:203
250252
msgid ""
251253
"Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so "
252254
"trying to serialize multiple objects with repeated calls to :func:`dump` "
253255
"using the same *fp* will result in an invalid JSON file."
254256
msgstr ""
255-
"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 沒有二進位分框的協定,因此嘗試"
256-
"重複呼叫 :func:`dump` 來串列化多個物件到同一個 *fp* 裡將導致無效的 JSON 檔"
257-
"。"
257+
"與 :mod:`pickle` 和 :mod:`marshal` 不同,JSON 不具有二進位分框(binary "
258+
"framed)的協定,因此嘗試重複呼叫 :func:`dump` 來串列化多個物件到同一個 *fp* "
259+
"裡將導致無效的 JSON 檔案。"
258260

259-
# SkyLull: 我想這裡的 "framed protocol" 指的是
260-
# https://peps.python.org/pep-3154/#framing
261261
#: ../../library/json.rst:212
262262
msgid ""
263263
"Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion "
@@ -349,24 +349,25 @@ msgid ""
349349
"integer string via the interpreter's :ref:`integer string conversion length "
350350
"limitation <int_max_str_digits>` to help avoid denial of service attacks."
351351
msgstr ""
352-
":func:`int` 預設的 *parse_int* 現在有限制整數字串的長度上限了,限制由直譯器的"
353-
"\\ :ref:`整數字串轉換長度限制 <int_max_str_digits>`\\ 機制來達成,這能防止阻"
354-
"斷服務攻擊 (denial of service attacks)。"
352+
"預設 *parse_int* 使用的 :func:`int` 函數現在有限制整數字串的長度上限了,限制"
353+
"由直譯器的\\ :ref:`整數字串轉換長度限制 <int_max_str_digits>`\\ 機制來達成,"
354+
"這能防止阻斷服務攻擊 (Denial of Service attacks)。"
355355

356356
#: ../../library/json.rst:262 ../../library/json.rst:361
357357
msgid ""
358358
"*parse_constant*, if specified, will be called with one of the following "
359359
"strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be used to "
360360
"raise an exception if invalid JSON numbers are encountered."
361361
msgstr ""
362-
"如有給定 *parse_constant* 的話,在解碼時若遭遇以下字串 ``'-Infinity'``、"
362+
"如有給定 *parse_constant* 的話,在解碼時若遭遇字串 ``'-Infinity'``、"
363363
"``'Infinity'`` 或 ``'NaN'`` 其中之一則會改用這個參數給定的函數來進行解碼。這"
364364
"也可用於使解碼過程中遇到無效的 JSON 數字時引發一個例外。"
365365

366366
#: ../../library/json.rst:267
367367
msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore."
368368
msgstr ""
369-
"遭遇 'null'、 'true'、 'false' 時不再以 *parse_constant* 給定的函數來處理了。"
369+
"遭遇 'null'、 'true' 或 'false' 時不再以 *parse_constant* 給定的函數來處理"
370+
"了。"
370371

371372
#: ../../library/json.rst:270
372373
msgid ""
@@ -376,7 +377,7 @@ msgid ""
376377
msgstr ""
377378
"若想要使用自定義的 :class:`JSONDecoder` 子類別物件,請以 ``cls`` 關鍵字參數指"
378379
"定之,否則將使用預設的 :class:`JSONDecoder`。其他未使用到的關鍵字參數將繼續傳"
379-
"入給 :class:`JSONDecoder` 的建構函數使用。"
380+
"入給 JSONDecoder 的建構函數使用。"
380381

381382
#: ../../library/json.rst:274 ../../library/json.rst:292
382383
#: ../../library/json.rst:371
@@ -414,8 +415,8 @@ msgid ""
414415
"*s* can now be of type :class:`bytes` or :class:`bytearray`. The input "
415416
"encoding should be UTF-8, UTF-16 or UTF-32."
416417
msgstr ""
417-
"現在,*s* 可以是一個\\ :term:`二進位檔案 <binary file>`\\ ,前提是其編碼格式"
418-
" UTF-8、UTF-16 或 UTF-32。"
418+
"現在,*s* 可以是一個二進位檔案如 :class:`bytes` 或 :class:`bytearray`,前提是"
419+
"其編碼格式為 UTF-8、UTF-16 或 UTF-32。"
419420

420421
#: ../../library/json.rst:299
421422
msgid "The keyword argument *encoding* has been removed."
@@ -467,7 +468,7 @@ msgstr "str"
467468

468469
#: ../../library/json.rst:323
469470
msgid "number (int)"
470-
msgstr "number (int)"
471+
msgstr "number (整數)"
471472

472473
#: ../../library/json.rst:323
473474
msgid "int"
@@ -510,8 +511,8 @@ msgid ""
510511
"It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their "
511512
"corresponding ``float`` values, which is outside the JSON spec."
512513
msgstr ""
513-
"雖然 ``NaN``、``Infinity`` 和 ``-Infinity`` 並不符合 JSON 規範,解碼器依然能"
514-
"正確的將其對應到相應的 Python ``float`` 值。"
514+
"雖然 ``NaN``、``Infinity`` 和 ``-Infinity`` 並不符合 JSON 規範,但解碼器依然"
515+
"能正確地將其轉換到相應的 Python ``float`` 值。"
515516

516517
#: ../../library/json.rst:337
517518
msgid ""
@@ -522,8 +523,8 @@ msgid ""
522523
msgstr ""
523524
"*object_hook* 是一個可選參數,其接受一個函數作為輸入。原始的字串解碼結果(一"
524525
"個 :class:`dict`\\ )將被傳入這個函數、並使用 *object_hook* 的回傳值來取代原"
525-
"先的 :class:`dict` 輸出。此功能可用於實作自訂義解碼器(例如 `JSON-RPC "
526-
"<https://www.jsonrpc.org>`_ 類別提示)。"
526+
"先的 dict 輸出。此功能可用於實作自訂義解碼器(例如 `JSON-RPC <https://www."
527+
"jsonrpc.org>`_ 類別提示)。"
527528

528529
#: ../../library/json.rst:342
529530
msgid ""
@@ -559,8 +560,7 @@ msgid ""
559560
"Return the Python representation of *s* (a :class:`str` instance containing "
560561
"a JSON document)."
561562
msgstr ""
562-
"返回用 Python 方式表達的 *s*(一個含有 JSON 文件的 :class:`str` 實例"
563-
"(instance))"
563+
"返回用 Python 型式表達的 *s* (一個含有 JSON 文件的 :class:`str` 實例)。"
564564

565565
#: ../../library/json.rst:382
566566
msgid ""
@@ -615,8 +615,8 @@ msgid ""
615615
"superclass implementation (to raise :exc:`TypeError`)."
616616
msgstr ""
617617
"若要擴充此功能來識別其他物件,請繼承並實作一個 :meth:`~JSONEncoder.default` "
618-
"方法。此方法應回傳一個可序列化的 ``o`` 物件,否則此方法應呼叫父類別的 :meth:"
619-
"`~JSONEncoder.default` 方法(以拋出 :exc:`TypeError` 例外)。"
618+
"方法。此方法應回傳一個可序列化的 ``o`` 物件,否則此方法應呼叫父類別的 "
619+
"JSONEncoder.default 方法(以拋出 :exc:`TypeError` 例外)。"
620620

621621
#: ../../library/json.rst:429
622622
msgid ""
@@ -739,9 +739,9 @@ msgid ""
739739
"parameters other than those explicitly mentioned, are not considered."
740740
msgstr ""
741741
"JSON 格式是由 :rfc:`7159` 和 `ECMA-404 <https://www.ecma-international.org/"
742-
"publications-and-standards/standards/ecma-404/>` 規範的。本節詳細說明了本模組"
743-
" RFC 的遵循程度。簡單起見,:class:`JSONEncoder` 和 :class:`JSONDecoder` "
744-
"類別以及未明確提及的參數將不予考慮。"
742+
"publications-and-standards/standards/ecma-404/>`_ 規範的。本節詳細說明了本模"
743+
"組對 RFC 的遵循程度。簡單起見,:class:`JSONEncoder` 和 :class:`JSONDecoder` "
744+
"子類別以及未明確提及的參數將不予討論。"
745745

746746
#: ../../library/json.rst:556
747747
msgid ""
@@ -862,8 +862,8 @@ msgid ""
862862
"but the last name-value pair for a given name::"
863863
msgstr ""
864864
"RFC 規範僅表明 JSON 物件中的名字應該是唯一的,但沒有強制要求如何處理重複的名"
865-
"字。預設情況下,這個模組不會引發例外;相反的,它會忽略該名字的所有重複鍵值"
866-
"對,只保留最後一個: ::"
865+
"字。預設情況下,本模組不會因此引發例外;相反的,它會忽略該名字的所有重複鍵值"
866+
"對,並只保留最後一個: ::"
867867

868868
#: ../../library/json.rst:630
869869
msgid "The *object_pairs_hook* parameter can be used to alter this behavior."
@@ -882,10 +882,10 @@ msgid ""
882882
"this module does not and has never implemented that restriction in either "
883883
"its serializer or its deserializer."
884884
msgstr ""
885-
"由已廢棄的 :rfc:`4627` 規範的舊版 JSON 要求 JSON 文字的頂層值必須是 JSON 物件"
886-
"或陣列(Python :class:`dict` 或 :class:`list`),而且不能是 JSON 的 null、"
887-
"boolean、數字或字串值。 :rfc:`7159` 移除了這個限制,而此模組在其串列化器或去"
888-
"串列化器中也未曾實施過該限制。"
885+
"由已廢棄的 :rfc:`4627` 所規範的舊版 JSON 要求 JSON 文字的頂層值必須是 JSON "
886+
"件或陣列(Python :class:`dict` 或 :class:`list`),而且不能是 JSON 的 null、"
887+
"boolean、數字或字串值。 :rfc:`7159` 移除了這個限制,而本模組的串列化器或去串"
888+
"列化器中未曾實施過該限制。"
889889

890890
#: ../../library/json.rst:643
891891
msgid ""
@@ -922,8 +922,8 @@ msgid ""
922922
"This module does not impose any such limits beyond those of the relevant "
923923
"Python datatypes themselves or the Python interpreter itself."
924924
msgstr ""
925-
"這個模組本身不會設定任何此類限制,除了 Python 資料型態本身或 Python 直譯器本"
926-
"身的限制。"
925+
"本模組除了 Python 資料型態本身或 Python 直譯器本身的限制以外,不會設定任何此"
926+
"類限制。"
927927

928928
#: ../../library/json.rst:660
929929
msgid ""
@@ -935,10 +935,10 @@ msgid ""
935935
"magnitude, or when serializing instances of \"exotic\" numerical types such "
936936
"as :class:`decimal.Decimal`."
937937
msgstr ""
938-
"串列化為 JSON 時,要注意可能會使用該 JSON 的應用程式中的相關限制。特別要注意"
939-
"的是,JSON 數字常會被去串列化為 IEEE 754 雙精度浮點數(double),並因而受到其"
940-
"表示範圍和精度限制的影響。這在序列化極大的 Python :class:`int` 數值、或是序列"
941-
"化特殊數字型別(例如 :class:`decimal.Decimal`)實例時尤其重要。"
938+
"將資料串列化為 JSON 時,要注意可能會使用該 JSON 輸出的應用程式中的相關限制。"
939+
"特別要注意的是,JSON 數字常會被去串列化為 IEEE 754 雙精度浮點數(double),"
940+
"因而受到其表示範圍和精度限制的影響。這在序列化極大的 Python :class:`int` "
941+
"值、或是序列化特殊數字型別的實例時(例如 :class:`decimal.Decimal`)尤其重要。"
942942

943943
#: ../../library/json.rst:673
944944
msgid "Command Line Interface"
@@ -961,7 +961,7 @@ msgid ""
961961
"data:`sys.stdin` and :data:`sys.stdout` will be used respectively:"
962962
msgstr ""
963963
"如果沒有指定可選參數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` 和 :"
964-
"data:`sys.stdout` 各自為預設值。"
964+
"data:`sys.stdout` 將各自做為輸入和輸出的預設值。"
965965

966966
#: ../../library/json.rst:697
967967
msgid ""
@@ -977,7 +977,7 @@ msgstr "命令列選項"
977977

978978
#: ../../library/json.rst:708
979979
msgid "The JSON file to be validated or pretty-printed:"
980-
msgstr "被用於校驗或美化呈現的 JSON 文件:"
980+
msgstr "將被用於校驗或美化呈現的 JSON 文件:"
981981

982982
#: ../../library/json.rst:724
983983
msgid "If *infile* is not specified, read from :data:`sys.stdin`."
@@ -988,8 +988,8 @@ msgid ""
988988
"Write the output of the *infile* to the given *outfile*. Otherwise, write it "
989989
"to :data:`sys.stdout`."
990990
msgstr ""
991-
"將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入到:data:`sys."
992-
"stdout`。"
991+
"將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入到 :data:`sys."
992+
"stdout`\\ 。"
993993

994994
#: ../../library/json.rst:733
995995
msgid "Sort the output of dictionaries alphabetically by key."
@@ -1026,5 +1026,4 @@ msgid ""
10261026
msgstr ""
10271027
"如 `RFC 7159 更正 <https://www.rfc-editor.org/errata_search.php?rfc=7159>`_ "
10281028
"所述,JSON 允許字串中出現 U+2028(行分隔符)和 U+2029(段落分隔符)字元,而 "
1029-
"JavaScript(截至 ECMAScript 5.1 版)則不允許。\n"
1030-
"`"
1029+
"JavaScript(截至 ECMAScript 5.1 版)則不允許。"

0 commit comments

Comments
 (0)