Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf4f85e

Browse files
authored
Merge branch '3.13' into library/contextvars
2 parents1d03bdd +0b2c140 commitaf4f85e

File tree

200 files changed

+11629
-9685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+11629
-9685
lines changed

‎.github/workflows/summarize_progress.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name:summarize_progress
22

33
on:
4+
workflow_dispatch:
45
schedule:
56
-cron:'30 23 * * 5'
67

@@ -37,7 +38,7 @@ jobs:
3738
shell:bash
3839

3940
-name:Commit wiki code
40-
uses:stefanzweifel/git-auto-commit-action@v5
41+
uses:stefanzweifel/git-auto-commit-action@v6
4142
with:
4243
commit_message:Weekly Update -- Summarize Progress
43-
repository:markdown
44+
repository:markdown

‎.scripts/google_translate/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
'變量':'變數',# variable
4747
'常量':'常數',# constant
4848
'添加':'新增',# add
49+
'轉義':'跳脫',# escape
4950
'基類':'基底類別',# base class
5051
}
5152

‎.scripts/summarize_progress/main.py

Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,6 @@
66
frompathlibimportPath
77

88

9-
defentry_check(pofile:polib.POFile)->str:
10-
'''
11-
Check the po file with how many entries are translated or not.
12-
'''
13-
14-
lines_tranlated=len(pofile.translated_entries())
15-
lines_untranlated=len(pofile.untranslated_entries())
16-
17-
iflines_tranlated==0:
18-
result="❌"
19-
eliflines_untranlated==0:
20-
result="✅"
21-
else:
22-
lines_all=lines_tranlated+lines_untranlated
23-
progress=lines_tranlated/lines_all
24-
progress_percentage=round(progress*100,2)
25-
result=f"{progress_percentage} %"
26-
27-
returnresult
28-
29-
309
defget_open_issues_count()->int:
3110
'''
3211
Fetch GitHub API to get the number of OPEN ISSUES.
@@ -89,20 +68,23 @@ def get_github_issues() -> list:
8968

9069

9170
defformat_line_table_header()->list:
92-
return [f"|Filename|Progress|Issue|Assignee|\r\n",
71+
return [f"|Filename|Progress (#string)|Issue|Assignee|\r\n",
9372
f"|-------:|:-------|:----|:-------|\r\n"]
9473

9574

96-
defformat_issue_link(url:str)->str:
97-
returnf"[{url.split('/')[-1]}]({url})"iflen(url)>0else''
98-
99-
100-
defformat_line_file(filename:str,data:dict)->str:
101-
returnf"|`{filename}`|{data['progress']}|{format_issue_link(data['issue'])}|{data['assignee']}|\r\n"
75+
defformat_line_po_issue_display(issue_link:str,issue_number:str,progress:float,create_issue_link:str)->str:
76+
ifissue_link:
77+
returnf"[{issue_number}]({issue_link})"
78+
ifprogress!=100.:
79+
returnf"[create issue]({create_issue_link})"
80+
return""
10281

10382

104-
defformat_line_directory(dirname:str)->str:
105-
returnf"##{dirname}\r\n"
83+
defformat_line_po(filename:str,po_link:str,progress:str,num_entries:str,issue_display:str,assignee:str)->str:
84+
progress_display=f"{progress} %"
85+
ifprogress==100:
86+
progress_display="✅"
87+
returnf"|[`{filename}`]({po_link})|{progress_display} ({num_entries:,})|{issue_display}|{assignee}|\r\n"
10688

10789

10890
if__name__=="__main__":
@@ -117,11 +99,17 @@ def format_line_directory(dirname: str) -> str:
11799
forfilepathinglob.glob(str(BASE_DIR/"**/*.po"),recursive=True):
118100
path=Path(filepath)
119101
filename=path.name
120-
dirname=path.parent.nameifpath.parent.name!=BASE_DIR.nameelse'/'
102+
dirname=path.parent.nameifpath.parent.name!=BASE_DIR.nameelse'root'
121103
po=polib.pofile(filepath)
122104

105+
num_entries=len(list(filter(lambdae:note.obsolete,po)))
106+
num_translated=len(po.translated_entries())
123107
summary.setdefault(dirname, {})[filename]= {
124-
'progress':entry_check(po),
108+
'po_info': {
109+
'num_entries':num_entries,
110+
'num_translated':num_translated,
111+
'progress':round(num_translated/num_entries*100,2),
112+
},
125113
'issue':'',
126114
'assignee':'',
127115
}
@@ -137,25 +125,47 @@ def format_line_directory(dirname: str) -> str:
137125
pass
138126

139127
'''
140-
Adding Space for Formatting Markdown Link
141-
'''
142-
143-
'''
144-
Format the lines that will write into the markdown file,
128+
Format the lines that will be written into the markdown file,
145129
also sort the directory name and file name.
146130
'''
147131
writeliner= []
148132
summary_sorted=dict(sorted(summary.items()))
133+
total_entries,total_translated=0,0
149134
fordirname,filedictinsummary_sorted.items():
150-
writeliner.append(format_line_directory(dirname))
151-
writeliner.extend(format_line_table_header())
152-
135+
dir_total_entries,dir_total_translated=0,0
136+
lines= []
153137
filedict_sorted=dict(sorted(filedict.items()))
154138
forfilename,filedatainfiledict_sorted.items():
155-
writeliner.append(format_line_file(filename,filedata))
139+
file_path=f"{dirname}/{filename}"ifdirnameelsefilename
140+
po_link=f"https://github.com/python/python-docs-zh-tw/tree/3.13/{file_path}"
141+
issue_link=filedata['issue']
142+
issue_number=f"#{issue_link.split('/')[-1]}"
143+
create_issue_link=f"https://github.com/python/python-docs-zh-tw/issues/new?title=Translate%20`{file_path}`"
144+
issue_display=format_line_po_issue_display(issue_link,issue_number,filedata['po_info']['progress'],create_issue_link)
145+
line_po=format_line_po(
146+
filename,
147+
po_link,
148+
filedata['po_info']['progress'],
149+
filedata['po_info']['num_entries'],
150+
issue_display,
151+
filedata['assignee'],
152+
)
153+
lines.append(line_po)
154+
155+
dir_total_entries+=filedata['po_info']['num_entries']
156+
dir_total_translated+=filedata['po_info']['num_translated']
157+
158+
dir_progress=round(dir_total_translated/dir_total_entries*100,2)
159+
writeliner.append(f"##{dirname} ({dir_progress}%)\r\n")
160+
writeliner.extend(format_line_table_header())
161+
writeliner.extend(lines)
162+
163+
total_entries+=dir_total_entries
164+
total_translated+=dir_total_translated
165+
166+
overall_progress=round(total_translated/total_entries*100,2)
167+
title=f"## Overall Progress:{overall_progress}% ({total_translated:,} /{total_entries:,})\r\n"
168+
writeliner= [title]+writeliner
156169

157-
withopen(
158-
f"summarize_progress/result.md",
159-
"w",
160-
)asfile:
170+
withopen(f"summarize_progress/result.md","w")asfile:
161171
file.writelines(writeliner)

‎README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ the PSF for inclusion in the documentation.
5252
請注意此予翻譯專案的授權:Python 的說明文件是以全球的志工社群來維護。透過張貼\
5353
此專案在 Transifex、GitHub 以及其他公眾場合,以及邀請你參與,我們向你提出一個\
5454
協議:你必須將你對於 Python 說明文件或是 Python 說明文件翻譯的貢獻以 CC0\
55-
(請參考 https://creativecommons.org/publicdomain/zero/1.0/legalcode/
55+
(請參考 https://creativecommons.org/publicdomain/zero/1.0/legalcode/
5656
)的方式授權給 PSF 使用。你可以公開地聲明你所貢獻翻譯的部分,並且如果你的翻譯被 PSF
5757
採用,你可以(但並不須要)送出一個修改,其包含在 Misc/ACKS 或是 TRANSLATORS
5858
檔案裡增加合適的注釋。雖然這個說明文件貢獻協議並沒有說明 PSF 有義務納入你的\

‎TERMINOLOGY_DICTIONARY.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#Python Documentation Translation Dictionary
2+
3+
This document describes the terminology dictionaries for maintaining translation consistency across the Python documentation project.
4+
5+
##Overview
6+
7+
The translation dictionary project provides curated key terms and their translations to help translators maintain consistent terminology usage across different documents. The dictionaries are maintained using LLM knowledge to identify and categorize important Python terminology.
8+
9+
##Generated Files
10+
11+
###terminology_dictionary.csv
12+
The complete terminology dictionary containing important terms identified from Python documentation. Contains:
13+
-**source_term**: The original English term
14+
-**translated_term**: The corresponding Chinese (Traditional) translation
15+
-**frequency**: Number of occurrences across all files
16+
-**files_count**: Number of different files containing this term
17+
-**source_file**: Example file where this term was found
18+
-**directory**: Directory of the source file
19+
-**example_files**: List of up to 5 files containing this term
20+
21+
Total entries:~196 essential Python terms
22+
23+
###focused_terminology_dictionary.csv
24+
A curated subset of~118 terms focusing on the most important Python terminology. Includes additional columns:
25+
-**priority**: High/Medium priority classification
26+
-**category**: Term classification
27+
28+
####Categories:
29+
-**Core Concepts** (7 terms): class, function, method, module, package, object, type
30+
-**Built-in Types** (9 terms): int, str, list, dict, tuple, set, float, bool, complex
31+
-**Keywords/Constants** (25 terms): None, True, False, return, import, def, async, await, and other Python keywords
32+
-**Exceptions** (29 terms): Common*Error and*Exception classes
33+
-**Code Elements** (14 terms): Magic methods like__init__,__str__, etc.
34+
-**Common Terms** (34 terms): Important technical concepts like decorator, generator, iterator
35+
36+
##Maintenance
37+
38+
The terminology dictionaries are maintained using LLM knowledge to identify important Python terms and their translations. The dictionaries can be updated as needed to reflect new terminology or improved translations.
39+
40+
##Integration with Translation Workflow
41+
42+
###For New Translators
43+
1. Start with`focused_terminology_dictionary.csv`
44+
2. Learn standard translations for core Python concepts
45+
3. Reference high-frequency terms for consistency
46+
47+
###For Translation Review
48+
1. Check new translations against the dictionary
49+
2. Verify consistent terminology usage
50+
3. Update dictionary when establishing new standard translations
51+
52+
###For Project Management
53+
1. Track translation progress for key technical terms
54+
2. Identify terminology needing standardization
55+
3. Prioritize translation efforts using frequency data
56+
57+
###Output Format
58+
CSV files use UTF-8 encoding to properly handle Chinese characters. Compatible with Excel, Google Sheets, and other spreadsheet applications.
59+
60+
##Maintenance
61+
62+
###Adding New Terms
63+
New terms can be identified and added based on:
64+
- Frequency of appearance in documentation
65+
- Importance to Python concepts
66+
- Consistency needs across translation files
67+
68+
###Manual Curation Process
69+
The dictionaries are maintained through careful analysis of:
70+
- Core Python terminology in official documentation
71+
- Existing translation patterns in .po files
72+
- Category-based organization for translator efficiency
73+
74+
###Quality Assurance
75+
- Regular review of term translations for consistency
76+
- Cross-reference with official Python terminology
77+
- Validation against established translation conventions
78+
79+
This documentation provides comprehensive guidance for maintaining and using the translation dictionary system to ensure consistent, high-quality Python documentation translation.

‎TRANSLATORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Steven Hsu (StevenHsuYL)
1818
Taihsiang Ho (tai271828)
1919
Tsai, Chia-Wen
2020
Wei-Hsiang (Matt) Wang
21+
Weilin Du (LamentXU)
2122
Wilson Wang (Josix)
2223
Yu Chun Yang
2324
Jason (chairco)

‎c-api/allocation.po

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2001-2024, Python Software Foundation
1+
# Copyright (C) 2001-2025, Python Software Foundation
22
# This file is distributed under the same license as the Python package.
33
#
44
# Translators:
@@ -62,6 +62,8 @@ msgid ""
6262
"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_New` "
6363
"instead."
6464
msgstr""
65+
"注意,如果 *typeobj* 有 :c:macro:`Py_TPFLAGS_HAVE_GC` 設定,則此函式不適用。"
66+
"對於這種物件,請改用 :c:func:`PyObject_GC_New`。"
6567

6668
#:../../c-api/allocation.rst:45
6769
msgid""
@@ -88,6 +90,8 @@ msgid ""
8890
"`Py_TPFLAGS_HAVE_GC` set. For such objects, use :c:func:`PyObject_GC_NewVar` "
8991
"instead."
9092
msgstr""
93+
"注意,如果 *typeobj* 有 :c:macro:`Py_TPFLAGS_HAVE_GC` 設定,則此函式不適用。"
94+
"對於這種物件,請改用 :c:func:`PyObject_GC_NewVar`。"
9195

9296
#:../../c-api/allocation.rst:63
9397
msgid""

‎c-api/bool.po

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2022, Python Software Foundation
1+
# Copyright (C) 2001-2025, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
43
#
54
# Translators:
@@ -42,6 +41,8 @@ msgid ""
4241
"This instance of :c:type:`PyTypeObject` represents the Python boolean type; "
4342
"it is the same object as :class:`bool` in the Python layer."
4443
msgstr""
44+
"此 :c:type:`PyTypeObject` 實例代表 Python 的布林型別;它與 Python 層級中的 "
45+
":class:`bool` 是同一個物件。"
4546

4647
#:../../c-api/bool.rst:22
4748
msgid""

‎c-api/bytearray.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ msgid ""
6565
"Return a new bytearray object from any object, *o*, that implements the :ref:"
6666
"`buffer protocol <bufferobjects>`."
6767
msgstr""
68-
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協議 (buffer "
68+
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協定 (buffer "
6969
"protocol) <bufferobjects>`。"
7070

7171
#:../../c-api/bytearray.rst:45../../c-api/bytearray.rst:52

‎c-api/call.po

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2001-2023, Python Software Foundation
1+
# Copyright (C) 2001-2025, Python Software Foundation
22
# This file is distributed under the same license as the Python package.
33
#
44
# Translators:
@@ -122,6 +122,11 @@ msgid ""
122122
"versions, vectorcall should only be used with :c:macro:`immutable "
123123
"<Py_TPFLAGS_IMMUTABLETYPE>` or static types."
124124
msgstr""
125+
"當一個類別的 :py:meth:`~object.__call__` 方法被重新賦值時,:c:macro:"
126+
"`Py_TPFLAGS_HAVE_VECTORCALL` 旗標現在會被移除。(這會在內部設定 :c:member:"
127+
"`~PyTypeObject.tp_call`,因此可能會使它與 vectorcall 函式有不同的行為。)"
128+
"在較早的 Python 版本中,vectorcall 應該只與 :c:macro:"
129+
"`immutable <Py_TPFLAGS_IMMUTABLETYPE>` 或靜態型別一起使用。"
125130

126131
#:../../c-api/call.rst:69
127132
msgid""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp