@@ -256,7 +256,8 @@ msgstr ""
256
256
"重複呼叫 :func:`dump` 來串列化多個物件到同一個 *fp* 裡將導致無效的 JSON 檔"
257
257
"案。"
258
258
259
- # SkyLull: 我想這裡的 "framed protocol" 指的是 https://peps.python.org/pep-3154/#framing
259
+ # SkyLull: 我想這裡的 "framed protocol" 指的是
260
+ # https://peps.python.org/pep-3154/#framing
260
261
#: ../../library/json.rst:212
261
262
msgid ""
262
263
"Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion "
@@ -474,7 +475,7 @@ msgstr "int"
474
475
475
476
#: ../../library/json.rst:325
476
477
msgid "number (real)"
477
- msgstr ""
478
+ msgstr "number (實數) "
478
479
479
480
#: ../../library/json.rst:325
480
481
msgid "float"
@@ -779,17 +780,17 @@ msgid ""
779
780
"UTF-32, with UTF-8 being the recommended default for maximum "
780
781
"interoperability."
781
782
msgstr ""
782
- "RFC 要求 JSON 必須以 UTF-8、UTF-16 或 UTF-32 格式編碼。並推薦以 UTF-8 編 "
783
- "碼以達成最佳的互通性 。"
783
+ "RFC 要求 JSON 必須以 UTF-8、UTF-16 或 UTF-32 格式編碼。並推薦以 UTF-8 編碼以 "
784
+ "達成最佳的互通性 。"
784
785
785
786
#: ../../library/json.rst:573
786
787
msgid ""
787
788
"As permitted, though not required, by the RFC, this module's serializer sets "
788
789
"*ensure_ascii=True* by default, thus escaping the output so that the "
789
790
"resulting strings only contain ASCII characters."
790
791
msgstr ""
791
- "RFC 准許但並不強制編碼器的 *ensure_ascii=True* 行為是預設值,但本模組依然實作了此 "
792
- "一選項作為預設 ,因此本模組預設會轉義所有非 ASCII 字元。"
792
+ "RFC 准許但並不強制編碼器的 *ensure_ascii=True* 行為是預設值,但本模組依然實作 "
793
+ "了此一選項作為預設 ,因此本模組預設會轉義所有非 ASCII 字元。"
793
794
794
795
#: ../../library/json.rst:577
795
796
msgid ""
@@ -811,8 +812,8 @@ msgid ""
811
812
msgstr ""
812
813
"RFC 禁止在文件的開頭加上端序記號(BOM),因此本模組的串列化器(serializer)也"
813
814
"不會在輸出中加入端序記號。RFC 允許但不強制 JSON 去串列化器(deserializer)忽"
814
- "略文件初始的端序記號,因此本模組的去串列化器將在遭遇位於文件開頭的端序記號時引發 :exc: "
815
- "`ValueError` 例外。"
815
+ "略文件初始的端序記號,因此本模組的去串列化器將在遭遇位於文件開頭的端序記號時 "
816
+ "引發 :exc: `ValueError` 例外。"
816
817
817
818
#: ../../library/json.rst:588
818
819
msgid ""
@@ -822,9 +823,10 @@ msgid ""
822
823
"By default, this module accepts and outputs (when present in the original :"
823
824
"class:`str`) code points for such sequences."
824
825
msgstr ""
825
- "RFC 並未明確禁止 JSON 文件包含無法對應有效 Unicode 字元的位元組序列(例如未配對的 UTF-16 代理對(surrogate "
826
- "pairs)),但這個特性的確可能會引起相容性問題。預設情況下,當原始輸入的 :class:`str` "
827
- "中存在此類序列時,該模組將接受並輸出這些序列的編碼位置(code points)。"
826
+ "RFC 並未明確禁止 JSON 文件包含無法對應有效 Unicode 字元的位元組序列(例如未配"
827
+ "對的 UTF-16 代理對(surrogate pairs)),但這個特性的確可能會引起相容性問題。"
828
+ "預設情況下,當原始輸入的 :class:`str` 中存在此類序列時,該模組將接受並輸出這"
829
+ "些序列的編碼位置(code points)。"
828
830
829
831
#: ../../library/json.rst:596
830
832
msgid "Infinite and NaN Number Values"
@@ -836,17 +838,21 @@ msgid ""
836
838
"Despite that, by default, this module accepts and outputs ``Infinity``, ``-"
837
839
"Infinity``, and ``NaN`` as if they were valid JSON number literal values::"
838
840
msgstr ""
841
+ "RFC 不允許表現無限大或非數值(NaN)。但預設情況下,這個模組仍接受並輸出 "
842
+ "``Infinity``、``-Infinity`` 和 ``NaN``,如同它們是有效的 JSON 數值字面值: ::"
839
843
840
844
#: ../../library/json.rst:613
841
845
msgid ""
842
846
"In the serializer, the *allow_nan* parameter can be used to alter this "
843
847
"behavior. In the deserializer, the *parse_constant* parameter can be used "
844
848
"to alter this behavior."
845
849
msgstr ""
850
+ "在串列化器中,*allow_nan* 參數可以改變這個行為。在去串列化器中,"
851
+ "*parse_constant* 參數可以改變這個行為。"
846
852
847
853
#: ../../library/json.rst:619
848
854
msgid "Repeated Names Within an Object"
849
- msgstr ""
855
+ msgstr "物件內重複的鍵值名稱 "
850
856
851
857
#: ../../library/json.rst:621
852
858
msgid ""
@@ -855,14 +861,17 @@ msgid ""
855
861
"default, this module does not raise an exception; instead, it ignores all "
856
862
"but the last name-value pair for a given name::"
857
863
msgstr ""
864
+ "RFC 規範僅表明 JSON 物件中的名字應該是唯一的,但沒有強制要求如何處理重複的名"
865
+ "字。預設情況下,這個模組不會引發例外;相反的,它會忽略該名字的所有重複鍵值"
866
+ "對,只保留最後一個: ::"
858
867
859
868
#: ../../library/json.rst:630
860
869
msgid "The *object_pairs_hook* parameter can be used to alter this behavior."
861
- msgstr "*object_parts_hook* 參數可以被使用來改變此行為 。"
870
+ msgstr "*object_parts_hook* 參數可以改變這個行為 。"
862
871
863
872
#: ../../library/json.rst:634
864
873
msgid "Top-level Non-Object, Non-Array Values"
865
- msgstr ""
874
+ msgstr "位於頂層的非物件及非列表值 "
866
875
867
876
#: ../../library/json.rst:636
868
877
msgid ""
@@ -873,42 +882,48 @@ msgid ""
873
882
"this module does not and has never implemented that restriction in either "
874
883
"its serializer or its deserializer."
875
884
msgstr ""
885
+ "由已廢棄的 :rfc:`4627` 規範的舊版 JSON 要求 JSON 文字的頂層值必須是 JSON 物件"
886
+ "或陣列(Python :class:`dict` 或 :class:`list`),而且不能是 JSON 的 null、"
887
+ "boolean、數字或字串值。 :rfc:`7159` 移除了這個限制,而此模組在其串列化器或去"
888
+ "串列化器中也未曾實施過該限制。"
876
889
877
890
#: ../../library/json.rst:643
878
891
msgid ""
879
892
"Regardless, for maximum interoperability, you may wish to voluntarily adhere "
880
893
"to the restriction yourself."
881
- msgstr ""
894
+ msgstr "如果想要最大限度地保留互通性,你可能還是會想要自行施加這個限制。 "
882
895
883
896
#: ../../library/json.rst:648
884
897
msgid "Implementation Limitations"
885
- msgstr ""
898
+ msgstr "實作限制 "
886
899
887
900
#: ../../library/json.rst:650
888
901
msgid "Some JSON deserializer implementations may set limits on:"
889
- msgstr ""
902
+ msgstr "某些 JSON 去串列化器的實作可能會造成下列限制: "
890
903
891
904
#: ../../library/json.rst:652
892
905
msgid "the size of accepted JSON texts"
893
- msgstr ""
906
+ msgstr "JSON 文件長度上限 "
894
907
895
908
#: ../../library/json.rst:653
896
909
msgid "the maximum level of nesting of JSON objects and arrays"
897
- msgstr ""
910
+ msgstr "JSON 物件或陣列的最大巢狀層數(level of nesting)限制 "
898
911
899
912
#: ../../library/json.rst:654
900
913
msgid "the range and precision of JSON numbers"
901
- msgstr ""
914
+ msgstr "數字的精準度或範圍 "
902
915
903
916
#: ../../library/json.rst:655
904
917
msgid "the content and maximum length of JSON strings"
905
- msgstr ""
918
+ msgstr "JSON 字串長度上限 "
906
919
907
920
#: ../../library/json.rst:657
908
921
msgid ""
909
922
"This module does not impose any such limits beyond those of the relevant "
910
923
"Python datatypes themselves or the Python interpreter itself."
911
924
msgstr ""
925
+ "這個模組本身不會設定任何此類限制,除了 Python 資料型態本身或 Python 直譯器本"
926
+ "身的限制。"
912
927
913
928
#: ../../library/json.rst:660
914
929
msgid ""
@@ -920,6 +935,10 @@ msgid ""
920
935
"magnitude, or when serializing instances of \" exotic\" numerical types such "
921
936
"as :class:`decimal.Decimal`."
922
937
msgstr ""
938
+ "串列化為 JSON 時,要注意可能會使用該 JSON 的應用程式中的相關限制。特別要注意"
939
+ "的是,JSON 數字常會被去串列化為 IEEE 754 雙精度浮點數(double),並因而受到其"
940
+ "表示範圍和精度限制的影響。這在序列化極大的 Python :class:`int` 數值、或是序列"
941
+ "化特殊數字型別(例如 :class:`decimal.Decimal`)實例時尤其重要。"
923
942
924
943
#: ../../library/json.rst:673
925
944
msgid "Command Line Interface"
@@ -934,58 +953,65 @@ msgid ""
934
953
"The :mod:`json.tool` module provides a simple command line interface to "
935
954
"validate and pretty-print JSON objects."
936
955
msgstr ""
956
+ ":mod:`json.tool` 模組提供了一個簡易的命令列界面以供校驗與美化呈現 JSON 物件。"
937
957
938
958
#: ../../library/json.rst:685
939
959
msgid ""
940
960
"If the optional ``infile`` and ``outfile`` arguments are not specified, :"
941
961
"data:`sys.stdin` and :data:`sys.stdout` will be used respectively:"
942
962
msgstr ""
963
+ "如果沒有指定可選參數 ``infile`` 和 ``outfile`` ,則 :data:`sys.stdin` 和 :"
964
+ "data:`sys.stdout` 各自為預設值。"
943
965
944
966
#: ../../library/json.rst:697
945
967
msgid ""
946
968
"The output is now in the same order as the input. Use the :option:`--sort-"
947
969
"keys` option to sort the output of dictionaries alphabetically by key."
948
970
msgstr ""
971
+ "現在開始輸出和輸入的資料順序會是相同的。傳入 :option:`--sort-keys` 參數以按照"
972
+ "鍵值的字母順序對輸出進行排序。"
949
973
950
974
#: ../../library/json.rst:704
951
975
msgid "Command line options"
952
976
msgstr "命令列選項"
953
977
954
978
#: ../../library/json.rst:708
955
979
msgid "The JSON file to be validated or pretty-printed:"
956
- msgstr ""
980
+ msgstr "被用於校驗或美化呈現的 JSON 文件: "
957
981
958
982
#: ../../library/json.rst:724
959
983
msgid "If *infile* is not specified, read from :data:`sys.stdin`."
960
- msgstr ""
984
+ msgstr "如果沒有指定 *infile* 則會從 :data:`sys.stdin` 讀取輸入。 "
961
985
962
986
#: ../../library/json.rst:728
963
987
msgid ""
964
988
"Write the output of the *infile* to the given *outfile*. Otherwise, write it "
965
989
"to :data:`sys.stdout`."
966
990
msgstr ""
991
+ "將 *infile* 的結果寫入到給定的 *outfile*。若未提供則寫入到:data:`sys."
992
+ "stdout`。"
967
993
968
994
#: ../../library/json.rst:733
969
995
msgid "Sort the output of dictionaries alphabetically by key."
970
- msgstr ""
996
+ msgstr "按照鍵值的字母順序對輸出字典進行排序。 "
971
997
972
998
#: ../../library/json.rst:739
973
999
msgid ""
974
1000
"Disable escaping of non-ascii characters, see :func:`json.dumps` for more "
975
1001
"information."
976
- msgstr ""
1002
+ msgstr "關閉非 ASCII 字元的自動轉義功能。詳情請參照 :func:`json.dumps`。 "
977
1003
978
1004
#: ../../library/json.rst:745
979
1005
msgid "Parse every input line as separate JSON object."
980
- msgstr ""
1006
+ msgstr "將每一行輸入都單獨輸出為一個 JSON 物件。 "
981
1007
982
1008
#: ../../library/json.rst:751
983
1009
msgid "Mutually exclusive options for whitespace control."
984
- msgstr ""
1010
+ msgstr "互斥的空白字元控制選項。 "
985
1011
986
1012
#: ../../library/json.rst:757
987
1013
msgid "Show the help message."
988
- msgstr ""
1014
+ msgstr "顯示說明訊息。 "
989
1015
990
1016
#: ../../library/json.rst:761
991
1017
msgid "Footnotes"
@@ -998,3 +1024,7 @@ msgid ""
998
1024
"and U+2029 (PARAGRAPH SEPARATOR) characters in strings, whereas JavaScript "
999
1025
"(as of ECMAScript Edition 5.1) does not."
1000
1026
msgstr ""
1027
+ "如 `RFC 7159 更正 <https://www.rfc-editor.org/errata_search.php?rfc=7159>`_ "
1028
+ "所述,JSON 允許字串中出現 U+2028(行分隔符)和 U+2029(段落分隔符)字元,而 "
1029
+ "JavaScript(截至 ECMAScript 5.1 版)則不允許。\n"
1030
+ "`"
0 commit comments