Skip to content

Commit 8a15a3e

Browse files
authored
Merge branch '3.14' into cron/sync/3.14
2 parents 0be299e + d99bb69 commit 8a15a3e

21 files changed

Lines changed: 542 additions & 165 deletions

‎README.rst‎

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,89 @@ reST 語法注意事項
367367
368368
以下是個程式範例: ::
369369
370+
使用 Skills 協助翻譯
371+
====================
372+
373+
本專案在 ``.claude/skills/`` 目錄底下提供三個 Skill,協助你依照\ `翻譯守則`_\ 與\
374+
`術語表 Glossary`_\ 進行翻譯與校對。
375+
376+
除了 `Claude Code <https://docs.anthropic.com/en/docs/claude-code>`_\ ,只要你使用
377+
的 coding agent 支援 Skills(``SKILL.md``\ )格式,並設定好對應的載入路徑,就能
378+
共用同一套 Skill。本專案目前已內建以下 coding agent 的設定:
379+
380+
- **Claude Code**\ :Skill 位於 ``.claude/skills/``\ ,在專案根目錄啟動時會自動\
381+
載入。
382+
- **Codex**\ :透過 ``.codex/AGENTS.md`` 以及 ``.codex/skills``\ (指向
383+
``.claude/skills/`` 的符號連結)載入相同的 Skill。
384+
385+
其他 coding agent 只要建立指向 ``.claude/skills/`` 的對應設定,即可比照使用。
386+
387+
可用的 Skill 如下:
388+
389+
- ``translate-po``\ :將 po 檔中尚未翻譯的條目由英文翻譯為臺灣繁體中文,並\
390+
遵循本專案的翻譯慣例。
391+
- ``check-terminology``\ :檢查用詞是否與術語表一致,並找出需要轉換為臺灣繁體\
392+
中文的用語。
393+
- ``validate-translation``\ :審閱已翻譯的條目,檢查用詞、標點、reST 語法與行\
394+
寬等問題。
395+
396+
事前準備
397+
--------
398+
399+
- 安裝並設定好你偏好的 coding agent(例如 `Claude Code
400+
<https://docs.anthropic.com/en/docs/claude-code>`_ 或 Codex)。
401+
- 將本專案 clone 到本機,並切換到對應的版本 branch(例如 ``3.14``\ )。
402+
- 在專案根目錄底下啟動 coding agent,Skill 才會被正確載入。
403+
404+
使用方式與範例
405+
--------------
406+
407+
在 coding agent 的對話中,以自然語言請它使用對應的 Skill 並指定要處理的 po
408+
檔即可。以下以 Claude Code 為例,示範如何翻譯 ``tutorial/introduction.po``\ ,並\
409+
校對翻譯結果(其他 coding agent 的操作方式類似)。
410+
411+
**第一步:翻譯**
412+
413+
對 coding agent 輸入類似以下的指示:
414+
415+
.. code-block:: text
416+
417+
請使用 translate-po skill 翻譯 tutorial/introduction.po 中尚未翻譯的條目
418+
419+
Skill 會找出 ``msgstr`` 為空或標記為 fuzzy 的條目,並依照翻譯守則填入譯文。
420+
例如翻譯前:
421+
422+
.. code-block:: po
423+
424+
#: ../../tutorial/introduction.rst:5
425+
msgid "An Informal Introduction to Python"
426+
msgstr ""
427+
428+
翻譯後(中英文之間會加入空白,專有名詞 ``Python`` 維持英文):
429+
430+
.. code-block:: po
431+
432+
#: ../../tutorial/introduction.rst:5
433+
msgid "An Informal Introduction to Python"
434+
msgstr "一個非正式的 Python 簡介"
435+
436+
**第二步:校對**
437+
438+
接著請 coding agent 使用 ``validate-translation`` 校對剛才的譯文:
439+
440+
.. code-block:: text
441+
442+
請使用 validate-translation skill 檢查 tutorial/introduction.po
443+
444+
Skill 會將發現的問題分類為 ERROR、WARNING、INFO 並逐項列出,例如建議執行
445+
``make lint`` 確認格式。你也可以使用 ``check-terminology`` 單獨檢查某個用詞,\
446+
或整份 po 檔的術語一致性。
447+
448+
.. note::
449+
450+
Skill 產生的譯文僅供輔助,送出 Pull Request 前請務必人工確認每一條翻譯是否\
451+
正確、是否符合\ `翻譯守則`_\ 。
452+
370453
術語表 Glossary
371454
===============
372455

‎bugs.po‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ msgid ""
261261
"any and all questions pertaining to the process of fixing issues in Python."
262262
msgstr ""
263263
"除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。"
264-
"你可以在 `Python 開發者指南`_\\ 中找到如何開始修補 Python 的更多資訊。如果你"
265-
"有任何問題,`核心導師郵寄清單`_\\ 是一個友善的地方,你可以在那裡得到,關於 "
266-
"Python 修正錯誤的過程中,所有問題的答案。"
264+
"你可以在 `Python 開發者指南 <Python Developer's Guide_>`_\\ "
265+
"中找到如何開始修補 Python 的更多資訊。如果你有任何問題,"
266+
"`核心導師郵寄清單 <core-mentorship mailing list_>`_\\ "
267+
"是個友善的地方,任何關於修正 Python 問題之流程的疑問,都能在那裡得到解答。"

‎faq/design.po‎

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: Python 3.14\n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2026-09-04 00:18+0000\n"
12+
"POT-Creation-Date: 2026-09-13 20:11+0800\n"
1313
"PO-Revision-Date: 2023-08-31 11:34+0800\n"
1414
"Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -523,6 +523,11 @@ msgid ""
523523
"statements. An older alternative is a sequence of ``if... elif... elif... "
524524
"else``."
525525
msgstr ""
526+
"一般來說,結構化的 switch 陳述式會在運算式具有特定值或一組值時,執行一個程式"
527+
"碼區塊。從 Python 3.10 開始,可以使用 ``match ... case`` 陳述式來匹配字面值,"
528+
"或命名空間中的常數。更多關於 :keyword:`match` 陳述式的資訊,請參閱\\ :ref:`規"
529+
"格說明 <match>`\\ 和\\ :ref:`教學 <tut-match>`。較舊的替代方案是一連串的 "
530+
"``if... elif... elif... else``。"
526531

527532
#: ../../faq/design.rst:270
528533
msgid ""
@@ -540,10 +545,12 @@ msgid ""
540545
"func = functions[value]\n"
541546
"func()"
542547
msgstr ""
543-
"if key in mydict:\n"
544-
" value = mydict[key]\n"
545-
"else:\n"
546-
" value = mydict[key] = getvalue(key)"
548+
"functions = {'a': function_1,\n"
549+
" 'b': function_2,\n"
550+
" 'c': self.method_1}\n"
551+
"\n"
552+
"func = functions[value]\n"
553+
"func()"
547554

548555
#: ../../faq/design.rst:281
549556
msgid ""
@@ -588,6 +595,8 @@ msgid ""
588595
"Imitating switch with fallthrough, as with C's switch-case-default, is "
589596
"possible, much harder, and less needed."
590597
msgstr ""
598+
"模仿具有穿透 (fallthrough) 特性的 switch 雖然可行(就像 C 的 switch-case-"
599+
"default 一樣),但實作起來較為困難,實用性也不高。"
591600

592601
#: ../../faq/design.rst:302
593602
msgid ""
@@ -878,7 +887,7 @@ msgstr ""
878887
#: ../../faq/design.rst:448
879888
msgid ""
880889
"See :ref:`time-complexity` for the costs of the various list operations."
881-
msgstr ""
890+
msgstr "各種串列操作的時間複雜度請參閱 :ref:`time-complexity`。"
882891

883892
#: ../../faq/design.rst:454
884893
msgid "How are dictionaries implemented in CPython?"
@@ -916,7 +925,7 @@ msgstr ""
916925
msgid ""
917926
"See :ref:`time-complexity` for the costs of the various dictionary "
918927
"operations."
919-
msgstr ""
928+
msgstr "各種字典操作的時間複雜度請參閱 :ref:`time-complexity`。"
920929

921930
#: ../../faq/design.rst:473
922931
msgid "Why must dictionary keys be immutable?"
@@ -1129,6 +1138,8 @@ msgid ""
11291138
"for key in sorted(mydict):\n"
11301139
" ... # do whatever with mydict[key]..."
11311140
msgstr ""
1141+
"for key in sorted(mydict):\n"
1142+
" ... # do whatever with mydict[key]..."
11321143

11331144
#: ../../faq/design.rst:574
11341145
msgid "How do you specify and enforce an interface spec in Python?"
@@ -1255,6 +1266,15 @@ msgid ""
12551266
" pass\n"
12561267
"..."
12571268
msgstr ""
1269+
"class label(Exception): pass # 宣告一個標籤\n"
1270+
"\n"
1271+
"try:\n"
1272+
" ...\n"
1273+
" if condition: raise label() # goto 標籤\n"
1274+
" ...\n"
1275+
"except label: # 跳轉目標\n"
1276+
" pass\n"
1277+
"..."
12581278

12591279
#: ../../faq/design.rst:640
12601280
msgid ""
@@ -1299,7 +1319,7 @@ msgstr ""
12991319

13001320
#: ../../faq/design.rst:661
13011321
msgid "f = open(\"/mydir/file.txt\") # works fine!"
1302-
msgstr ""
1322+
msgstr "f = open(\"/mydir/file.txt\") # 正常運作!"
13031323

13041324
#: ../../faq/design.rst:663
13051325
msgid ""
@@ -1312,6 +1332,9 @@ msgid ""
13121332
"dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n"
13131333
"dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\""
13141334
msgstr ""
1335+
"dir = r\"\\this\\is\\my\\dos\\dir\" \"\\\\\"\n"
1336+
"dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n"
1337+
"dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\""
13151338

13161339
#: ../../faq/design.rst:671
13171340
msgid "Why doesn't Python have a \"with\" statement for attribute assignments?"
@@ -1332,6 +1355,9 @@ msgid ""
13321355
" a = 1 # equivalent to obj.a = 1\n"
13331356
" total = total + 1 # obj.total = obj.total + 1"
13341357
msgstr ""
1358+
"with obj:\n"
1359+
" a = 1 # 等同於 obj.a = 1\n"
1360+
" total = total + 1 # obj.total = obj.total + 1"
13351361

13361362
#: ../../faq/design.rst:681
13371363
msgid "In Python, such a construct would be ambiguous."
@@ -1527,6 +1553,12 @@ msgid ""
15271553
" \"B\": [6, 7], # last trailing comma is optional but good style\n"
15281554
"}"
15291555
msgstr ""
1556+
"[1, 2, 3,]\n"
1557+
"('a', 'b', 'c',)\n"
1558+
"d = {\n"
1559+
" \"A\": [1, 5],\n"
1560+
" \"B\": [6, 7], # 最尾的逗號是可選的,但符合良好的規範\n"
1561+
"}"
15301562

15311563
#: ../../faq/design.rst:775
15321564
msgid "There are several reasons to allow this."

0 commit comments

Comments
 (0)