From fd50907cdde3c2407614124f056dce59f09f2904 Mon Sep 17 00:00:00 2001 From: Payon Date: Wed, 31 Jan 2024 01:23:01 +0800 Subject: [PATCH 1/7] feat: to rst:2014 --- library/unittest.mock.po | 69 ++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 14 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 11966b7545..94710c69cd 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-12-16 00:03+0000\n" -"PO-Revision-Date: 2024-01-24 18:03+0800\n" +"PO-Revision-Date: 2024-01-31 01:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.4.1\n" #: ../../library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" @@ -131,8 +131,8 @@ msgid "" "above the mock for ``module.ClassName1`` is passed in first." msgstr "" "當你巢狀使用 patch 裝飾器時,mock 傳遞到被裝飾函式的順序會跟其被應用的順序相" -"同(一般 *Python* 應用裝飾器的順序)。這意味著由下而上,因此在上面的範例" -"中,``module.ClassName1`` 的 mock 會先被傳入。" +"同(一般 *Python* 應用裝飾器的順序)。這意味著由下而上,因此在上面的範例中," +"``module.ClassName1`` 的 mock 會先被傳入。" #: ../../library/unittest.mock.rst:122 msgid "" @@ -1794,6 +1794,7 @@ msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" +"你可以 patch 模組內的任何內建函式。以下範例 patch 內建函式 :func:`ord`: ::" #: ../../library/unittest.mock.rst:1844 msgid "TEST_PREFIX" @@ -1806,6 +1807,9 @@ msgid "" "that start with ``'test'`` as being test methods. This is the same way that " "the :class:`unittest.TestLoader` finds test methods by default." msgstr "" +"所有 patcher 都可以作為類別裝飾器使用。以這種方式使用時,它們包裝了類別上的每" +"個測試方法。Patcher 將 ``'test'`` 開頭的方法認定為測試方法。 這與 :class:" +"`unittest.TestLoader` 預設尋找測試方法的方式相同。" #: ../../library/unittest.mock.rst:1851 msgid "" @@ -1813,20 +1817,22 @@ msgid "" "can inform the patchers of the different prefix by setting ``patch." "TEST_PREFIX``::" msgstr "" +"你可能會想為你的測試使用不同的前綴。你可以透過設定 ``patch.TEST_PREFIX`` 來告" +"知 patcher 使用不同的前綴: ::" #: ../../library/unittest.mock.rst:1874 msgid "Nesting Patch Decorators" -msgstr "" +msgstr "巢狀使用 Patch 裝飾器" #: ../../library/unittest.mock.rst:1876 msgid "" "If you want to perform multiple patches then you can simply stack up the " "decorators." -msgstr "" +msgstr "如果你想執行多個 patch,那麼你可以簡單地堆疊裝飾器。" #: ../../library/unittest.mock.rst:1879 msgid "You can stack up multiple patch decorators using this pattern:" -msgstr "" +msgstr "你可以使用這個模式來堆疊多個 patch 裝飾器:" #: ../../library/unittest.mock.rst:1895 msgid "" @@ -1834,10 +1840,12 @@ msgid "" "standard way that Python applies decorators. The order of the created mocks " "passed into your test function matches this order." msgstr "" +"請注意,裝飾器是從底部向上應用的。這是 Python 應用裝飾器的標準方式。被建立的 " +"mock 傳遞到測試函式中的順序與此順序相同。" #: ../../library/unittest.mock.rst:1903 msgid "Where to patch" -msgstr "" +msgstr "該 patch 何處" #: ../../library/unittest.mock.rst:1905 msgid "" @@ -1846,6 +1854,9 @@ msgid "" "individual object, so for patching to work you must ensure that you patch " "the name used by the system under test." msgstr "" +":func:`patch` 的工作原理是(暫時)將 *name* 指向的物件變更為另一個物件。可以" +"有許多 name 指向任何單一物件,因此為了使 patch 起作用,你必須確保你 patch 了" +"被測試系統使用的 name。" #: ../../library/unittest.mock.rst:1910 msgid "" @@ -1853,11 +1864,13 @@ msgid "" "is not necessarily the same place as where it is defined. A couple of " "examples will help to clarify this." msgstr "" +"基本原則是在物件\\ *被查找*\\ 的位置進行 patch,該位置不一定與其被定義的位置" +"相同。幾個範例將有助於闡明這一點。" #: ../../library/unittest.mock.rst:1914 msgid "" "Imagine we have a project that we want to test with the following structure::" -msgstr "" +msgstr "想像一下,我們想要測試一個專案,其結構如下: ::" #: ../../library/unittest.mock.rst:1923 msgid "" @@ -1868,6 +1881,11 @@ msgid "" "module b already has a reference to the *real* ``SomeClass`` and it looks " "like our patching had no effect." msgstr "" +"現在我們想要測試 ``some_function``,但我們想使用 :func:`patch` mock " +"``SomeClass``。問題是,當我們 import 模組 b 時(我們必須這樣做),它會從模組 " +"a import ``SomeClass``。如果我們使用 :func:`patch` 來 mock ``a.SomeClass``," +"那麼它對我們的測試就不會有任何影響;模組 b 已經有了一個\\ *真實的*\\ " +"``SomeClass`` 的參照 ,看起來我們的 patch 並沒有任何效果。" #: ../../library/unittest.mock.rst:1930 msgid "" @@ -1876,6 +1894,9 @@ msgid "" "``SomeClass`` in module b, where we have imported it. The patching should " "look like::" msgstr "" +"關鍵是在使用(或查找它)的地方 patch ``SomeClass``。在這個情況下," +"``some_function`` 實際上會在我們 import 它的模組 b 中查找``SomeClass``。這裡" +"的 patch 應該長得像這樣: ::" #: ../../library/unittest.mock.rst:1936 msgid "" @@ -1885,10 +1906,14 @@ msgid "" "we want to patch is being looked up in the module and so we have to patch " "``a.SomeClass`` instead::" msgstr "" +"然而,考慮另一種情況,其中模組 b 並不是使用 ``from a import SomeClass``,而" +"是 ``import a``,然後 ``some_function`` 使用 ``a.SomeClass``。這兩種 import " +"形式都很常見。在這種情況下,我們想要 patch 的類別正在其模組中被查找,因此我們" +"必須 patch ``a.SomeClass``: ::" #: ../../library/unittest.mock.rst:1945 msgid "Patching Descriptors and Proxy Objects" -msgstr "" +msgstr "Patch 描述器與代理物件 (Proxy Objects)" #: ../../library/unittest.mock.rst:1947 msgid "" @@ -1899,14 +1924,19 @@ msgid "" "archive.org/web/20200603181648/http://www.voidspace.org.uk/python/weblog/" "arch_d7_2010_12_04.shtml#e1198>`_." msgstr "" +"patch_ 和 patch.object_ 都正確地 patch 和還原描述器:類別方法、靜態方法以及屬" +"性。你應該在 *類別* 而不是實例上 patch 它們。它們還可以使用代理屬性存取的\\ *" +"一些*\\ 物件,例如 `django設定物件 `_。" #: ../../library/unittest.mock.rst:1955 msgid "MagicMock and magic method support" -msgstr "" +msgstr "MagicMock 以及魔術方法支援" #: ../../library/unittest.mock.rst:1960 msgid "Mocking Magic Methods" -msgstr "" +msgstr "Mock 魔術方法" #: ../../library/unittest.mock.rst:1962 msgid "" @@ -1914,6 +1944,8 @@ msgid "" "term:`\"magic methods\" `. This allows mock objects to replace " "containers or other objects that implement Python protocols." msgstr "" +":class:`Mock` 支援 mock Python 協定方法,其也被稱作 :term:`\"魔術方法\" " +"`。這允許 mock 物件替換容器或實作 Python 協定的其他物件。" #: ../../library/unittest.mock.rst:1966 msgid "" @@ -1922,6 +1954,9 @@ msgid "" "magic methods are supported. The supported list includes *almost* all of " "them. If there are any missing that you need please let us know." msgstr "" +"由於魔法方法被查找的方式與一般的方法 [#]_ 不同,因此專門實作了此支援方式。這" +"代表著僅有特定的魔術方法被此方式支援。現在已支援清單中已經\\ *幾乎*\\ 包含了" +"所有魔術方法。如果你需要 mock 任何魔術方法而其尚未被支援,請讓我們知道。" #: ../../library/unittest.mock.rst:1971 msgid "" @@ -1929,18 +1964,22 @@ msgid "" "function or a mock instance. If you are using a function then it *must* take " "``self`` as the first argument [#]_." msgstr "" +"你可以透過將你感興趣的方法設定為函式或 mock 實例來 mock 魔術方法。如果你使用" +"函式,那麼它\\ *必須*\\ 將 ``self`` 作為第一個引數 [#]_。" #: ../../library/unittest.mock.rst:1994 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" -msgstr "" +msgstr "一個用法是在 :keyword:`with` 陳述式中 mock 作為情境管理器使用的物件:" #: ../../library/unittest.mock.rst:2006 msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." msgstr "" +"對魔術方法的呼叫並不會出現在 :attr:`~Mock.method_calls` 中,它們會被記錄在 :" +"attr:`~Mock.mock_calls` 內。" #: ../../library/unittest.mock.rst:2011 msgid "" @@ -1948,10 +1987,12 @@ msgid "" "set a magic method that isn't in the spec will raise an :exc:" "`AttributeError`." msgstr "" +"如果你使用\\ *spec*\\ 關鍵字引數來建立一個 mock,則嘗試設定規格中未包含的魔術" +"方法將引發一個 :exc:`AttributeError`。" #: ../../library/unittest.mock.rst:2014 msgid "The full list of supported magic methods is:" -msgstr "" +msgstr "已支援的魔術方法的完整列表是:" #: ../../library/unittest.mock.rst:2016 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" From ca1ddd0806cb30b7aedc9244c0030a0b6f657a29 Mon Sep 17 00:00:00 2001 From: Payon Date: Sun, 4 Feb 2024 20:45:54 +0800 Subject: [PATCH 2/7] feat: to rst:2170 --- library/unittest.mock.po | 67 +++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 94710c69cd..43377fd513 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-12-16 00:03+0000\n" -"PO-Revision-Date: 2024-01-31 01:21+0800\n" +"PO-Revision-Date: 2024-02-04 20:45+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2012,6 +2012,8 @@ msgid "" "Comparisons: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and " "``__ne__``" msgstr "" +"比較方法:``__lt__``、``__gt__``、``__le__``、``__ge__``、``__eq__`` 和 " +"``__ne__``" #: ../../library/unittest.mock.rst:2021 msgid "" @@ -2019,16 +2021,20 @@ msgid "" "``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` and " "``__missing__``" msgstr "" +"容器方法:``__getitem__``、``__setitem__``、``__delitem__``、" +"``__contains__``、``__len__``、``__iter__``、``__reversed__`` 和 " +"``__missing__``" #: ../../library/unittest.mock.rst:2024 msgid "" "Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " "``__aexit__``" msgstr "" +"情境管理器:``__enter__``、``__exit__``、``__aenter__`` 和 ``__aexit__``" #: ../../library/unittest.mock.rst:2025 msgid "Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``" -msgstr "" +msgstr "一元數值方法:``__neg__``、``__pos__`` 和 ``__invert__``" #: ../../library/unittest.mock.rst:2026 msgid "" @@ -2037,46 +2043,57 @@ msgid "" "``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, " "``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__``" msgstr "" +"數值方法(包括右側 (right hand) 和原地 (in-place) 變體):``__add__``、" +"``__sub__``、``__mul__``、``__matmul__``、``__truediv__``、" +"``__floordiv__``、 `` __mod__``、``__divmod__``、``__lshift__``、" +"``__rshift__``、``__and__``、``__xor__``、``__or__`` 和 ``__pow__``" #: ../../library/unittest.mock.rst:2030 msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" +"數值轉換方法:``__complex__``、``__int__``、``__float__`` 和 ``__index__``" #: ../../library/unittest.mock.rst:2032 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" -msgstr "" +msgstr "描述器方法:``__get__``、``__set__`` 和 ``__delete__``" #: ../../library/unittest.mock.rst:2033 msgid "" "Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " "``__getnewargs__``, ``__getstate__`` and ``__setstate__``" msgstr "" +"Pickling:``__reduce__``、``__reduce_ex__``、``__getinitargs__``、" +"``__getnewargs__``、``__getstate__`` 和 ``__setstate__``" #: ../../library/unittest.mock.rst:2035 msgid "File system path representation: ``__fspath__``" -msgstr "" +msgstr "檔案系統路徑表示法:``__fspath__``" #: ../../library/unittest.mock.rst:2036 msgid "Asynchronous iteration methods: ``__aiter__`` and ``__anext__``" -msgstr "" +msgstr "非同步疊代方法:``__aiter__`` 和 ``__anext__``" #: ../../library/unittest.mock.rst:2038 msgid "Added support for :func:`os.PathLike.__fspath__`." -msgstr "" +msgstr "新增對於 :func:`os.PathLike.__fspath__` 的支援。" #: ../../library/unittest.mock.rst:2041 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." msgstr "" +"新增對於 ``__aenter__``、``__aexit__``、``__aiter__`` 和 ``__anext__`` 的支" +"援。" #: ../../library/unittest.mock.rst:2045 msgid "" "The following methods exist but are *not* supported as they are either in " "use by mock, can't be set dynamically, or can cause problems:" msgstr "" +"以下方法存在,但「不」被支援,因為它們在被 mock 使用時,會無法動態設定,或可" +"能導致問題:" #: ../../library/unittest.mock.rst:2048 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" @@ -2092,13 +2109,14 @@ msgstr "" #: ../../library/unittest.mock.rst:2054 msgid "Magic Mock" -msgstr "" +msgstr "Magic Mock" #: ../../library/unittest.mock.rst:2056 msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." msgstr "" +"“MagicMock” 有兩個變體::class:`MagicMock` 和 :class:`NonCallableMagicMock`。" #: ../../library/unittest.mock.rst:2061 msgid "" @@ -2106,20 +2124,24 @@ msgid "" "most of the :term:`magic methods `. You can use ``MagicMock`` " "without having to configure the magic methods yourself." msgstr "" +"``MagicMock`` 是 :class:`Mock` 的子類別,其預設具有大多數 :term:`魔術方法 " +"` 的實作。你可以使用 “MagicMock”,而無需自行配置魔術方法。" #: ../../library/unittest.mock.rst:2065 msgid "The constructor parameters have the same meaning as for :class:`Mock`." -msgstr "" +msgstr "建構函式參數的意義與 :class:`Mock` 中的參數相同。" #: ../../library/unittest.mock.rst:2067 msgid "" "If you use the *spec* or *spec_set* arguments then *only* magic methods that " "exist in the spec will be created." msgstr "" +"如果你使用 *spec* 或 *spec_set* 引數,那麼\\ *只有*\\ 規格中存在的魔術方法會" +"被建立。" #: ../../library/unittest.mock.rst:2073 msgid "A non-callable version of :class:`MagicMock`." -msgstr "" +msgstr ":class:`MagicMock` 的不可呼叫版本。" #: ../../library/unittest.mock.rst:2075 msgid "" @@ -2127,12 +2149,16 @@ msgid "" "with the exception of *return_value* and *side_effect* which have no meaning " "on a non-callable mock." msgstr "" +"建構函式參數的意義與 :class:`MagicMock` 中的參數相同,但 *return_value* 和 " +"*side_effect* 除外,它們對不可呼叫的 mock 來說沒有任何意義。" #: ../../library/unittest.mock.rst:2079 msgid "" "The magic methods are setup with :class:`MagicMock` objects, so you can " "configure them and use them in the usual way:" msgstr "" +"魔術方法是使用 :class:`MagicMock` 物件設定的,因此你可以配置它們並以一般的方" +"法來使用它們:" #: ../../library/unittest.mock.rst:2089 msgid "" @@ -2142,10 +2168,13 @@ msgid "" "interested in the return value. You can still *set* the return value " "manually if you want to change the default." msgstr "" +"預設情況下,許多協定方法都需要回傳特定種類的物件。這些方法預先配置了預設回傳" +"值,因此如果你對回傳值不感興趣,則無需執行任何操作即可使用它們。如果你想更改" +"預設值,你仍然可以手動\\ *設定*\\ 回傳值。" #: ../../library/unittest.mock.rst:2095 msgid "Methods and their defaults:" -msgstr "" +msgstr "方法及其預設值:" #: ../../library/unittest.mock.rst:2097 msgid "``__lt__``: ``NotImplemented``" @@ -2205,15 +2234,15 @@ msgstr "``__index__``\\ :\\ ``1``" #: ../../library/unittest.mock.rst:2111 msgid "``__hash__``: default hash for the mock" -msgstr "" +msgstr "``__hash__``:mock 的預設雜湊" #: ../../library/unittest.mock.rst:2112 msgid "``__str__``: default str for the mock" -msgstr "" +msgstr "``__str__``:mock 的預設字串" #: ../../library/unittest.mock.rst:2113 msgid "``__sizeof__``: default sizeof for the mock" -msgstr "" +msgstr "``__sizeof__``:mock 的預設 sizeof" #: ../../library/unittest.mock.rst:2115 msgid "For example:" @@ -2226,18 +2255,24 @@ msgid "" "side_effect` attribute, unless you change their return value to return " "something else::" msgstr "" +":meth:`!__eq__` 和 :meth:`!__ne__` 這兩個相等的方法是特別的。它們使用 :attr:" +"`~Mock.side_effect` 屬性對識別性 (identity) 進行預設的相等比較,除非你變更它" +"們的回傳值以回傳其他內容: ::" #: ../../library/unittest.mock.rst:2141 msgid "" "The return value of :meth:`MagicMock.__iter__` can be any iterable object " "and isn't required to be an iterator:" msgstr "" +":meth:`MagicMock.__iter__` 的回傳值可以是任何可疊代物件,且不需是一個疊代器:" #: ../../library/unittest.mock.rst:2151 msgid "" "If the return value *is* an iterator, then iterating over it once will " "consume it and subsequent iterations will result in an empty list:" msgstr "" +"如果回傳值\\ *是*\\ 一個疊代器,那麼對其進行一次疊代將消耗它,並且後續疊代將" +"產生一個空串列:" #: ../../library/unittest.mock.rst:2160 msgid "" @@ -2245,12 +2280,14 @@ msgid "" "some of the obscure and obsolete ones. You can still set these up if you " "want." msgstr "" +"``MagicMock`` 配置了所有支援的魔術方法,除了一些少見和過時的方法。如果你想" +"要,你仍然可以設定這些魔術方法。" #: ../../library/unittest.mock.rst:2163 msgid "" "Magic methods that are supported but not setup by default in ``MagicMock`` " "are:" -msgstr "" +msgstr "``MagicMock`` 中支援但預設未設置的魔術方法包含:" #: ../../library/unittest.mock.rst:2165 msgid "``__subclasses__``" @@ -2277,6 +2314,8 @@ msgid "" "``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " "``__getstate__`` and ``__setstate__``" msgstr "" +"``__reduce__``、``__reduce_ex__``、``__getinitargs__``、``__getnewargs__``、" +"``__getstate__`` 和 ``__setstate__``" #: ../../library/unittest.mock.rst:2172 msgid "``__getformat__``" From b8e5642119d72fde1c0f669f3cb226b29eba6d5e Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 5 Feb 2024 16:17:28 +0800 Subject: [PATCH 3/7] Update library/unittest.mock.po --- library/unittest.mock.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 43377fd513..eb4dc90048 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -1808,7 +1808,7 @@ msgid "" "the :class:`unittest.TestLoader` finds test methods by default." msgstr "" "所有 patcher 都可以作為類別裝飾器使用。以這種方式使用時,它們包裝了類別上的每" -"個測試方法。Patcher 將 ``'test'`` 開頭的方法認定為測試方法。 這與 :class:" +"個測試方法。Patcher 將 ``'test'`` 開頭的方法認定為測試方法。這與 :class:" "`unittest.TestLoader` 預設尋找測試方法的方式相同。" #: ../../library/unittest.mock.rst:1851 From ce67a9b1ddeafa285d46d2392133d5648625a0b6 Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 5 Feb 2024 16:17:36 +0800 Subject: [PATCH 4/7] Update library/unittest.mock.po --- library/unittest.mock.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index eb4dc90048..316e24a772 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -1925,7 +1925,7 @@ msgid "" "arch_d7_2010_12_04.shtml#e1198>`_." msgstr "" "patch_ 和 patch.object_ 都正確地 patch 和還原描述器:類別方法、靜態方法以及屬" -"性。你應該在 *類別* 而不是實例上 patch 它們。它們還可以使用代理屬性存取的\\ *" +"性。你應該在\\ *類別*\\ 而不是實例上 patch 它們。它們還可以使用代理屬性存取的\\ *" "一些*\\ 物件,例如 `django設定物件 `_。" From 34d8cda5bbc9686dd954e2283d46b5f4878888ef Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 5 Feb 2024 16:17:43 +0800 Subject: [PATCH 5/7] Update library/unittest.mock.po --- library/unittest.mock.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 316e24a772..7c1ead8da7 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -1954,7 +1954,7 @@ msgid "" "magic methods are supported. The supported list includes *almost* all of " "them. If there are any missing that you need please let us know." msgstr "" -"由於魔法方法被查找的方式與一般的方法 [#]_ 不同,因此專門實作了此支援方式。這" +"由於魔術方法被查找的方式與一般的方法 [#]_ 不同,因此專門實作了此支援方式。這" "代表著僅有特定的魔術方法被此方式支援。現在已支援清單中已經\\ *幾乎*\\ 包含了" "所有魔術方法。如果你需要 mock 任何魔術方法而其尚未被支援,請讓我們知道。" From d8787887f7a56061eb8dddc81fcd5c40f7bfcc21 Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 5 Feb 2024 16:17:48 +0800 Subject: [PATCH 6/7] Update library/unittest.mock.po --- library/unittest.mock.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 7c1ead8da7..0925382274 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -2125,7 +2125,7 @@ msgid "" "without having to configure the magic methods yourself." msgstr "" "``MagicMock`` 是 :class:`Mock` 的子類別,其預設具有大多數 :term:`魔術方法 " -"` 的實作。你可以使用 “MagicMock”,而無需自行配置魔術方法。" +"` 的實作。你可以使用 ``MagicMock``,而無需自行配置魔術方法。" #: ../../library/unittest.mock.rst:2065 msgid "The constructor parameters have the same meaning as for :class:`Mock`." From 2391daadf545a9e514197643fdc42a8380dd32bd Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 19 Feb 2024 21:31:54 +0800 Subject: [PATCH 7/7] fix: for first review --- library/unittest.mock.po | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 0925382274..cceb36be21 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-12-16 00:03+0000\n" -"PO-Revision-Date: 2024-02-04 20:45+0800\n" +"PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1925,10 +1925,10 @@ msgid "" "arch_d7_2010_12_04.shtml#e1198>`_." msgstr "" "patch_ 和 patch.object_ 都正確地 patch 和還原描述器:類別方法、靜態方法以及屬" -"性。你應該在\\ *類別*\\ 而不是實例上 patch 它們。它們還可以使用代理屬性存取的\\ *" -"一些*\\ 物件,例如 `django設定物件 `_。" +"arch_d7_2010_12_04.shtml#e1198>`_。" #: ../../library/unittest.mock.rst:1955 msgid "MagicMock and magic method support" @@ -1996,16 +1996,15 @@ msgstr "已支援的魔術方法的完整列表是:" #: ../../library/unittest.mock.rst:2016 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" -msgstr "``__hash__``\\ 、\\ ``__sizeof__``\\ 、\\ ``__repr__`` 和 ``__str__``" +msgstr "``__hash__``、``__sizeof__``、 ``__repr__`` 和 ``__str__``" #: ../../library/unittest.mock.rst:2017 msgid "``__dir__``, ``__format__`` and ``__subclasses__``" -msgstr "``__dir__``\\ 、\\ ``__format__`` 和 ``__subclasses__``" +msgstr "``__dir__``、 ``__format__`` 和 ``__subclasses__``" #: ../../library/unittest.mock.rst:2018 msgid "``__round__``, ``__floor__``, ``__trunc__`` and ``__ceil__``" -msgstr "" -"``__round__``\\ 、\\ ``__floor__``\\ 、\\ ``__trunc__`` 和 ``__ceil__``" +msgstr "``__round__``、``__floor__``、``__trunc__`` 和 ``__ceil__``" #: ../../library/unittest.mock.rst:2019 msgid "" @@ -2097,15 +2096,13 @@ msgstr "" #: ../../library/unittest.mock.rst:2048 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" -msgstr "" -"``__getattr__``\\ 、\\ ``__setattr__``\\ 、\\ ``__init__`` 和 ``__new__``" +msgstr "``__getattr__``、``__setattr__``、``__init__`` 和 ``__new__``" #: ../../library/unittest.mock.rst:2049 msgid "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" -"``__prepare__``\\ 、\\ ``__instancecheck__``\\ 、\\ " -"``__subclasscheck__``\\ 、\\ ``__del__``" +"``__prepare__``、``__instancecheck__``、``__subclasscheck__``、``__del__``" #: ../../library/unittest.mock.rst:2054 msgid "Magic Mock" @@ -2116,7 +2113,8 @@ msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." msgstr "" -"“MagicMock” 有兩個變體::class:`MagicMock` 和 :class:`NonCallableMagicMock`。" +"``MagicMock`` 有兩個變體::class:`MagicMock` 和 :class:" +"`NonCallableMagicMock`。" #: ../../library/unittest.mock.rst:2061 msgid "" @@ -2124,8 +2122,8 @@ msgid "" "most of the :term:`magic methods `. You can use ``MagicMock`` " "without having to configure the magic methods yourself." msgstr "" -"``MagicMock`` 是 :class:`Mock` 的子類別,其預設具有大多數 :term:`魔術方法 " -"` 的實作。你可以使用 ``MagicMock``,而無需自行配置魔術方法。" +"``MagicMock`` 是 :class:`Mock` 的子類別,其預設具有大多數\\ :term:`魔術方法 " +"`\\ 的實作。你可以使用 ``MagicMock``,而無需自行配置魔術方法。" #: ../../library/unittest.mock.rst:2065 msgid "The constructor parameters have the same meaning as for :class:`Mock`." @@ -2303,7 +2301,7 @@ msgstr "``__format__``" #: ../../library/unittest.mock.rst:2168 msgid "``__get__``, ``__set__`` and ``__delete__``" -msgstr "``__get__``\\ 、\\ ``__set__`` 和 ``__delete__``" +msgstr "``__get__``、``__set__`` 和 ``__delete__``" #: ../../library/unittest.mock.rst:2169 msgid "``__reversed__`` and ``__missing__``"