Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 116574e

Browse files
authored
Merge branch 'python:3.12' into 3.12
2 parents 8b4598f + 3d1b20d commit 116574e

Some content is hidden

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

102 files changed

+9266
-9005
lines changed

.scripts/summarize_progress/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def get_github_issues() -> list:
7777
match = re.search("(?P<dirname>[^\s`][a-zA-z-]+)/(?P<filename>[a-zA-Z0-9._-]+(.po)?)", title)
7878
if not match:
7979
continue
80-
80+
8181
dirname, filename = match.group('dirname', 'filename')
8282
if not filename.endswith('.po'):
8383
filename += '.po'
@@ -98,7 +98,7 @@ def format_line_directory(dirname: str) -> str:
9898
issue_list = get_github_issues()
9999

100100
'''
101-
Search all the po file in the directory,
101+
Search all the po file in the directory,
102102
and record the translation progress of each files.
103103
'''
104104
BASE_DIR = Path("../")

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,16 @@ $(VENV)/bin/activate:
6969
$(VENV)/bin/sphinx-build: $(VENV)/bin/activate
7070
. $(VENV)/bin/activate; python3 -m pip install sphinx python-docs-theme
7171

72+
$(VENV)/bin/sphinx-lint: $(VENV)/bin/activate
73+
. $(VENV)/bin/activate; python3 -m pip install sphinx-lint
7274

7375
$(VENV)/bin/blurb: $(VENV)/bin/activate
7476
. $(VENV)/bin/activate; python3 -m pip install blurb
7577

7678

7779
.PHONY: upgrade_venv
7880
upgrade_venv: $(VENV)/bin/activate ## Upgrade the venv that compiles the doc
79-
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx python-docs-theme blurb
81+
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx python-docs-theme blurb sphinx-lint
8082

8183

8284
.PHONY: progress
@@ -127,3 +129,7 @@ fuzzy: ## Find fuzzy strings
127129
.PHONY: rm_cpython
128130
rm_cpython: ## Remove cloned cpython repo
129131
rm -rf $(CPYTHON_CLONE)
132+
133+
.PHONY: lint
134+
lint: $(VENV)/bin/sphinx-lint ## Run sphinx-lint
135+
$(VENV)/bin/sphinx-lint --enable default-role

README.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ the PSF for inclusion in the documentation.
123123
.. _GitHub Flow: https://guides.github.com/introduction/flow/
124124

125125
首先,`新增一個 issue <https://github.com/python/python-docs-zh-tw/issues>`_\
126-
,如:「翻譯 tutorial/introduction.po」,讓大家知道你正在翻譯這個檔案。可以使用 `make todo` 列出尚待翻譯的檔案。
126+
,如:「翻譯 tutorial/introduction.po」,讓大家知道你正在翻譯這個檔案。可以使用 ``make todo`` 列出尚待翻譯的檔案。
127127

128128
接著在 terminal 裡按照以下步驟:
129129

@@ -138,12 +138,18 @@ the PSF for inclusion in the documentation.
138138

139139
poedit glossary.po
140140

141-
3. 存檔以後,執行以下列指令編譯輸出文件,以確保你的修改沒有 rST 的語法錯誤或警告 ::
141+
3. 存檔以後,執行以下列指令編譯輸出完整文件,以確保你的修改沒有 reST 的語法錯誤或警告 ::
142142

143143
VERSION=3.12 make all
144144

145+
或者只想快速檢查是否有 reST 語法錯誤 ::
146+
147+
VERSION=3.12 make lint
148+
149+
確保輸出中沒有任何關於正在翻譯的檔案的警告訊息。
150+
145151
如果你還沒有執行 `維護、預覽`_ 的 clone CPython 的動作,此指令會自動幫你 clone CPython,\
146-
並且會使用 Sphinx 幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning \
152+
並且會使用 Sphinx 幫你檢查 reST 語法錯誤,我們盡量保持沒有 warning \
147153
的狀態,因此如果有出現 warning 的話請修復它。另外也記得檢查是否符合\
148154
`翻譯守則`_
149155

@@ -252,11 +258,11 @@ po 檔皆為首要的翻譯對象。你也可以幫忙校對已經翻譯過的
252258
- 在本情況使用 ``zip(*[iter(x)]*n)`` 是很常見的情況(Python 慣例)。
253259
- 在超文件標示語言 (HTML) 中應注意跳脫符號。
254260

255-
rST 語法注意事項
261+
reST 語法注意事項
256262
----------------
257263

258-
- ``:xxx:`...``` 即為 rST 的語法,應該在譯文中保留。
259-
- rST 諸多語法需要保留前後的空白。在中文裡,該空白可以用 :literal:`\\\ \ `
264+
- ``:xxx:`...``` 即為 reST 的語法,應該在譯文中保留。
265+
- reST 諸多語法需要保留前後的空白。在中文裡,該空白可以用 :literal:`\\\ \ `
260266
來取代,製造一個沒有寬度的分隔符號。
261267

262268
例如:
@@ -322,8 +328,8 @@ rST 語法注意事項
322328
術語表 Glossary
323329
===============
324330

325-
為了讓翻譯保持統一,我們整理了一份 `術語列表
326-
<https://github.com/python/python-docs-zh-tw/wiki/%E8%A1%93%E8%AA%9E%E5%88%97%E8%A1%A8>`_ \
331+
為了讓翻譯保持統一,我們整理了一份 \
332+
`術語列表 <https://github.com/python/python-docs-zh-tw/wiki/%E8%A1%93%E8%AA%9E%E5%88%97%E8%A1%A8>`_ \
327333
如果翻譯過程中你覺得需要術語列表有所缺漏,請至 `Discussion \
328334
<https://github.com/python/python-docs-zh-tw/discussions>`_ 開啟新的討論補充術語。\
329335
新增的術語,將會於每次 Sprint 中共同討論是否合併進術語列表。

c-api/bytearray.po

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ msgid ""
3333
"This instance of :c:type:`PyTypeObject` represents the Python bytearray "
3434
"type; it is the same object as :class:`bytearray` in the Python layer."
3535
msgstr ""
36-
"這個 :c:type:`PyTypeObject` 的實例代表了 Python 的位元組陣列型別;在 Python "
37-
"中的 :class:`bytearray` 為同一個物件。"
36+
"這個 :c:type:`PyTypeObject` 的實例代表了 Python 的位元組陣列型別;在 Python "
37+
"層中的 :class:`bytearray` 為同一個物件。"
3838

3939
#: ../../c-api/bytearray.rst:23
4040
msgid "Type check macros"
@@ -45,16 +45,16 @@ msgid ""
4545
"Return true if the object *o* is a bytearray object or an instance of a "
4646
"subtype of the bytearray type. This function always succeeds."
4747
msgstr ""
48-
"如果物件 *o* 是一個位元組陣列物件,或者是位元組陣列型別的子型別的實例,則回傳真"
49-
"。此函式總是會成功執行。"
48+
"如果物件 *o* 是一個位元組陣列物件,或者是位元組陣列型別的子型別的實例,則回傳"
49+
"真值。此函式總是會成功執行。"
5050

5151
#: ../../c-api/bytearray.rst:33
5252
msgid ""
5353
"Return true if the object *o* is a bytearray object, but not an instance of "
5454
"a subtype of the bytearray type. This function always succeeds."
5555
msgstr ""
56-
"如果物件 *o* 是一個位元組陣列物件,但不是位元組陣列型別的子型別的實例,則回傳真"
57-
"。此函式總是會成功執行。"
56+
"如果物件 *o* 是一個位元組陣列物件,但不是位元組陣列型別的子型別的實例,則回傳"
57+
"真值。此函式總是會成功執行。"
5858

5959
#: ../../c-api/bytearray.rst:38
6060
msgid "Direct API functions"
@@ -73,7 +73,8 @@ msgid ""
7373
"Create a new bytearray object from *string* and its length, *len*. On "
7474
"failure, ``NULL`` is returned."
7575
msgstr ""
76-
"從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。若失敗則回傳 ``NULL``。"
76+
"從 *string* 及其長度 *len* 建立一個新的位元組陣列物件。若失敗則回傳 "
77+
"``NULL``。"
7778

7879
#: ../../c-api/bytearray.rst:54
7980
msgid ""

c-api/complex.po

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ msgid ""
4343
"return them as results do so *by value* rather than dereferencing them "
4444
"through pointers. This is consistent throughout the API."
4545
msgstr ""
46-
"請注意,接受這些結構作為參數並將它們作為結果回傳的函式是\\ *按值 (by "
47-
"value)* 執行的,而不是透過指標取消參照 (dereference) 它們。這在整個 API "
48-
"都是一致的。"
46+
"請注意,接受這些結構作為參數並將它們作為結果回傳的函式是\\ *按值 (by value)* "
47+
"執行的,而不是透過指標取消參照 (dereference) 它們。這在整個 API 中都是一致"
48+
"。"
4949

5050
#: ../../c-api/complex.rst:26
5151
msgid ""
@@ -73,7 +73,8 @@ msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳兩個複數間的
7373
msgid ""
7474
"Return the negation of the complex number *num*, using the C :c:type:"
7575
"`Py_complex` representation."
76-
msgstr "以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。"
76+
msgstr ""
77+
"以 C 的 :c:type:`Py_complex` 表示形式來回傳複數 *num* 的相反數 (negation)。"
7778

7879
#: ../../c-api/complex.rst:57
7980
msgid ""

c-api/datetime.po

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ msgstr ""
3939
":mod:`datetime` 模組提供各種日期和時間物件。在使用任何這些函式之前,必須將標"
4040
"頭檔 :file:`datetime.h` 引入於原始碼中(請注意,:file:`Python.h` 並無引入該標"
4141
"頭檔),且巨集 :c:macro:`!PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始"
42-
"化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:"
43-
"`!PyDateTimeAPI` 中,該變數會被以下巨集使用。"
42+
"化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:`!"
43+
"PyDateTimeAPI` 中,該變數會被以下巨集使用。"
4444

4545
#: ../../c-api/datetime.rst:18
4646
msgid "This subtype of :c:type:`PyObject` represents a Python date object."
@@ -112,9 +112,9 @@ msgid ""
112112
"of :c:data:`!PyDateTime_DateType`. *ob* must not be ``NULL``. This "
113113
"function always succeeds."
114114
msgstr ""
115-
"如果 *ob* 的型別為 :c:data:`PyDateTime_DateType` 或 :c:data:"
116-
"`!PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式"
117-
"一定會執行成功。"
115+
"如果 *ob* 的型別為 :c:data:`PyDateTime_DateType` 或 :c:data:`!"
116+
"PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式一"
117+
"定會執行成功。"
118118

119119
#: ../../c-api/datetime.rst:80
120120
msgid ""
@@ -130,8 +130,8 @@ msgid ""
130130
"subtype of :c:data:`!PyDateTime_DateTimeType`. *ob* must not be ``NULL``. "
131131
"This function always succeeds."
132132
msgstr ""
133-
"如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType` 或 :c:data:"
134-
"`!PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函"
133+
"如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType` 或 :c:data:`!"
134+
"PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函"
135135
"式一定會執行成功。"
136136

137137
#: ../../c-api/datetime.rst:93
@@ -148,8 +148,8 @@ msgid ""
148148
"of :c:data:`!PyDateTime_TimeType`. *ob* must not be ``NULL``. This "
149149
"function always succeeds."
150150
msgstr ""
151-
"如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType` 或 :c:data:"
152-
"`!PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一"
151+
"如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType` 或 :c:data:`!"
152+
"PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一"
153153
"定會執行成功。"
154154

155155
#: ../../c-api/datetime.rst:106
@@ -166,9 +166,9 @@ msgid ""
166166
"of :c:data:`!PyDateTime_DeltaType`. *ob* must not be ``NULL``. This "
167167
"function always succeeds."
168168
msgstr ""
169-
"如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType` 或 :c:data:"
170-
"`!PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式"
171-
"一定會執行成功。"
169+
"如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType` 或 :c:data:`!"
170+
"PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一"
171+
"定會執行成功。"
172172

173173
#: ../../c-api/datetime.rst:119
174174
msgid ""
@@ -184,8 +184,8 @@ msgid ""
184184
"of :c:data:`!PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This "
185185
"function always succeeds."
186186
msgstr ""
187-
"如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType` 或 :c:data:"
188-
"`!PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式"
187+
"如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType` 或 :c:data:`!"
188+
"PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式"
189189
"一定會執行成功。"
190190

191191
#: ../../c-api/datetime.rst:132

c-api/frame.po

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
11+
"POT-Creation-Date: 2023-12-06 00:03+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -19,15 +19,15 @@ msgstr ""
1919

2020
#: ../../c-api/frame.rst:4
2121
msgid "Frame Objects"
22-
msgstr ""
22+
msgstr "Frame 物件"
2323

2424
#: ../../c-api/frame.rst:8
2525
msgid "The C structure of the objects used to describe frame objects."
26-
msgstr ""
26+
msgstr "用來描述 frame 物件的 C 結構。"
2727

2828
#: ../../c-api/frame.rst:10
2929
msgid "There are no public members in this structure."
30-
msgstr ""
30+
msgstr "在這個結構中沒有公開的成員。"
3131

3232
#: ../../c-api/frame.rst:12
3333
msgid ""
@@ -76,20 +76,20 @@ msgid ""
7676
msgstr ""
7777

7878
#: ../../c-api/frame.rst:53
79-
msgid "Get the *frame*'s ``f_builtins`` attribute."
80-
msgstr ""
79+
msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute."
80+
msgstr "取得 *frame* 的 :attr:`~frame.f_builtins` 屬性。"
8181

8282
#: ../../c-api/frame.rst:55 ../../c-api/frame.rst:86
8383
msgid "Return a :term:`strong reference`. The result cannot be ``NULL``."
84-
msgstr ""
84+
msgstr "回傳 :term:`strong reference`。結果不能為 ``NULL``。"
8585

8686
#: ../../c-api/frame.rst:62
8787
msgid "Get the *frame* code."
8888
msgstr ""
8989

9090
#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:125
9191
msgid "Return a :term:`strong reference`."
92-
msgstr ""
92+
msgstr "回傳 :term:`strong reference`。"
9393

9494
#: ../../c-api/frame.rst:66
9595
msgid "The result (frame code) cannot be ``NULL``."
@@ -104,40 +104,40 @@ msgstr ""
104104

105105
#: ../../c-api/frame.rst:77
106106
msgid "Return a :term:`strong reference`, or ``NULL``."
107-
msgstr ""
107+
msgstr "回傳 :term:`strong reference` 或 ``NULL``。"
108108

109109
#: ../../c-api/frame.rst:84
110-
msgid "Get the *frame*'s ``f_globals`` attribute."
111-
msgstr ""
110+
msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute."
111+
msgstr "取得 *frame* 的 :attr:`~frame.f_globals` 屬性。"
112112

113113
#: ../../c-api/frame.rst:93
114-
msgid "Get the *frame*'s ``f_lasti`` attribute."
115-
msgstr ""
114+
msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute."
115+
msgstr "取得 *frame* 的 :attr:`~frame.f_lasti` 屬性。"
116116

117117
#: ../../c-api/frame.rst:95
118118
msgid "Returns -1 if ``frame.f_lasti`` is ``None``."
119-
msgstr ""
119+
msgstr "如果 ``frame.f_lasti`` 是 ``None`` 則回傳 -1。"
120120

121121
#: ../../c-api/frame.rst:102
122122
msgid "Get the variable *name* of *frame*."
123-
msgstr ""
123+
msgstr "取得 *frame* 的變數 *name*。"
124124

125125
#: ../../c-api/frame.rst:104
126126
msgid "Return a :term:`strong reference` to the variable value on success."
127-
msgstr ""
127+
msgstr "在成功時回傳變數值的 :term:`strong reference`。"
128128

129129
#: ../../c-api/frame.rst:105
130130
msgid ""
131131
"Raise :exc:`NameError` and return ``NULL`` if the variable does not exist."
132-
msgstr ""
132+
msgstr "如果變數不存在,則引發 :exc:`NameError` 並回傳 ``NULL``。"
133133

134134
#: ../../c-api/frame.rst:106
135135
msgid "Raise an exception and return ``NULL`` on error."
136-
msgstr ""
136+
msgstr "在錯誤時引發例外並回傳 ``NULL``。"
137137

138138
#: ../../c-api/frame.rst:108
139139
msgid "*name* type must be a :class:`str`."
140-
msgstr ""
140+
msgstr "*name* 的型別必須是 :class:`str`。"
141141

142142
#: ../../c-api/frame.rst:115
143143
msgid ""
@@ -146,7 +146,7 @@ msgid ""
146146
msgstr ""
147147

148148
#: ../../c-api/frame.rst:123
149-
msgid "Get the *frame*'s ``f_locals`` attribute (:class:`dict`)."
149+
msgid "Get the *frame*'s :attr:`~frame.f_locals` attribute (:class:`dict`)."
150150
msgstr ""
151151

152152
#: ../../c-api/frame.rst:132

c-api/function.po

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ msgid ""
1010
msgstr ""
1111
"Project-Id-Version: Python 3.12\n"
1212
"Report-Msgid-Bugs-To: \n"
13-
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
13+
"POT-Creation-Date: 2023-12-07 00:03+0000\n"
1414
"PO-Revision-Date: 2022-11-12 15:45+0800\n"
1515
"Last-Translator: Matt Wang <[email protected]>\n"
1616
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -66,22 +66,24 @@ msgid ""
6666
"The function's docstring and name are retrieved from the code object. "
6767
"*__module__* is retrieved from *globals*. The argument defaults, annotations "
6868
"and closure are set to ``NULL``. *__qualname__* is set to the same value as "
69-
"the code object's ``co_qualname`` field."
69+
"the code object's :attr:`~codeobject.co_qualname` field."
7070
msgstr ""
7171
"函式的文件字串 (docstring) 和名稱是從程式碼物件所取得,*__module__* 是自 "
7272
"*globals* 所取得。引數預設值、標註 (annotation) 和閉包 (closure) 被設為 "
73-
"``NULL``,*__qualname__* 被設為和程式碼物件 ``co_qualname`` 欄位相同的值。"
73+
"``NULL``,*__qualname__* 被設為和程式碼物件 :attr:`~codeobject.co_qualname` "
74+
"欄位相同的值。"
7475

7576
#: ../../c-api/function.rst:45
7677
msgid ""
7778
"As :c:func:`PyFunction_New`, but also allows setting the function object's "
7879
"``__qualname__`` attribute. *qualname* should be a unicode object or "
7980
"``NULL``; if ``NULL``, the ``__qualname__`` attribute is set to the same "
80-
"value as the code object's ``co_qualname`` field."
81+
"value as the code object's :attr:`~codeobject.co_qualname` field."
8182
msgstr ""
8283
"和 :c:func:`PyFunction_New` 相似,但也允許函式物件 ``__qualname__`` 屬性的設"
8384
"定,*qualname* 應為一個 unicode 物件或是 ``NULL``;如為 ``NULL``,"
84-
"``__qualname__`` 屬性會被設為與程式碼物件 ``co_qualname`` 欄位相同的值。"
85+
"``__qualname__`` 屬性會被設為與程式碼物件 :attr:`~codeobject.co_qualname` 欄"
86+
"位相同的值。"
8587

8688
#: ../../c-api/function.rst:55
8789
msgid "Return the code object associated with the function object *op*."

0 commit comments

Comments
 (0)