@@ -623,10 +623,9 @@ msgid ""
623
623
"trying to encode keys that are not :class:`str`, :class:`int`, :class:"
624
624
"`float` or ``None``. If *skipkeys* is true, such items are simply skipped."
625
625
msgstr ""
626
- "若 *skipkeys* 為 false(預設值),則當在編碼不是 :class:`str`,:class:`int`,"
627
- ":class:`float` 或 ``None`` 的鍵值時,將引發 :exc:`TypeError`。如果 *skipkeys* "
628
- "為 true,這些項目將直接被跳過。"
629
-
626
+ "若 *skipkeys* 為 false(預設值),則當在編碼不是 :class:`str`,:class:"
627
+ "`int`,:class:`float` 或 ``None`` 的鍵值時,將引發 :exc:`TypeError`。如果 "
628
+ "*skipkeys* 為 true,這些項目將直接被跳過。"
630
629
631
630
#: ../../library/json.rst:437
632
631
msgid ""
@@ -635,10 +634,9 @@ msgid ""
635
634
"prevent an infinite recursion (which would cause a :exc:`RecursionError`). "
636
635
"Otherwise, no such check takes place."
637
636
msgstr ""
638
- "如果 *check_circular* 為 true(預設值),則會在編碼期間檢查列表(list)、字典(dict)"
639
- "和自定義編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:`RecursionError` 例外的問題)。"
640
- "否則不會進行此類檢查。"
641
-
637
+ "如果 *check_circular* 為 true(預設值),則會在編碼期間檢查列表(list)、字典"
638
+ "(dict)和自定義編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:"
639
+ "`RecursionError` 例外的問題)。否則不會進行此類檢查。"
642
640
643
641
#: ../../library/json.rst:442
644
642
msgid ""
@@ -647,77 +645,89 @@ msgid ""
647
645
"compliant, but is consistent with most JavaScript based encoders and "
648
646
"decoders. Otherwise, it will be a :exc:`ValueError` to encode such floats."
649
647
msgstr ""
650
- "如果 *allow_nan* 為 true(預設值),則 ``NaN``、``Infinity`` 和 ``-Infinity`` 將按 "
651
- "照原樣進行編碼 。請記得此行為不符合標準 JSON 規範,但的確與大多數基於 JavaScript 的編碼器和解 "
652
- "碼器一致 。否則若設為 false,嘗試對這些浮點數進行編碼將引發 :exc:`ValueError` 例外。 "
653
-
648
+ "如果 *allow_nan* 為 true(預設值),則 ``NaN``、``Infinity`` 和 ``-"
649
+ "Infinity`` 將按照原樣進行編碼 。請記得此行為不符合標準 JSON 規範,但的確與大多 "
650
+ "數基於 JavaScript 的編碼器和解碼器一致 。否則若設為 false,嘗試對這些浮點數進 "
651
+ "行編碼將引發 :exc:`ValueError` 例外。"
654
652
655
653
#: ../../library/json.rst:448
656
654
msgid ""
657
655
"If *sort_keys* is true (default: ``False``), then the output of dictionaries "
658
656
"will be sorted by key; this is useful for regression tests to ensure that "
659
657
"JSON serializations can be compared on a day-to-day basis."
660
658
msgstr ""
661
- "如果 *sort_keys* 為 true(預設值:``False``),則 dictionary(字典)的輸出將按鍵值排序。 "
662
- "這項功能可確保 JSON 序列化的結果能被互相比較,能讓回歸測試的檢查變得方便。 "
663
-
659
+ "如果 *sort_keys* 為 true(預設值:``False``),則 dictionary(字典)的輸出將 "
660
+ "按鍵值排序。 這項功能可確保 JSON 序列化的結果能被互相比較,能讓日常的回歸測試 "
661
+ "檢查變得方便一些。"
664
662
665
663
#: ../../library/json.rst:481
666
664
msgid ""
667
665
"Implement this method in a subclass such that it returns a serializable "
668
666
"object for *o*, or calls the base implementation (to raise a :exc:"
669
667
"`TypeError`)."
670
668
msgstr ""
669
+ "在任意一個子類別裡實作這個方法時須讓其回傳一個可串列化的物件 *o* ,或呼叫原始"
670
+ "的實作以引發 :exc:`TypeError` 例外。"
671
671
672
672
#: ../../library/json.rst:485
673
673
msgid ""
674
674
"For example, to support arbitrary iterators, you could implement :meth:"
675
675
"`~JSONEncoder.default` like this::"
676
676
msgstr ""
677
+ "舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子的 :meth:"
678
+ "`~JSONEncoder.default`::"
677
679
678
680
#: ../../library/json.rst:501
679
681
msgid ""
680
682
"Return a JSON string representation of a Python data structure, *o*. For "
681
683
"example::"
682
- msgstr ""
684
+ msgstr "回傳一個 Python 資料結構物件 *o* 的 JSON 的字串表示。例如:: "
683
685
684
686
#: ../../library/json.rst:510
685
687
msgid ""
686
688
"Encode the given object, *o*, and yield each string representation as "
687
689
"available. For example::"
688
690
msgstr ""
691
+ "將物件 *o* 編碼,並將結果統整為一個能依序產生(yield)各結果字串的生成器物件"
692
+ "(generator)。如下例::"
689
693
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>
690
700
#: ../../library/json.rst:518
691
701
msgid "Exceptions"
692
702
msgstr "例外"
693
703
694
704
#: ../../library/json.rst:522
695
705
msgid "Subclass of :exc:`ValueError` with the following additional attributes:"
696
- msgstr ""
706
+ msgstr ":exc:`ValueError` 的子類別具有下列額外屬性: "
697
707
698
708
#: ../../library/json.rst:526
699
709
msgid "The unformatted error message."
700
- msgstr ""
710
+ msgstr "未格式化的錯誤訊息。 "
701
711
702
712
#: ../../library/json.rst:530
703
713
msgid "The JSON document being parsed."
704
- msgstr ""
714
+ msgstr "正在被剖析的 JSON 文件。 "
705
715
706
716
#: ../../library/json.rst:534
707
717
msgid "The start index of *doc* where parsing failed."
708
- msgstr ""
718
+ msgstr "*doc* 剖析失敗處的起始點的索引值。 "
709
719
710
720
#: ../../library/json.rst:538
711
721
msgid "The line corresponding to *pos*."
712
- msgstr ""
722
+ msgstr "*pos* 所在的行數。 "
713
723
714
724
#: ../../library/json.rst:542
715
725
msgid "The column corresponding to *pos*."
716
- msgstr ""
726
+ msgstr "*pos* 所在的列(column)數。 "
717
727
718
728
#: ../../library/json.rst:548
719
729
msgid "Standard Compliance and Interoperability"
720
- msgstr ""
730
+ msgstr "標準守則與互通性 "
721
731
722
732
#: ../../library/json.rst:550
723
733
msgid ""
0 commit comments