Skip to content

Commit 9c4d3ac

Browse files
committed
editing json.po, up to line 731.
1 parent 4bd577d commit 9c4d3ac

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

library/json.po

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -623,10 +623,9 @@ msgid ""
623623
"trying to encode keys that are not :class:`str`, :class:`int`, :class:"
624624
"`float` or ``None``. If *skipkeys* is true, such items are simply skipped."
625625
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,這些項目將直接被跳過。"
630629

631630
#: ../../library/json.rst:437
632631
msgid ""
@@ -635,10 +634,9 @@ msgid ""
635634
"prevent an infinite recursion (which would cause a :exc:`RecursionError`). "
636635
"Otherwise, no such check takes place."
637636
msgstr ""
638-
"如果 *check_circular* 為 true(預設值),則會在編碼期間檢查列表(list)、字典(dict)"
639-
"和自定義編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:`RecursionError` 例外的問題)。"
640-
"否則不會進行此類檢查。"
641-
637+
"如果 *check_circular* 為 true(預設值),則會在編碼期間檢查列表(list)、字典"
638+
"(dict)和自定義編碼物件的循環參照,以防止無限遞迴(一個會導致 :exc:"
639+
"`RecursionError` 例外的問題)。否則不會進行此類檢查。"
642640

643641
#: ../../library/json.rst:442
644642
msgid ""
@@ -647,77 +645,89 @@ msgid ""
647645
"compliant, but is consistent with most JavaScript based encoders and "
648646
"decoders. Otherwise, it will be a :exc:`ValueError` to encode such floats."
649647
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` 例外。"
654652

655653
#: ../../library/json.rst:448
656654
msgid ""
657655
"If *sort_keys* is true (default: ``False``), then the output of dictionaries "
658656
"will be sorted by key; this is useful for regression tests to ensure that "
659657
"JSON serializations can be compared on a day-to-day basis."
660658
msgstr ""
661-
"如果 *sort_keys* 為 true(預設值:``False``),則 dictionary(字典)的輸出將按鍵值排序。"
662-
"這項功能可確保 JSON 序列化的結果能被互相比較,能讓回歸測試的檢查變得方便。"
663-
659+
"如果 *sort_keys* 為 true(預設值:``False``),則 dictionary(字典)的輸出將"
660+
"按鍵值排序。這項功能可確保 JSON 序列化的結果能被互相比較,能讓日常的回歸測試"
661+
"檢查變得方便一些。"
664662

665663
#: ../../library/json.rst:481
666664
msgid ""
667665
"Implement this method in a subclass such that it returns a serializable "
668666
"object for *o*, or calls the base implementation (to raise a :exc:"
669667
"`TypeError`)."
670668
msgstr ""
669+
"在任意一個子類別裡實作這個方法時須讓其回傳一個可串列化的物件 *o* ,或呼叫原始"
670+
"的實作以引發 :exc:`TypeError` 例外。"
671671

672672
#: ../../library/json.rst:485
673673
msgid ""
674674
"For example, to support arbitrary iterators, you could implement :meth:"
675675
"`~JSONEncoder.default` like this::"
676676
msgstr ""
677+
"舉例來說,想要讓編碼器支援任意疊代器(iterator),你可以實作這樣子的 :meth:"
678+
"`~JSONEncoder.default`::"
677679

678680
#: ../../library/json.rst:501
679681
msgid ""
680682
"Return a JSON string representation of a Python data structure, *o*. For "
681683
"example::"
682-
msgstr ""
684+
msgstr "回傳一個 Python 資料結構物件 *o* 的 JSON 的字串表示。例如::"
683685

684686
#: ../../library/json.rst:510
685687
msgid ""
686688
"Encode the given object, *o*, and yield each string representation as "
687689
"available. For example::"
688690
msgstr ""
691+
"將物件 *o* 編碼,並將結果統整為一個能依序產生(yield)各結果字串的生成器物件"
692+
"(generator)。如下例::"
689693

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>
690700
#: ../../library/json.rst:518
691701
msgid "Exceptions"
692702
msgstr "例外"
693703

694704
#: ../../library/json.rst:522
695705
msgid "Subclass of :exc:`ValueError` with the following additional attributes:"
696-
msgstr ""
706+
msgstr ":exc:`ValueError` 的子類別具有下列額外屬性:"
697707

698708
#: ../../library/json.rst:526
699709
msgid "The unformatted error message."
700-
msgstr ""
710+
msgstr "未格式化的錯誤訊息。"
701711

702712
#: ../../library/json.rst:530
703713
msgid "The JSON document being parsed."
704-
msgstr ""
714+
msgstr "正在被剖析的 JSON 文件。"
705715

706716
#: ../../library/json.rst:534
707717
msgid "The start index of *doc* where parsing failed."
708-
msgstr ""
718+
msgstr "*doc* 剖析失敗處的起始點的索引值。"
709719

710720
#: ../../library/json.rst:538
711721
msgid "The line corresponding to *pos*."
712-
msgstr ""
722+
msgstr "*pos* 所在的行數。"
713723

714724
#: ../../library/json.rst:542
715725
msgid "The column corresponding to *pos*."
716-
msgstr ""
726+
msgstr "*pos* 所在的列(column)數。"
717727

718728
#: ../../library/json.rst:548
719729
msgid "Standard Compliance and Interoperability"
720-
msgstr ""
730+
msgstr "標準守則與互通性"
721731

722732
#: ../../library/json.rst:550
723733
msgid ""

0 commit comments

Comments
 (0)