Skip to content

Commit 30da68e

Browse files
committed
Translate new/fuzzy entries from upstream sync (cpython 92cab347)
Rebased cron/sync/3.14 onto upstream (7 new sync commits), then translated every new-or-fuzzy msgid relative to origin/3.14: 336 new entries and 28 fuzzy entries across 27 files, including the new library/time-complexity.po page (120 entries) and the XML DOM/SAX family (library/xml.dom.po, xml.dom.minidom.po, xml.dom.pulldom.po, xml.etree.elementtree.po, xml.sax*.po). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ErrfGR94u9Jau7pF3GMdJa
1 parent 51e9c9d commit 30da68e

27 files changed

Lines changed: 726 additions & 238 deletions

faq/design.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ msgstr ""
883883
#: ../../faq/design.rst:448
884884
msgid ""
885885
"See :ref:`time-complexity` for the costs of the various list operations."
886-
msgstr ""
886+
msgstr "各種串列操作的成本請參閱\\ :ref:`time-complexity`\\"
887887

888888
#: ../../faq/design.rst:454
889889
msgid "How are dictionaries implemented in CPython?"
@@ -921,7 +921,7 @@ msgstr ""
921921
msgid ""
922922
"See :ref:`time-complexity` for the costs of the various dictionary "
923923
"operations."
924-
msgstr ""
924+
msgstr "各種字典操作的成本請參閱\\ :ref:`time-complexity`\\"
925925

926926
#: ../../faq/design.rst:473
927927
msgid "Why must dictionary keys be immutable?"

faq/programming.po

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,6 @@ msgid "What is the most efficient way to concatenate many strings together?"
22002200
msgstr "將多個字串連接在一起最有效率的方法是什麼?"
22012201

22022202
#: ../../faq/programming.rst:1136
2203-
#, fuzzy
22042203
msgid ""
22052204
":class:`str` and :class:`bytes` objects are immutable, therefore "
22062205
"concatenating many strings together is inefficient as each concatenation "
@@ -2210,7 +2209,7 @@ msgid ""
22102209
msgstr ""
22112210
":class:`str` 和 :class:`bytes` 物件是不可變的,因此將多個字串連接在一起的效率"
22122211
"很低,因為每次連接都會建立一個新物件。在一般情況下,總 runtime 成本與總字串長"
2213-
"度呈二次方關係。"
2212+
"度呈二次方關係。詳情請參閱\\ :ref:`time-complexity`\\"
22142213

22152214
#: ../../faq/programming.rst:1141
22162215
msgid ""

glossary.po

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,15 +2084,14 @@ msgid "list"
20842084
msgstr "list(串列)"
20852085

20862086
#: ../../glossary.rst:943
2087-
#, fuzzy
20882087
msgid ""
20892088
"A built-in Python :term:`sequence`. Despite its name it is more akin to an "
20902089
"array in other languages than to a linked list since access to elements is "
20912090
"*O*\\ (1). See :ref:`time-complexity`."
20922091
msgstr ""
20932092
"一個 Python 內建的 :term:`sequence` (序列)。儘管它的名字是 list,它其實更類"
20942093
"似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元"
2095-
"素的時間複雜度是 *O*\\ (1)。"
2094+
"素的時間複雜度是 *O*\\ (1)。詳情請參閱\\ :ref:`time-complexity`\\"
20962095

20972096
#: ../../glossary.rst:946
20982097
msgid "list comprehension"

howto/curses.po

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ msgid ""
483483
"this defaults to the default system encoding as returned by :func:`locale."
484484
"getencoding`."
485485
msgstr ""
486+
":meth:`~curses.window.addstr` 方法接受 Python 字串或位元組字串作為要顯示的"
487+
"值。位元組字串的內容會被原封不動地傳送到終端機。在未支援寬字元的建置版本中,"
488+
"字串會用該視窗的 :attr:`~window.encoding` 屬性值來編碼;此屬性預設為 :func:"
489+
"`locale.getencoding` 所回傳的系統預設編碼。"
486490

487491
#: ../../howto/curses.rst:307
488492
msgid ""
@@ -497,6 +501,9 @@ msgid ""
497501
"`ACS_ULCORNER` is the upper left corner of a box (handy for drawing "
498502
"borders). You can also use the appropriate Unicode character."
499503
msgstr ""
504+
"終端機替代字元集的字元都有提供對應的常數。舉例來說,:const:`ACS_PLMINUS` 是一"
505+
"個 +/- 符號,而 :const:`ACS_ULCORNER` 則是方框的左上角(在繪製邊框時很好"
506+
"用)。你也可以直接使用對應的 Unicode 字元。"
500507

501508
#: ../../howto/curses.rst:317
502509
msgid ""
@@ -517,6 +524,9 @@ msgid ""
517524
"leaves the cursor wherever the last update put it, instead of moving it back "
518525
"to the window's cursor position."
519526
msgstr ""
527+
"如果你的應用程式完全不需要閃爍游標,可以呼叫 ``curs_set(False)`` 使其隱藏。視"
528+
"窗方法 :meth:`~curses.window.leaveok` 則有不同的作用:當其引數為真時,curses "
529+
"會讓游標留在最後一次更新所在的位置,而不是把它移回視窗的游標位置。"
520530

521531
#: ../../howto/curses.rst:334
522532
msgid "Attributes and Color"
@@ -707,7 +717,7 @@ msgstr ""
707717

708718
#: ../../howto/curses.rst:436
709719
msgid "There are three methods for getting input from a window:"
710-
msgstr ""
720+
msgstr "有三種方法可以取得視窗的輸入:"
711721

712722
#: ../../howto/curses.rst:438
713723
msgid ""
@@ -716,6 +726,9 @@ msgid ""
716726
"called earlier. You can optionally specify a coordinate to which the cursor "
717727
"should be moved before pausing."
718728
msgstr ""
729+
":meth:`~curses.window.get_wch` 會重新整理螢幕,然後等待使用者按下按鍵,如果先"
730+
"前呼叫過 :func:`~curses.echo`,還會顯示該按鍵。你可以選擇性地指定一個座標,讓"
731+
"游標在暫停前先移動到該處。"
719732

720733
#: ../../howto/curses.rst:443
721734
msgid ""
@@ -724,13 +737,19 @@ msgid ""
724737
"encoding in the current locale, so a character encoded with several bytes "
725738
"takes several calls, one byte per call."
726739
msgstr ""
740+
":meth:`~curses.window.getch` 做的是同樣的事情,但回傳的是按鍵的代碼而不是字"
741+
"元。在 ncurses 中,這會是該按鍵在目前語言環境 (locale) 中編碼的單一位元組,因"
742+
"此以多個位元組編碼的字元需要多次呼叫,每次呼叫回傳一個位元組。"
727743

728744
#: ../../howto/curses.rst:449
729745
msgid ""
730746
":meth:`~curses.window.getkey` does the same as :meth:`!getch` but returns a "
731747
"string: an ordinary key as a 1-character string, and a special key as its "
732748
"name, such as ``KEY_UP``."
733749
msgstr ""
750+
":meth:`~curses.window.getkey` 做的事情和 :meth:`!getch` 相同,但回傳的是字"
751+
"串:一般按鍵會以長度為 1 的字串回傳,特殊按鍵則以其名稱回傳,例如 "
752+
"``KEY_UP``。"
734753

735754
#: ../../howto/curses.rst:454
736755
msgid ""
@@ -743,6 +762,12 @@ msgid ""
743762
"specified delay (measured in tenths of a second), the read fails the same "
744763
"way."
745764
msgstr ""
765+
"你可以使用視窗方法 :meth:`~curses.window.nodelay` 來不等待使用者輸入。呼叫 "
766+
"``nodelay(True)`` 之後,該視窗的讀取操作會變成非阻塞的。為了表示目前沒有可用"
767+
"的輸入,:meth:`!get_wch` 和 :meth:`!getkey` 會引發例外,而 :meth:`!getch` 會"
768+
"回傳 ``-1``。此外還有一個 :func:`~curses.halfdelay` 函式,可以用來(實際上)"
769+
"為每次讀取設定一個計時器;如果在指定的延遲時間內(以十分之一秒為單位)沒有可"
770+
"用的輸入,讀取就會以同樣的方式失敗。"
746771

747772
#: ../../howto/curses.rst:465
748773
msgid ""
@@ -752,6 +777,10 @@ msgid ""
752777
"const:`curses.KEY_PPAGE`, :const:`curses.KEY_HOME`, or :const:`curses."
753778
"KEY_LEFT`. The main loop of your program may look something like this::"
754779
msgstr ""
780+
"諸如 Page Up、Home 或方向鍵之類的特殊按鍵,這三種方法都會回傳其中一個 :ref:"
781+
"`KEY_* 常數 <curses-key-constants>`,其值都大於 255。你可以將回傳值和諸如 :"
782+
"const:`curses.KEY_PPAGE`、:const:`curses.KEY_HOME` 或 :const:`curses."
783+
"KEY_LEFT` 之類的常數做比較。你的程式主迴圈可能會長得像這樣: ::"
755784

756785
#: ../../howto/curses.rst:473
757786
msgid ""
@@ -764,6 +793,14 @@ msgid ""
764793
" elif c == curses.KEY_HOME:\n"
765794
" x = y = 0"
766795
msgstr ""
796+
"while True:\n"
797+
" c = stdscr.get_wch()\n"
798+
" if c == 'p':\n"
799+
" PrintDocument()\n"
800+
" elif c == 'q':\n"
801+
" break # 跳出 while 迴圈\n"
802+
" elif c == curses.KEY_HOME:\n"
803+
" x = y = 0"
767804

768805
#: ../../howto/curses.rst:482
769806
msgid ""
@@ -783,6 +820,9 @@ msgid ""
783820
"and the Enter key, which terminates the line. It returns a bytes object, and "
784821
"can optionally be limited to a fixed number of bytes. ::"
785822
msgstr ""
823+
"還有一個方法可以取得整行輸入,:meth:`~curses.window.getstr`。它不常被使用,因"
824+
"為它的功能相當有限;可用的編輯按鍵只有清除字元和刪除字元,以及用來結束該行的 "
825+
"Enter 鍵。它會回傳一個 bytes 物件,也可以選擇性地限制為固定的位元組數。 ::"
786826

787827
#: ../../howto/curses.rst:496
788828
msgid ""
@@ -791,6 +831,10 @@ msgid ""
791831
"# Get a line of at most 15 bytes, with the cursor on the top line\n"
792832
"s = stdscr.getstr(0,0, 15)"
793833
msgstr ""
834+
"curses.echo() # 啟用字元回顯\n"
835+
"\n"
836+
"# 取得最多 15 個位元組的一行,游標位於頂端那一行\n"
837+
"s = stdscr.getstr(0,0, 15)"
794838

795839
#: ../../howto/curses.rst:501
796840
msgid ""

library/ast.po

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4172,14 +4172,13 @@ msgstr ""
41724172
"``type_ignores`` 屬性回傳(否則它始終是一個空串列)。"
41734173

41744174
#: ../../library/ast.rst:2258
4175-
#, fuzzy
41764175
msgid ""
41774176
"In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to "
41784177
"correspond to :pep:`484` \"signature type comments\", for example ``(str, "
41794178
"int) -> List[str]``."
41804179
msgstr ""
41814180
"此外,如果 ``mode`` 是 ``'func_type'``,則輸入語法將會依據 :pep:`484`\\ 「簽"
4182-
"名型別註解 (signature type comments)」而被修改,例如 ``(str, int) -> "
4181+
"名型別註釋 (signature type comments)」而被修改,例如 ``(str, int) -> "
41834182
"List[str]``。"
41844183

41854184
#: ../../library/ast.rst:2262

library/asyncio-dev.po

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,31 @@ msgid ""
572572
"\n"
573573
"asyncio.run(main())"
574574
msgstr ""
575+
"import asyncio\n"
576+
"work_done = False\n"
577+
"\n"
578+
"async def cursor():\n"
579+
" try:\n"
580+
" yield 1\n"
581+
" finally:\n"
582+
" assert work_done\n"
583+
"\n"
584+
"async def rows():\n"
585+
" global work_done\n"
586+
" try:\n"
587+
" yield 2\n"
588+
" finally:\n"
589+
" await asyncio.sleep(0.1) # 模擬一些非同步工作\n"
590+
" work_done = True\n"
591+
"\n"
592+
"\n"
593+
"async def main():\n"
594+
" async for c in cursor():\n"
595+
" async for r in rows():\n"
596+
" break\n"
597+
" break\n"
598+
"\n"
599+
"asyncio.run(main())"
575600

576601
#: ../../library/asyncio-dev.rst:319
577602
msgid "For this example, we get the following output::"

library/atexit.po

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,25 @@ msgid ""
3030
"called or the main module's execution completes) or, more generally, upon :"
3131
"term:`interpreter shutdown`."
3232
msgstr ""
33+
":mod:`!atexit` 模組定義了用於註冊和註銷\\ :dfn:`退出處理函式`\\ 的函式:這些"
34+
"函式會在「退出時」自動執行,也就是在程式正常終止時(例如呼叫 :func:`sys."
35+
"exit` 或主模組執行完成時),或更廣義地說,在\\ :term:`直譯器關閉 "
36+
"<interpreter shutdown>`\\ 時。"
3337

3438
#: ../../library/atexit.rst:18
35-
#, fuzzy
3639
msgid ""
3740
"At exit, all registered exit handlers are called in the *reverse* order in "
3841
"which they were registered. If you register ``A``, ``B``, and ``C``, at "
3942
"interpreter shutdown time they will be run in the order ``C``, ``B``, ``A``. "
4043
"The assumption is that lower level modules will normally be imported before "
4144
"higher level modules and thus must be cleaned up later."
4245
msgstr ""
43-
"在程式正常終止時(例如呼叫 :func:`sys.exit` 或主要模組執行完成),所有已註冊"
44-
"函式都會依照後進先出的順序呼叫。這邊做的假設是較低階的模組通常會在較高階模組"
45-
"之前被引入,因此較低階模組必須在比較後面才被清理。"
46+
"退出時,所有已註冊的退出處理函式都會按照註冊順序的\\ *反序*\\ 被呼叫。如果你"
47+
"註冊了 ``A``、``B`` 和 ``C``,則在直譯器關閉時,它們會按照 ``C``、``B``、"
48+
"``A`` 的順序執行。這邊做的假設是較低階的模組通常會在較高階模組之前被引入,因"
49+
"此較低階模組必須在比較後面才被清理。"
4650

4751
#: ../../library/atexit.rst:25
48-
#, fuzzy
4952
msgid ""
5053
"If an exception is raised during execution of an exit handler, a traceback "
5154
"is printed (unless :exc:`SystemExit` is raised) and the exception "
@@ -64,16 +67,19 @@ msgid ""
6467
"C API :c:func:`Py_EndInterpreter`). Registration functions in this module "
6568
"only affect the interpreter they are called from."
6669
msgstr ""
70+
"在使用多個直譯器的程式中,每個直譯器都有自己的退出處理函式堆疊,這些函式會在"
71+
"該直譯器關閉時執行(例如透過 :meth:`concurrent.interpreters.Interpreter."
72+
"close` 或 C API :c:func:`Py_EndInterpreter`)。此模組中的註冊函式只會影響呼叫"
73+
"它們的那個直譯器。"
6774

6875
#: ../../library/atexit.rst:37
69-
#, fuzzy
7076
msgid ""
7177
"**Note:** Exit handlers are not called when the program is killed by a "
7278
"signal not handled by Python, when a Python fatal internal error is "
7379
"detected, or when :func:`os._exit` is called."
7480
msgstr ""
75-
"**注意:**\\ 當程式被一個不是來自 Python 的訊號終止、偵測到有 Python 嚴重內部"
76-
"錯誤時或者 :func:`os._exit` 被呼叫時,透過此模組註冊的函式就不會被呼叫。"
81+
"**注意:**\\ 當程式被一個 Python 未處理的訊號終止、偵測到 Python 發生嚴重內部"
82+
"錯誤,或者 :func:`os._exit` 被呼叫時,退出處理函式就不會被呼叫。"
7783

7884
#: ../../library/atexit.rst:41
7985
msgid ""
@@ -87,39 +93,39 @@ msgid ""
8793
"that other exit handlers may still run arbitrary Python code after you clean "
8894
"up. Such code should succeed or fail with an exception, rather than crash."
8995
msgstr ""
96+
"在撰寫退出處理函式時,特別是在 C API 擴充套件中,請記住其他退出處理函式可能會"
97+
"在你清理完成之後,仍然執行任意的 Python 程式碼。這樣的程式碼應該成功執行或以"
98+
"例外表示失敗,而不是造成崩潰 (crash)。"
9099

91100
#: ../../library/atexit.rst:50
92-
#, fuzzy
93101
msgid ""
94102
"Attempts to start a new thread or :func:`os.fork` a new process in an exit "
95103
"handler now leads to :exc:`RuntimeError`. Previously, this could cause race "
96104
"conditions between the main Python runtime thread freeing thread states "
97105
"while internal :mod:`threading` routines or the new process try to use that "
98106
"state, which could lead to crashes rather than clean shutdown."
99107
msgstr ""
100-
"啟動新執行緒或從已註冊函式呼叫 :func:`os.fork` 可能會導致 Python 主要 "
101-
"runtime 執行緒釋放執行緒狀態,而內部 :mod:`threading` 例程或新行程嘗試使用該"
102-
"狀態所形成的競態條件 (race condition)。這可能會導致崩潰 (crash) 而不是完整關"
103-
"閉中止。"
108+
"在退出處理函式中嘗試啟動新執行緒或以 :func:`os.fork` 建立新行程,現在會導致"
109+
"\\ :exc:`RuntimeError`。在此之前,這可能會在 Python 主要 runtime 執行緒釋放執"
110+
"行緒狀態的同時,內部 :mod:`threading` 例程或新行程嘗試使用該狀態,兩者間形成"
111+
"競態條件 (race condition),進而導致崩潰 (crash) 而非乾淨的關閉。"
104112

105113
#: ../../library/atexit.rst:58
106-
#, fuzzy
107114
msgid ""
108115
"When used with subinterpreters, registered functions are local to the "
109116
"interpreter they were registered in."
110117
msgstr ""
111-
"當與 C-API 子直譯器 (subinterpreter) 一起使用時,已註冊函式對於它們所註冊的直"
112-
"譯器來說是區域的 (local)。"
118+
"當與子直譯器 (subinterpreter) 一起使用時,已註冊函式對於它們所註冊的直譯器來"
119+
"說是區域的 (local)。"
113120

114121
#: ../../library/atexit.rst:64
115-
#, fuzzy
116122
msgid ""
117123
"Register *func* as an exit handler. Any optional arguments that are to be "
118124
"passed to *func* must be passed as arguments to :func:`register`. It is "
119125
"possible to register the same function and arguments more than once."
120126
msgstr ""
121-
"將 *func* 註冊為要在終止時執行的函式。任何要傳遞給 *func* 的可選引數都必須作"
122-
"為引數傳遞給 :func:`register`。可以多次註冊相同的函式和引數。"
127+
"將 *func* 註冊為一個退出處理函式。任何要傳遞給 *func* 的可選引數都必須作為引"
128+
"數傳遞給 :func:`register`。可以多次註冊相同的函式和引數。"
123129

124130
#: ../../library/atexit.rst:69
125131
msgid ""
@@ -128,7 +134,6 @@ msgid ""
128134
msgstr "該函式回傳 *func*,這使得可以將其作為裝飾器使用。"
129135

130136
#: ../../library/atexit.rst:74
131-
#, fuzzy
132137
msgid ""
133138
"Remove *func* from the list of exit handlers. :func:`unregister` silently "
134139
"does nothing if *func* was not previously registered. If *func* has been "
@@ -137,10 +142,10 @@ msgid ""
137142
"internally during unregistration, so function references do not need to have "
138143
"matching identities."
139144
msgstr ""
140-
"從在直譯器中止時會執行之函式串列中刪除 *func*。如果 *func* 先前未被註冊,則 :"
141-
"func:`unregister` 不會執行任何操作。如果 *func* 已被註冊多次,則該函式在 :"
142-
"mod:`!atexit` 呼叫堆疊 (call stack) 中的所有存在都會被刪除。會在註銷期間於內"
143-
"部使用相等性比較 (``==``),因此函式參照不需要具有匹配的識別性。"
145+
"從退出處理函式串列中移除 *func*。如果 *func* 先前未被註冊,則 :func:"
146+
"`unregister` 不會執行任何操作。如果 *func* 已被註冊多次,則該函式在 :mod:`!"
147+
"atexit` 呼叫堆疊 (call stack) 中的所有存在都會被刪除。會在註銷期間於內部使用"
148+
"相等性比較 (``==``),因此函式參照不需要具有匹配的識別性。"
144149

145150
#: ../../library/atexit.rst:84
146151
msgid "Module :mod:`readline`"

library/concurrent.interpreters.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ msgstr ""
312312
msgid ""
313313
"There are a small number of Python types that actually share mutable data "
314314
"between interpreters:"
315-
msgstr ""
315+
msgstr "有少數幾種 Python 型別會實際在直譯器之間共享可變資料:"
316316

317317
#: ../../library/concurrent.interpreters.rst:200
318318
msgid ":class:`memoryview`"
@@ -417,7 +417,7 @@ msgstr ""
417417
msgid ""
418418
"Return the result of running the given function in the interpreter (in the "
419419
"current thread)."
420-
msgstr ""
420+
msgstr "回傳在該直譯器(於目前執行緒中)執行給定函式的結果。"
421421

422422
#: ../../library/concurrent.interpreters.rst:287
423423
msgid "Run the given function in the interpreter (in a new thread)."

library/curses.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,9 @@ msgid ""
12361236
"for example with :meth:`window.subwin`. By default, current locale encoding "
12371237
"is used (see :func:`locale.getencoding`)."
12381238
msgstr ""
1239+
"在未支援寬字元的建置版本中,用來編碼方法的字串引數以及解碼其回傳結果的編碼。"
1240+
"當建立子視窗時(例如透過 :meth:`window.subwin`),編碼屬性會繼承自父視窗。預"
1241+
"設情況下會使用目前的區域編碼(請參閱 :func:`locale.getencoding`)。"
12391242

12401243
#: ../../library/curses.rst:1001
12411244
msgid "Clear the window."

0 commit comments

Comments
 (0)