Skip to content

Commit 9ef6e61

Browse files
committed
Translate new/fuzzy entries from upstream sync (cpython 91abbe6f)
Rebased onto upstream/cron/sync/3.14 (6 new sync commits) and translated the resulting new-or-fuzzy backlog: 39 entries across 10 files (32 new, 7 fuzzy resolved) in c-api/exceptions.po, c-api/init_config.po, c-api/intro.po, library/asyncio-eventloop.po, library/difflib.po, library/functions.po, library/tempfile.po, library/test.po, license.po, and whatsnew/2.5.po. Excludes the large pre-existing untranslated backlog in whatsnew/2.4.po, whatsnew/2.5.po, library/difflib.po, and library/test.po that is unrelated to this sync.
1 parent f6f84c8 commit 9ef6e61

10 files changed

Lines changed: 154 additions & 27 deletions

File tree

c-api/exceptions.po

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,27 +156,29 @@ msgid ""
156156
msgstr ""
157157

158158
#: ../../c-api/exceptions.rst:124
159-
#, fuzzy
160159
msgid "Legacy variant of :c:func:`PyErr_DisplayException`."
161-
msgstr "請改用 :c:func:`PyErr_GetRaisedException`。"
160+
msgstr ":c:func:`PyErr_DisplayException` 的舊版形式。"
162161

163162
#: ../../c-api/exceptions.rst:126
164163
msgid ""
165164
"Print the exception *value* with its traceback to :data:`sys.stderr`. If "
166165
"*value* has no traceback set, *tb* is used as its traceback. The first "
167166
"argument is ignored."
168167
msgstr ""
168+
"將例外 *value* 及其追蹤回溯輸出到 :data:`sys.stderr`。如果 *value* 沒有設定追"
169+
"蹤回溯,則使用 *tb* 作為其追蹤回溯。第一個引數會被忽略。"
169170

170171
#: ../../c-api/exceptions.rst:130
171172
msgid ""
172173
"If :data:`sys.stderr` is ``None``, nothing is printed. If :data:`sys.stderr` "
173174
"is not set, the exception is dumped to the C ``stderr`` stream instead."
174175
msgstr ""
176+
"如果 :data:`sys.stderr` 為 ``None``,則不會輸出任何內容。如果 :data:`sys."
177+
"stderr` 未被設定,則改將例外傾印至 C 的 ``stderr`` 串流。"
175178

176179
#: ../../c-api/exceptions.rst:134
177-
#, fuzzy
178180
msgid "Use :c:func:`PyErr_DisplayException` instead."
179-
msgstr "請改用 :c:func:`PyErr_GetRaisedException`。"
181+
msgstr "請改用 :c:func:`PyErr_DisplayException`。"
180182

181183
#: ../../c-api/exceptions.rst:138
182184
msgid "Raising exceptions"

c-api/init_config.po

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,14 +1924,12 @@ msgid "See also :c:member:`PyConfig.exec_prefix`."
19241924
msgstr "也請見 :c:member:`PyConfig.exec_prefix`"
19251925

19261926
#: ../../c-api/init_config.rst:1240
1927-
#, fuzzy
19281927
msgid "Python base executable: ``sys._base_executable``."
1929-
msgstr ":c:member:`base_executable <PyConfig.base_executable>`"
1928+
msgstr "Python 基礎可執行檔:``sys._base_executable``。"
19301929

19311930
#: ../../c-api/init_config.rst:1242
1932-
#, fuzzy
19331931
msgid "Set by the ``__PYVENV_LAUNCHER__`` environment variable."
1934-
msgstr "由 :envvar:`__PYVENV_LAUNCHER__` 環境變數設定。"
1932+
msgstr "由 ``__PYVENV_LAUNCHER__`` 環境變數設定。"
19351933

19361934
#: ../../c-api/init_config.rst:1244
19371935
msgid "Set from :c:member:`PyConfig.executable` if ``NULL``."

c-api/intro.po

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,6 @@ msgstr ""
16921692
"建置 <debug-build>`。"
16931693

16941694
#: ../../c-api/intro.rst:1076
1695-
#, fuzzy
16961695
msgid ""
16971696
"Defining ``Py_TRACE_REFS`` enables reference tracing (see the :option:"
16981697
"`configure --with-trace-refs option <--with-trace-refs>`). When defined, a "
@@ -1701,11 +1700,11 @@ msgid ""
17011700
"well. Upon exit, all existing references are printed. (In interactive mode "
17021701
"this happens after every statement run by the interpreter.)"
17031702
msgstr ""
1704-
"定義 :c:macro:`Py_TRACE_REFS` 來啟用參照追蹤(參見\\ :option:`設定 --with-"
1705-
"trace-refs 選項 <--with-trace-refs>`)。當有定義時,透過向每個 :c:type:"
1706-
"`PyObject` 新增兩個額外欄位來維護有效物件的循環雙向鍊表 (circular doubly "
1707-
"linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下,"
1708-
"這發生在直譯器運行的每個陳述句之後。)"
1703+
"定義 ``Py_TRACE_REFS`` 來啟用參照追蹤(參見\\ :option:`設定 --with-trace-"
1704+
"refs 選項 <--with-trace-refs>`)。當有定義時,透過向每個 :c:type:`PyObject` "
1705+
"新增兩個額外欄位來維護有效物件的循環雙向鍊表 (circular doubly linked list)。"
1706+
"全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下,這發生在直譯器"
1707+
"運行的每個陳述句之後。)"
17091708

17101709
#: ../../c-api/intro.rst:1083
17111710
msgid ""

library/asyncio-eventloop.po

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2827,6 +2827,8 @@ msgid ""
28272827
"connections have finished. Previously, it returned immediately if the "
28282828
"server was already closed, even if connections were still active."
28292829
msgstr ""
2830+
"``wait_closed()`` 現在會等到伺服器關閉且所有活動連線都已結束才回傳。在此之"
2831+
"前,如果伺服器已經關閉,即使連線仍在活動中,它也會立即回傳。"
28302832

28312833
#: ../../library/asyncio-eventloop.rst:1895
28322834
msgid ""

library/difflib.po

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ msgid ""
3434
"context and unified diffs -- formats produced by tools like :manpage:`diff "
3535
"<diff(1)>` and :manpage:`git diff <git-diff(1)>`."
3636
msgstr ""
37+
"此模組提供用於比較序列的類別和函式。它們大多是比較文字行的序列(例如字串串"
38+
"列,或\\ :term:`檔案物件 <file object>`),並產生\\ :dfn:`diff`\\ —— 也就是差"
39+
"異的報告。diff 可以以多種格式產生,包括 HTML,以及 :manpage:`diff <diff(1)>` "
40+
"和 :manpage:`git diff <git-diff(1)>` 這類工具所產生的 context diff 與 "
41+
"unified diff 格式。"
3742

3843
#: ../../library/difflib.rst:28
3944
msgid ""
@@ -42,17 +47,23 @@ msgid ""
4247
"any type, not just text, so long as the sequence elements are :term:"
4348
"`hashable`."
4449
msgstr ""
50+
"比較是使用實作於 :class:`SequenceMatcher` 中的匹配演算法來完成的——這是一個靈"
51+
"活的類別,可用於比較任何型別的序列,而不僅限於文字,只要序列中的元素是\\ :"
52+
"term:`可雜湊 <hashable>`\\ 即可。"
4553

4654
#: ../../library/difflib.rst:37
4755
msgid "Junk heuristic"
48-
msgstr ""
56+
msgstr "雜訊啟發式"
4957

5058
#: ../../library/difflib.rst:39
5159
msgid ""
5260
":mod:`!difflib` uses a :dfn:`junk` heuristic: some items are deemed to be :"
5361
"dfn:`junk`, and ignored when searching for similarities. Ideally, these are "
5462
"uninteresting or common items, such as blank lines or whitespace."
5563
msgstr ""
64+
":mod:`!difflib` 使用\\ :dfn:`雜訊`\\ 啟發式:某些項目會被判定為\\ :dfn:`雜訊"
65+
"`,並在搜尋相似之處時被忽略。理想情況下,這些是不重要或常見的項目,例如空白行"
66+
"或空白字元。"
5667

5768
#: ../../library/difflib.rst:44
5869
msgid ""
@@ -61,25 +72,33 @@ msgid ""
6172
"understandable for humans (typically breaking on whitespace). But it can "
6273
"also cause pathological cases:"
6374
msgstr ""
75+
"這個啟發式方法可以加速演算法的執行(因為它減少了可能組合的數量),並且可以產"
76+
"生對人類來說更容易理解的結果(通常會在空白字元處斷開)。但它也可能導致病態情"
77+
"況:"
6478

6579
#: ../../library/difflib.rst:49
6680
msgid ""
6781
"Inappropriately chosen junk items can cause an unexpectedly **large** (but "
6882
"still correct) result."
69-
msgstr ""
83+
msgstr "選擇不當的雜訊項目可能導致結果出乎意料地\\ **龐大**\\ (但仍然正確)。"
7084

7185
#: ../../library/difflib.rst:51
7286
msgid ""
7387
"The default heuristic is **asymmetric**: only the second sequence is "
7488
"inspected when determining what is considered junk, so comparing A to B can "
7589
"give different results than comparing B to A and reversing the result."
7690
msgstr ""
91+
"預設的啟發式方法是\\ **不對稱**\\ 的:在判斷哪些項目算是雜訊時,只會檢查第二"
92+
"個序列,因此將 A 與 B 比較,可能會與將 B 與 A 比較後再反轉結果得到不同的結"
93+
"果。"
7794

7895
#: ../../library/difflib.rst:55
7996
msgid ""
8097
"By default, if the second input sequence is at least 200 items long, items "
8198
"that account for more than 1% it are considered *junk*."
8299
msgstr ""
100+
"在預設情況下,如果第二個輸入序列的長度至少有 200 個項目,則佔比超過 1% 的項目"
101+
"會被視為\\ *雜訊*\\ 。"
83102

84103
#: ../../library/difflib.rst:58
85104
msgid ""
@@ -88,10 +107,14 @@ msgid ""
88107
"``False``) or tuning it (using the *isjunk* argument, perhaps to one of the :"
89108
"ref:`predefined functions <difflib-isjunk-functions>`)."
90109
msgstr ""
110+
"根據你的資料情況,你可能需要考慮關閉這個啟發式方法(將 :class:`~difflib."
111+
"SequenceMatcher` 的 *autojunk* 引數設為 ``False``),或是調整它(使用 "
112+
"*isjunk* 引數,也許可以用\\ :ref:`預先定義的函式 <difflib-isjunk-"
113+
"functions>`\\ 之一)。"
91114

92115
#: ../../library/difflib.rst:65
93116
msgid "The :mod:`!difflib` algorithm"
94-
msgstr ""
117+
msgstr ":mod:`!difflib` 的演算法"
95118

96119
#: ../../library/difflib.rst:67
97120
msgid ""
@@ -102,29 +125,39 @@ msgid ""
102125
"recursively handle the pieces of the sequences to the left and to the right "
103126
"of the matching subsequence."
104127
msgstr ""
128+
":class:`SequenceMatcher` 中使用的演算法比 Ratcliff 和 Obershelp 在 1980 年代"
129+
"末以「格式塔模式匹配 (gestalt pattern matching)」這個誇張名稱發表的演算法要更"
130+
"早出現,且稍微精巧一些。其想法是找出兩個輸入中最長的共同連續子序列,然後遞迴"
131+
"地處理該匹配子序列左右兩側的部分。"
105132

106133
#: ../../library/difflib.rst:76
107134
msgid ""
108135
"`Pattern Matching: The Gestalt Approach <https://jacobfilipp.com/DrDobbs/"
109136
"articles/DDJ/1988/8807/8807c/8807c.htm>`_"
110137
msgstr ""
138+
"`Pattern Matching: The Gestalt Approach <https://jacobfilipp.com/DrDobbs/"
139+
"articles/DDJ/1988/8807/8807c/8807c.htm>`_"
111140

112141
#: ../../library/difflib.rst:77
113142
msgid ""
114143
"Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. "
115144
"This was published in Dr. Dobb's Journal in July, 1988."
116145
msgstr ""
146+
"由 John W. Ratcliff 和 D. E. Metzener 討論一個類似的演算法。此文章發表於 "
147+
"1988 年 7 月的 Dr. Dobb's Journal。"
117148

118149
#: ../../library/difflib.rst:80
119150
msgid ""
120151
"As an extension to the Ratcliff and Obershelp algorithm, :mod:`!difflib` "
121152
"searches for the longest *junk-free* contiguous subsequence. See the :ref:"
122153
"`difflib-junk` section for details."
123154
msgstr ""
155+
"作為 Ratcliff 和 Obershelp 演算法的延伸,:mod:`!difflib` 會搜尋最長的\\ *無雜"
156+
"訊*\\ 連續子序列。詳情請參閱\\ :ref:`difflib-junk`\\ 一節。"
124157

125158
#: ../../library/difflib.rst:84
126159
msgid "Timing"
127-
msgstr ""
160+
msgstr "耗時"
128161

129162
#: ../../library/difflib.rst:86
130163
msgid ""
@@ -134,10 +167,13 @@ msgid ""
134167
"complicated way on how many elements the sequences have in common; best case "
135168
"time is linear."
136169
msgstr ""
170+
"基本的 Ratcliff-Obershelp 演算法在最差情況下為三次方時間,在預期情況下為二次"
171+
"方時間。:mod:`difflib` 的演算法在最差情況下為二次方時間,其預期情況下的行為則"
172+
"以複雜的方式取決於這些序列共有多少元素;最佳情況下的時間則為線性。"
137173

138174
#: ../../library/difflib.rst:97
139175
msgid "Diff generation"
140-
msgstr ""
176+
msgstr "產生 diff"
141177

142178
#: ../../library/difflib.rst:103
143179
msgid ""
@@ -522,7 +558,7 @@ msgstr ""
522558

523559
#: ../../library/difflib.rst:430
524560
msgid "Junk definition functions"
525-
msgstr ""
561+
msgstr "雜訊定義函式"
526562

527563
#: ../../library/difflib.rst:434
528564
msgid ""
@@ -823,9 +859,8 @@ msgid ""
823859
msgstr ""
824860

825861
#: ../../library/difflib.rst:662
826-
#, fuzzy
827862
msgid "Examples"
828-
msgstr "範例"
863+
msgstr "範例"
829864

830865
#: ../../library/difflib.rst:667
831866
msgid "SequenceMatcher examples"

library/functions.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3754,6 +3754,9 @@ msgid ""
37543754
"the metaclass ``__prepare__`` method (see :ref:`prepare`). Use :func:`types."
37553755
"new_class` to dynamically create a class using the appropriate metaclass."
37563756
msgstr ""
3757+
"與 :keyword:`class` 陳述式不同,三引數形式不會呼叫元類別的 ``__prepare__`` 方"
3758+
"法(見 :ref:`prepare`)。請使用 :func:`types.new_class` 以適當的元類別動態建"
3759+
"立類別。"
37573760

37583761
#: ../../library/functions.rst:2118
37593762
msgid "See also :ref:`class-customization`."

library/tempfile.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,14 @@ msgid ""
425425
msgstr "檔案描述器\\ :ref:`不會被子行程繼承 <fd_inheritance>`。"
426426

427427
#: ../../library/tempfile.rst:232
428-
#, fuzzy
429428
msgid ""
430429
"Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for "
431430
"closing the file descriptor (for example, using :func:`os.close`) and "
432431
"deleting the temporary file (for example, using :func:`os.remove`)."
433432
msgstr ""
434-
"與 :func:`TemporaryFile` 不同,:func:`mkstemp` 使用者用完臨時檔案後需要自行將"
435-
"其刪除。"
433+
"與 :func:`TemporaryFile` 不同,:func:`mkstemp` 的使用者需要自行負責關閉檔案描"
434+
"述器(例如使用 :func:`os.close`)並刪除該臨時檔案(例如使用 :func:`os."
435+
"remove`)。"
436436

437437
#: ../../library/tempfile.rst:236
438438
msgid ""

library/test.po

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,12 @@ msgid ""
11801180
"failure or error shows the original subprocess traceback as the cause of the "
11811181
"exception."
11821182
msgstr ""
1183+
"一個裝飾器,會在一個全新的直譯器子行程中以隔離的方式執行被裝飾的測試,因此它"
1184+
"不會與測試執行的其餘部分共享全域或直譯器狀態。它可以裝飾一個測試方法,也可以"
1185+
"裝飾整個 :class:`~unittest.TestCase` 子類別。被裝飾的方法不得接受額外的引數。"
1186+
"子行程中的失敗、錯誤或跳過會回報給對應的測試,個別失敗或被跳過的\\ :meth:`子"
1187+
"測試 <unittest.TestCase.subTest>` 也會被個別回報。被回報的失敗或錯誤會將原始"
1188+
"子行程的追蹤回溯顯示為該例外的成因。"
11831189

11841190
#: ../../library/test.rst:980
11851191
msgid ""
@@ -1189,6 +1195,11 @@ msgid ""
11891195
"tearDownClass` and ``setUpModule()`` / ``tearDownModule()``) run both in the "
11901196
"parent process (as usual) and in the subprocess around the method."
11911197
msgstr ""
1198+
"當裝飾的對象是**方法**時,只有該方法會在子行程中執行;所有 fixture(:meth:"
1199+
"`~unittest.TestCase.setUp`\\ / :meth:`~unittest.TestCase.tearDown`、:meth:"
1200+
"`~unittest.TestCase.setUpClass`\\ / :meth:`~unittest.TestCase.tearDownClass` "
1201+
"以及 ``setUpModule()``\\ / ``tearDownModule()``)都會如常在父行程中執行一次,"
1202+
"並在子行程中圍繞該方法再執行一次。"
11921203

11931204
#: ../../library/test.rst:986
11941205
msgid ""
@@ -1201,6 +1212,13 @@ msgid ""
12011212
"be controlled by a class decorator, so it still runs in the parent process "
12021213
"too; test it with :data:`runningInSubprocess` if needed."
12031214
msgstr ""
1215+
"當裝飾的對象是**類別**時,整個類別會在單一子行程中執行,且 :meth:`~unittest."
1216+
"TestCase.setUpClass`、:meth:`~unittest.TestCase.tearDownClass`、:meth:"
1217+
"`~unittest.TestCase.setUp` 和 :meth:`~unittest.TestCase.tearDown` 都只會在子"
1218+
"行程中各執行一次,並在父行程中被跳過。子行程中 :meth:`~unittest.TestCase."
1219+
"setUpClass` 的失敗或跳過會回報給整個類別。``setUpModule()`` 無法由類別裝飾器"
1220+
"控制,因此它仍然也會在父行程中執行;如有需要,可以用 :data:"
1221+
"`runningInSubprocess` 來檢測。"
12041222

12051223
#: ../../library/test.rst:996
12061224
msgid ""
@@ -1209,10 +1227,14 @@ msgid ""
12091227
"support.requires_resource`, :func:`~test.support.requires`, :func:`~test."
12101228
"support.bigmemtest` and the like behave consistently in both processes."
12111229
msgstr ""
1230+
"子行程會繼承父測試執行的已啟用資源(``-u``)、記憶體限制(``-M``)和詳細程度"
1231+
"(``-v``),因此 :func:`~test.support.requires_resource`、:func:`~test."
1232+
"support.requires`、:func:`~test.support.bigmemtest` 等函式在兩個行程中的行為"
1233+
"會保持一致。"
12121234

12131235
#: ../../library/test.rst:1002
12141236
msgid "The test is skipped on platforms without subprocess support."
1215-
msgstr ""
1237+
msgstr "在不支援子行程的平台上,該測試會被跳過。"
12161238

12171239
#: ../../library/test.rst:1007
12181240
msgid ""
@@ -1224,6 +1246,12 @@ msgid ""
12241246
"``setUpModule()`` and ``tearDownModule()`` can test it to choose which code "
12251247
"to run in the subprocess."
12261248
msgstr ""
1249+
"當程式碼在由 :func:`runInSubprocess` 衍生的隔離子行程中執行時為 ``True``,否"
1250+
"則為 ``False``\\ (包括在父行程中,以及在一般、非隔離的測試執行中)。像 :"
1251+
"meth:`~unittest.TestCase.setUp`、:meth:`~unittest.TestCase.tearDown`、:meth:"
1252+
"`~unittest.TestCase.setUpClass`、:meth:`~unittest.TestCase.tearDownClass`、"
1253+
"``setUpModule()`` 和 ``tearDownModule()`` 這樣的 fixture 可以檢測它,以選擇要"
1254+
"在子行程中執行哪些程式碼。"
12271255

12281256
#: ../../library/test.rst:1021
12291257
msgid "Assert instances of *cls* are deallocated after iterating."

0 commit comments

Comments
 (0)