Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b87ff2c

Browse files
committed
docs(library/pickle.po): editing, up to line 778
1 parent 8fd17f0 commit b87ff2c

File tree

1 file changed

+65
-13
lines changed

1 file changed

+65
-13
lines changed

library/pickle.po

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ msgstr ""
194194
"JSON 具有高互通性(interoperability)且在 Python 以外的環境也被大量利用,但 "
195195
"pickle 只能在 Python 內使用。"
196196

197-
# Skylull: introspection, introspection facilities
197+
# Skylull: [t]
198+
# introspection -> 自省
199+
# introspection facilities -> 自省措施
198200
# https://zh.wikipedia.org/wiki/%E5%86%85%E7%9C%81_(%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6)
199201
# https://book.pythontips.com/en/latest/object_introspection.html
200202
# https://www.geeksforgeeks.org/code-introspection-in-python/
@@ -207,7 +209,7 @@ msgid ""
207209
"`specific object APIs <pickle-inst>`);"
208210
msgstr ""
209211
"預設狀態下的 JSON 只能紀錄一小部份的 Python 內建型別,且無法紀錄自訂類別;但"
210-
"透過 Python 的自省功能,pickle 可以紀錄絕大多數的 Python 型別(其他比較複雜的"
212+
"透過 Python 的自省措施,pickle 可以紀錄絕大多數的 Python 型別(其他比較複雜的"
211213
"狀況也可以透過實作 :ref:`specific object APIs <pickle-inst>` 來解決);"
212214

213215
#: ../../library/pickle.rst:110
@@ -321,6 +323,13 @@ msgstr ""
321323
"版本 5 的協定在 Python 3.8 被新增。現在能支援帶外資料(Out-of-band data)並加"
322324
"速帶內資料的處理速度。請參閱 :pep:`574` 以了解第 5 版協定改進的細節。"
323325

326+
# SkyLull: [t]
327+
# persistent -> 持久
328+
# data persistent -> 資料持久化
329+
# https://zh.wikipedia.org/zh-
330+
# tw/%E5%8F%AF%E6%8C%81%E4%B9%85%E5%8C%96%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84
331+
# https://1fly2sky.wordpress.com/2016/04/05/%E6%8C%81%E4%B9%85%E5%B1%A4data-
332+
# persistence-layer/
324333
#: ../../library/pickle.rst:168
325334
msgid ""
326335
"Serialization is a more primitive notion than persistence; although :mod:"
@@ -354,7 +363,7 @@ msgid ""
354363
"de-serialization, you can create a :class:`Pickler` or an :class:`Unpickler` "
355364
"object, respectively."
356365
msgstr ""
357-
"想要序列化一個物件,你只需要呼叫 :func:`dumps` 函數。而當你想要去序列化一個資"
366+
"想要序列化一個物件,你只需要呼叫 :func:`dumps` 函式。而當你想要去序列化一個資"
358367
"料流時,你只需要呼叫 :func:`loads` 即可。不過,若你希望能各自對序列化和去序列"
359368
"化的過程中有更多的掌控度,你可以自訂一個 :class:`Pickler` 或 :class:"
360369
"`Unpickler` 物件。"
@@ -370,7 +379,7 @@ msgid ""
370379
"func:`dump` and :func:`dumps` as well as the :class:`Pickler` constructor."
371380
msgstr ""
372381
"一個整數,表示可使用的最高\\ :ref:`協定版本 <pickle-protocols>`。這個值可作"
373-
"為 *protocol* 的數值傳給 :func:`dump` 和 :func:`dumps` 函數以及 :class:"
382+
"為 *protocol* 的數值傳給 :func:`dump` 和 :func:`dumps` 函式以及 :class:"
374383
"`Pickler` 建構式。"
375384

376385
#: ../../library/pickle.rst:200
@@ -396,7 +405,7 @@ msgstr "預設協定版本為 4。"
396405
msgid ""
397406
"The :mod:`pickle` module provides the following functions to make the "
398407
"pickling process more convenient:"
399-
msgstr ":mod:`pickle` 模組提供下列函數來簡化封裝的過程:"
408+
msgstr ":mod:`pickle` 模組提供下列函式來簡化封裝的過程:"
400409

401410
#: ../../library/pickle.rst:218
402411
msgid ""
@@ -567,7 +576,10 @@ msgstr ""
567576
"的新模組名稱轉換為 Python 2 所支援的舊名,以讓 Python 2 能正確地讀取此資料"
568577
"流。"
569578

570-
# SkyLull: 以下幾個關於 buffer_callback 的翻譯需要進一步的校對。何謂out-of-band? buffer view 應作何翻譯?
579+
# SkyLull: 以下幾個關於 buffer_callback 的翻譯需要進一步的校對。何謂out-of-band? buffer view
580+
# 應作何翻譯?
581+
# out-of-band 目前參考 https://kb.synology.com/zh-
582+
# tw/DSM/tutorial/Quick_Start_OOB_Management `帶外管理` 譯作 `帶外`
571583
#: ../../library/pickle.rst:317
572584
msgid ""
573585
"If *buffer_callback* is ``None`` (the default), buffer views are serialized "
@@ -583,8 +595,8 @@ msgid ""
583595
"``None``), the given buffer is :ref:`out-of-band <pickle-oob>`; otherwise "
584596
"the buffer is serialized in-band, i.e. inside the pickle stream."
585597
msgstr ""
586-
"如果 *buffer_callback* 不是 ``None``,則它可以被多次呼叫並傳遞一個緩衝區的視"
587-
"圖。如果回呼函數回傳一個假值(例如 ``None``),則所給的緩衝區將被視為 :ref:`"
598+
"如果 *buffer_callback* 不是 ``None``,則它可以被多次呼叫並回傳一個緩衝區的視"
599+
"圖。如果回呼函式回傳一個假值(例如 ``None``),則所給的緩衝區將被視為 :ref:`"
588600
"帶外資料 <pickle-oob>`;否則,該緩衝區將被視為 pickle 串流的帶內資料被序列"
589601
"化。"
590602

@@ -606,7 +618,7 @@ msgstr "將已封裝(pickled)的 *obj* 寫入已在建構式中開啟的對
606618
msgid "Do nothing by default. This exists so a subclass can override it."
607619
msgstr ""
608620
"預設不進行任何動作。這是一種抽象方法,用於讓後續繼承這個類別的物件可以覆寫本"
609-
"方法函數。"
621+
"方法函式。"
610622

611623
#: ../../library/pickle.rst:340
612624
msgid ""
@@ -625,6 +637,13 @@ msgstr ""
625637
msgid "See :ref:`pickle-persistent` for details and examples of uses."
626638
msgstr "關於細節與用法範例請見 :ref:`pickle-persistent`。"
627639

640+
# SkyLull: [t]
641+
# dispatch table -> 調度表
642+
# https://zh.wiktionary.org/zh-hant/dispatch_table
643+
# reduce -> 縮減
644+
# reduction function -> 縮減函式
645+
# 這個是指reduce()函式類型的運算,類似sql的aggregation類型運算,故參閱以下內文,譯為縮減
646+
# https://support.google.com/docs/answer/12657238?hl=zh-Hant
628647
#: ../../library/pickle.rst:350
629648
msgid ""
630649
"A pickler object's dispatch table is a registry of *reduction functions* of "
@@ -633,6 +652,10 @@ msgid ""
633652
"reduction function takes a single argument of the associated class and "
634653
"should conform to the same interface as a :meth:`~object.__reduce__` method."
635654
msgstr ""
655+
"封裝器(pickler)物件含有的的調度表是一個 *縮減函式* (reduction function)的"
656+
"註冊表,可以使用 :func:`copyreg.pickle` 來宣告這類縮減函式。它是一個以類別為"
657+
"鍵、還原函式為值的映射表。縮減函式應準備接收一個對應類別的引數,並應遵循與 :"
658+
"meth:`~object.__reduce__` 方法相同的介面。"
636659

637660
#: ../../library/pickle.rst:358
638661
msgid ""
@@ -644,6 +667,11 @@ msgid ""
644667
"`dispatch_table` attribute then this will be used as the default dispatch "
645668
"table for instances of that class."
646669
msgstr ""
670+
"預設情況下,封裝器(pickler)物件不會有 :attr:`dispatch_table` 屬性,而是會使"
671+
"用由 :mod:`copyreg` 模組管理的全域調度表。不過,若要自訂某個封裝器(pickler)"
672+
"物件的序列化行為,可以將 :attr:`dispatch_table` 屬性設置為類字典物件。另外,"
673+
"如果 :class:`Pickler` 的子類別具有 :attr:`dispatch_table` 屬性,那麼這個屬性"
674+
"將作為該子類別實例的預設調度表。"
647675

648676
#: ../../library/pickle.rst:367
649677
msgid "See :ref:`pickle-dispatch` for usage examples."
@@ -657,10 +685,12 @@ msgid ""
657685
"and can optionally return :data:`NotImplemented` to fallback on :attr:"
658686
"`dispatch_table`-registered reducers to pickle ``obj``."
659687
msgstr ""
688+
"傳 :data:`NotImplemented` 以退回(fallback)並改為使用 :attr:"
689+
"`dispatch_table` 中登錄的縮減方法來封裝 ``obj``。"
660690

661691
#: ../../library/pickle.rst:379
662692
msgid "For a detailed example, see :ref:`reducer_override`."
663-
msgstr ""
693+
msgstr "請查閱 :ref:`reducer_override` 來參考其他較詳細的範例。"
664694

665695
#: ../../library/pickle.rst:385
666696
msgid ""
@@ -669,20 +699,23 @@ msgid ""
669699
"superfluous PUT opcodes. It should not be used with self-referential "
670700
"objects, doing otherwise will cause :class:`Pickler` to recurse infinitely."
671701
msgstr ""
702+
"已棄用。如果設置為 true,將啟用快速模式。快速模式會停用備忘(memo),因此能透"
703+
"過不產生多餘的 PUT 操作碼(OpCode)來加速封裝過程。它不應被用於自我參照物件,"
704+
"否則將導致 :class:`Pickler` 陷入無限遞迴。"
672705

673706
#: ../../library/pickle.rst:391
674707
msgid "Use :func:`pickletools.optimize` if you need more compact pickles."
675-
msgstr ""
708+
msgstr "使用 :func:`pickletools.optimize` 以獲得更緊湊的 pickle 輸出。"
676709

677710
#: ../../library/pickle.rst:396
678711
msgid "This takes a binary file for reading a pickle data stream."
679-
msgstr ""
712+
msgstr "這個物件接受一個二進位檔案 *file* 來從中讀取 pickle 資料流。"
680713

681714
#: ../../library/pickle.rst:398
682715
msgid ""
683716
"The protocol version of the pickle is detected automatically, so no protocol "
684717
"argument is needed."
685-
msgstr ""
718+
msgstr "協定版本號會被自動偵測,所以不需要在這邊手動輸入。"
686719

687720
#: ../../library/pickle.rst:401
688721
msgid ""
@@ -693,6 +726,10 @@ msgid ""
693726
"binary reading, an :class:`io.BytesIO` object, or any other custom object "
694727
"that meets this interface."
695728
msgstr ""
729+
"參數 *file* 必須擁有三個方法,分別是接受整數作為引數的 read() 方法、接受緩衝"
730+
"區作為引數的 readinto() 方法以及不需要引數的 readline() 方法,如同在 :class:"
731+
"`io.BufferedIOBase` 的介面一樣。因此,*file* 可以是一個以二進位讀取模式開啟的"
732+
"檔案、一個 :class:`io.BytesIO` 物件、或任何符合此介面的自訂物件。"
696733

697734
#: ../../library/pickle.rst:408
698735
msgid ""
@@ -707,6 +744,14 @@ msgid ""
707744
"datetime`, :class:`~datetime.date` and :class:`~datetime.time` pickled by "
708745
"Python 2."
709746
msgstr ""
747+
"可選引數 *fix_imports*,*encoding* 和 *errors* 用來控制 Python 2 pickle 資料"
748+
"的相容性支援。如果 *fix_imports* 為 true,則 pickle 模組會嘗試將舊的 Python "
749+
"2 模組名稱映射到 Python 3 中使用的新名稱。*encoding* 和 *errors* 告訴 pickle "
750+
"模組如何解碼由 Python 2 pickle 封裝的 8 位元字串實例;*encoding* 和 *errors* "
751+
"預設分別為 'ASCII' 和 'strict'。*encoding* 可以設定為 'bytes' 以將這些 8 位元"
752+
"字串實例讀為位元組物件。而由 Python 2 封裝的 NumPy 陣列、:class:`~datetime."
753+
"datetime`、:class:`~datetime.date` 和 :class:`~datetime.time` 的實例則必須使"
754+
"用 ``encoding='latin1'`` 來拆封。"
710755

711756
#: ../../library/pickle.rst:419
712757
msgid ""
@@ -715,6 +760,9 @@ msgid ""
715760
"*buffer_callback* argument was ``None`` when a :class:`Pickler` was "
716761
"instantiated (or when :func:`dump` or :func:`dumps` was called)."
717762
msgstr ""
763+
"如果 *buffers* 是 ``None``(預設值),那麼去序列化所需的所有資料都必須已經包"
764+
"含在 pickle 串流中。這意味著當初在建立對應的 :class:`Pickler` 時(或在呼叫 :"
765+
"func:`dump` 或 :func:`dumps` 時)*buffer_callback* 引數必須為 ``None``。"
718766

719767
#: ../../library/pickle.rst:424
720768
msgid ""
@@ -723,6 +771,10 @@ msgid ""
723771
"of-band <pickle-oob>` buffer view. Such buffers have been given in order to "
724772
"the *buffer_callback* of a Pickler object."
725773
msgstr ""
774+
"如果 *buffers* 不是 ``None``,則其應該是一個可疊代物件,內含數個支援緩衝區的"
775+
"物件,並且每當 pickle 串流引用一個 :ref:`帶外 <pickle-oob>` 緩衝區視圖時將會"
776+
"被照順序消耗。這些緩衝資料當初建立時應已按照順序給定予 Pickler 物件中的 "
777+
"*buffer_callback*。"
726778

727779
#: ../../library/pickle.rst:434
728780
msgid ""

0 commit comments

Comments
 (0)