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

Appearance settings

Commit bc24a09

Browse filesBrowse files
pydoc-zh-tw[bot]github-actions[bot]mattwang44
authored
Sync with CPython 3.11 (#410)
* sync with cpython 58e330ac * sync with cpython 4fa5fda1 * sync with cpython b80e4c89 * sync with cpython e715da6d * sync with cpython e643412e * sync with cpython 3b929a7b * sync with cpython 4c4ef50e * sync with cpython 2b5dbd1f * sync with cpython 050b6b34 * sync with cpython 7b2ac6cf * feat(c-api/file): partially translate * feat(c-api/init): partially translate * chore: add some simple translation * sync with cpython 56d50dd9 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Wang <mattwang44@gmail.com>
1 parent bcd7f45 commit bc24a09
Copy full SHA for bc24a09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

61 files changed

+2390
-2122
lines changed

‎c-api/file.po

Copy file name to clipboardExpand all lines: c-api/file.po
+47-7Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2022, Python Software Foundation
1+
# Copyright (C) 2001-2023, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
43
#
54
# Translators:
65
# Ching-Lung Chuang, 2015
76
# Liang-Bo Wang <me@liang2.tw>, 2015
7+
# Matt Wang <mattwang44@gmail.com>, 2022
88
msgid ""
99
msgstr ""
1010
"Project-Id-Version: Python 3.11\n"
1111
"Report-Msgid-Bugs-To: \n"
1212
"POT-Creation-Date: 2022-10-31 08:13+0000\n"
13-
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
14-
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
13+
"PO-Revision-Date: 2023-04-24 20:38+0800\n"
14+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1616
"tw)\n"
1717
"Language: zh_TW\n"
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=UTF-8\n"
2020
"Content-Transfer-Encoding: 8bit\n"
2121
"Plural-Forms: nplurals=1; plural=0;\n"
22+
"X-Generator: Poedit 3.2.2\n"
2223

2324
#: ../../c-api/file.rst:6
2425
msgid "File Objects"
25-
msgstr "檔案(File)物件"
26+
msgstr "檔案物件 (File Objects)"
2627

2728
#: ../../c-api/file.rst:10
2829
msgid ""
@@ -35,8 +36,14 @@ msgid ""
3536
"reporting in the interpreter; third-party code is advised to access the :mod:"
3637
"`io` APIs instead."
3738
msgstr ""
39+
"這些 API 是用於內建檔案物件的 Python 2 C API 的最小模擬 (minimal emulation),"
40+
"它過去依賴於 C 標準函式庫對於緩衝 I/O (:c:expr:`FILE*`) 的支援。在 Python 3 "
41+
"中,檔案和串流使用新的 :mod:`io` 模組,它在操作系統的低階無緩衝 I/O 上定義了"
42+
"多個層級。下面描述的函式是這些新 API 的便捷 C 包裝器,主要用於直譯器中的內部"
43+
"錯誤報告;建議第三方程式碼改為存取 :mod:`io` API。"
3844

3945
#: ../../c-api/file.rst:22
46+
#, fuzzy
4047
msgid ""
4148
"Create a Python file object from the file descriptor of an already opened "
4249
"file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be "
@@ -45,13 +52,19 @@ msgid ""
4552
"failure. For a more comprehensive description of the arguments, please refer "
4653
"to the :func:`io.open` function documentation."
4754
msgstr ""
55+
"從已打開檔案 *fd* 的檔案描述器建立一個 Python 檔案物件。引數 *name*、"
56+
"*encoding*、*errors* 和 *newline* 可以為 ``NULL`` 以使用預設值; *buffering* "
57+
"可以是 *-1* 以使用預設值。 *name* 被忽略並保留以實作向後相容性。失敗時回傳 "
58+
"``NULL``。有關引數的更全面描述,請參閱 :func:`io.open` 函式文檔。"
4859

4960
#: ../../c-api/file.rst:31
5061
msgid ""
5162
"Since Python streams have their own buffering layer, mixing them with OS-"
5263
"level file descriptors can produce various issues (such as unexpected "
5364
"ordering of data)."
5465
msgstr ""
66+
"由於 Python 串流有自己的緩衝層,將它們與操作系統層級檔案描述器混合使用會產生"
67+
"各種問題(例如資料的排序不符合預期)。"
5568

5669
#: ../../c-api/file.rst:35
5770
msgid "Ignore *name* attribute."
@@ -65,8 +78,12 @@ msgid ""
6578
"integer, which is returned as the file descriptor value. Sets an exception "
6679
"and returns ``-1`` on failure."
6780
msgstr ""
81+
"回傳與 *p* 關聯的檔案描述器作為 :c:expr:`int`。如果物件是整數,則回傳其值。如"
82+
"果不是整數,則呼叫物件的 :meth:`~io.IOBase.fileno` 方法(如果存在);該方法必"
83+
"須回傳一個整數,它作為檔案描述器值回傳。設定例外並在失敗時回傳 ``-1``。"
6884

6985
#: ../../c-api/file.rst:52
86+
#, fuzzy
7087
msgid ""
7188
"Equivalent to ``p.readline([n])``, this function reads one line from the "
7289
"object *p*. *p* may be a file object or any object with a :meth:`~io.IOBase."
@@ -78,49 +95,69 @@ msgid ""
7895
"regardless of length, but :exc:`EOFError` is raised if the end of the file "
7996
"is reached immediately."
8097
msgstr ""
98+
"相當於 ``p.readline([n])``,這個函式從物件 *p* 中讀取一行。 *p* 可以是檔案對"
99+
"像或任何具有 :meth:`~io.IOBase.readline` 方法的物件。如果 *n* 為 ``0``,則只"
100+
"讀取一行,而不管該行的長度。如果 *n* 大於 ``0``,則不會從檔案中讀取超過 *n* "
101+
"個位元組;可以回傳部分行。在這兩種情況下,如果立即到達檔案末尾,則回傳一個空"
102+
"字串。但是,如果 *n* 小於 ``0``,無論長度如何,都會讀取一行,但如果立即到達檔"
103+
"案末尾,則會引發 :exc:`EOFError`。"
81104

82105
#: ../../c-api/file.rst:65
83106
msgid ""
84107
"Overrides the normal behavior of :func:`io.open_code` to pass its parameter "
85108
"through the provided handler."
86109
msgstr ""
110+
"覆蓋 :func:`io.open_code` 的正常行為以透過提供的處理程式 (handler) 傳遞其參"
111+
"數。"
87112

88113
#: ../../c-api/file.rst:68
89114
msgid ""
90115
"The handler is a function of type :c:expr:`PyObject *(\\*)(PyObject *path, "
91116
"void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`."
92117
msgstr ""
118+
"處理程式是 :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)` 型別的函"
119+
"式,其中 *path* 保證為 :c:type:`PyUnicodeObject`。"
93120

94121
#: ../../c-api/file.rst:71
95122
msgid ""
96123
"The *userData* pointer is passed into the hook function. Since hook "
97124
"functions may be called from different runtimes, this pointer should not "
98125
"refer directly to Python state."
99126
msgstr ""
127+
"*userData* 指標被傳遞到掛鉤函式 (hook function) 中。由於可能會從不同的運行時"
128+
"間 (runtime) 呼叫掛鉤函式,因此該指標不應直接指向 Python 狀態。"
100129

101130
#: ../../c-api/file.rst:75
102131
msgid ""
103132
"As this hook is intentionally used during import, avoid importing new "
104133
"modules during its execution unless they are known to be frozen or available "
105134
"in ``sys.modules``."
106135
msgstr ""
136+
"由於此掛鉤函式是在導入期間有意使用的,因此請避免在其執行期間導入新模組,除非"
137+
"它們已知有被凍結或在 ``sys.modules`` 中可用。"
107138

108139
#: ../../c-api/file.rst:79
140+
#, fuzzy
109141
msgid ""
110142
"Once a hook has been set, it cannot be removed or replaced, and later calls "
111143
"to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function "
112144
"returns -1 and sets an exception if the interpreter has been initialized."
113145
msgstr ""
146+
"一旦設定了一個掛鉤函式,它就不能被刪除或替換,以後呼叫 :c:func:"
147+
"`PyFile_SetOpenCodeHook` 將失敗。失敗時,函式回傳 -1 並在直譯器已初始化時設定"
148+
"例外。"
114149

115150
#: ../../c-api/file.rst:83
116151
msgid "This function is safe to call before :c:func:`Py_Initialize`."
117-
msgstr ""
152+
msgstr "在 :c:func:`Py_Initialize` 之前呼叫此函式是安全的。"
118153

119-
#: ../../c-api/file.rst:21
154+
#: ../../c-api/file.rst:85
120155
msgid ""
121156
"Raises an :ref:`auditing event <auditing>` ``setopencodehook`` with no "
122157
"arguments."
123158
msgstr ""
159+
"不帶引數地引發一個\\ :ref:`稽核事件 (auditing event) <auditing>` "
160+
"``setopencodehook``\\ 。"
124161

125162
#: ../../c-api/file.rst:95
126163
msgid ""
@@ -129,6 +166,9 @@ msgid ""
129166
"instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; "
130167
"the appropriate exception will be set."
131168
msgstr ""
169+
"將物件 *obj* 寫入檔案物件 *p*。 *flags* 唯一支援的旗標是 :const:"
170+
"`Py_PRINT_RAW`;如果有給定,則寫入物件的 :func:`str` 而不是 :func:`repr`。在"
171+
"成功回傳 ``0`` 或在失敗回傳 ``-1``;將設定適當的例外。"
132172

133173
#: ../../c-api/file.rst:103
134174
msgid ""

‎c-api/init.po

Copy file name to clipboardExpand all lines: c-api/init.po
+27-19Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
67
msgid ""
78
msgstr ""
89
"Project-Id-Version: Python 3.11\n"
910
"Report-Msgid-Bugs-To: \n"
1011
"POT-Creation-Date: 2023-03-16 00:18+0000\n"
11-
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
12+
"PO-Revision-Date: 2023-04-24 20:49+0800\n"
1213
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1314
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1415
"tw)\n"
@@ -17,6 +18,7 @@ msgstr ""
1718
"Content-Type: text/plain; charset=UTF-8\n"
1819
"Content-Transfer-Encoding: 8bit\n"
1920
"Plural-Forms: nplurals=1; plural=0;\n"
21+
"X-Generator: Poedit 3.2.2\n"
2022

2123
#: ../../c-api/init.rst:8
2224
msgid "Initialization, Finalization, and Threads"
@@ -200,7 +202,7 @@ msgstr ""
200202

201203
#: ../../c-api/init.rst:90
202204
msgid "Set by the :option:`-b` option."
203-
msgstr ""
205+
msgstr "由 :option:`-b` 選項設定。"
204206

205207
#: ../../c-api/init.rst:94
206208
msgid ""
@@ -212,7 +214,7 @@ msgstr ""
212214
msgid ""
213215
"Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment "
214216
"variable."
215-
msgstr ""
217+
msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。"
216218

217219
#: ../../c-api/init.rst:102
218220
msgid ""
@@ -225,6 +227,7 @@ msgid ""
225227
"Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` "
226228
"environment variable."
227229
msgstr ""
230+
"由 :option:`-B` 選項與 :envvar:`PYTHONDONTWRITEBYTECODE` 環境變數設定。"
228231

229232
#: ../../c-api/init.rst:110
230233
msgid ""
@@ -241,6 +244,7 @@ msgid ""
241244
"Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to "
242245
"a non-empty string."
243246
msgstr ""
247+
"如果環境變數 :envvar:`PYTHONHASHSEED` 被設定為一個非空字串則設為 ``1``。"
244248

245249
#: ../../c-api/init.rst:120
246250
msgid ""
@@ -256,7 +260,7 @@ msgstr ""
256260

257261
#: ../../c-api/init.rst:128
258262
msgid "Set by the :option:`-E` and :option:`-I` options."
259-
msgstr ""
263+
msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。"
260264

261265
#: ../../c-api/init.rst:132
262266
msgid ""
@@ -269,11 +273,11 @@ msgstr ""
269273
msgid ""
270274
"Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment "
271275
"variable."
272-
msgstr ""
276+
msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。"
273277

274278
#: ../../c-api/init.rst:141
275279
msgid "Set by the :option:`-i` option."
276-
msgstr ""
280+
msgstr "由 :option:`-i` 選項設定。"
277281

278282
#: ../../c-api/init.rst:145
279283
msgid ""
@@ -283,7 +287,7 @@ msgstr ""
283287

284288
#: ../../c-api/init.rst:148
285289
msgid "Set by the :option:`-I` option."
286-
msgstr ""
290+
msgstr "由 :option:`-i` 選項設定。"
287291

288292
#: ../../c-api/init.rst:154
289293
msgid ""
@@ -297,6 +301,8 @@ msgid ""
297301
"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment "
298302
"variable is set to a non-empty string."
299303
msgstr ""
304+
"如果環境變數 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 被設定為一個非空字串則設"
305+
"為 ``1``。"
300306

301307
#: ../../c-api/init.rst:161
302308
msgid "See :pep:`529` for more details."
@@ -332,7 +338,7 @@ msgstr ""
332338

333339
#: ../../c-api/init.rst:184
334340
msgid "Set by the :option:`-S` option."
335-
msgstr ""
341+
msgstr "由 :option:`-S` 選項設定。"
336342

337343
#: ../../c-api/init.rst:188
338344
msgid ""
@@ -345,12 +351,14 @@ msgid ""
345351
"Set by the :option:`-s` and :option:`-I` options, and the :envvar:"
346352
"`PYTHONNOUSERSITE` environment variable."
347353
msgstr ""
354+
"由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數"
355+
"設定。"
348356

349357
#: ../../c-api/init.rst:196
350358
msgid ""
351359
"Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment "
352360
"variable."
353-
msgstr ""
361+
msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定。"
354362

355363
#: ../../c-api/init.rst:201
356364
msgid ""
@@ -359,7 +367,7 @@ msgstr ""
359367

360368
#: ../../c-api/init.rst:203
361369
msgid "Set by the :option:`-q` option."
362-
msgstr ""
370+
msgstr "由 :option:`-q` 選項設定。"
363371

364372
#: ../../c-api/init.rst:209
365373
msgid "Force the stdout and stderr streams to be unbuffered."
@@ -369,7 +377,7 @@ msgstr ""
369377
msgid ""
370378
"Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` "
371379
"environment variable."
372-
msgstr ""
380+
msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定。"
373381

374382
#: ../../c-api/init.rst:216
375383
msgid ""
@@ -383,7 +391,7 @@ msgstr ""
383391
msgid ""
384392
"Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment "
385393
"variable."
386-
msgstr ""
394+
msgstr "由 :option:`-v` 選項與 :envvar:`PYTHONVERBOSE` 環境變數設定。"
387395

388396
#: ../../c-api/init.rst:226
389397
msgid "Initializing and finalizing the interpreter"
@@ -464,7 +472,7 @@ msgid ""
464472
"than once."
465473
msgstr ""
466474

467-
#: ../../c-api/init.rst:29
475+
#: ../../c-api/init.rst:305
468476
msgid ""
469477
"Raises an :ref:`auditing event <auditing>` ``cpython."
470478
"_PySys_ClearAuditHooks`` with no arguments."
@@ -1030,7 +1038,7 @@ msgstr ""
10301038

10311039
#: ../../c-api/init.rst:896
10321040
msgid "High-level API"
1033-
msgstr ""
1041+
msgstr "高階 API"
10341042

10351043
#: ../../c-api/init.rst:898
10361044
msgid ""
@@ -1072,7 +1080,7 @@ msgstr ""
10721080

10731081
#: ../../c-api/init.rst:933
10741082
msgid "The function now does nothing."
1075-
msgstr ""
1083+
msgstr "此函式現在不會做任何事情。"
10761084

10771085
#: ../../c-api/init.rst:936
10781086
msgid ""
@@ -1241,7 +1249,7 @@ msgstr ""
12411249

12421250
#: ../../c-api/init.rst:1095
12431251
msgid "Low-level API"
1244-
msgstr ""
1252+
msgstr "低階 API"
12451253

12461254
#: ../../c-api/init.rst:1097
12471255
msgid ""
@@ -1259,7 +1267,7 @@ msgid ""
12591267
"function."
12601268
msgstr ""
12611269

1262-
#: ../../c-api/init.rst:5
1270+
#: ../../c-api/init.rst:1109
12631271
msgid ""
12641272
"Raises an :ref:`auditing event <auditing>` ``cpython."
12651273
"PyInterpreterState_New`` with no arguments."
@@ -1271,7 +1279,7 @@ msgid ""
12711279
"interpreter lock must be held."
12721280
msgstr ""
12731281

1274-
#: ../../c-api/init.rst:4
1282+
#: ../../c-api/init.rst:1117
12751283
msgid ""
12761284
"Raises an :ref:`auditing event <auditing>` ``cpython."
12771285
"PyInterpreterState_Clear`` with no arguments."
@@ -1900,7 +1908,7 @@ msgstr ""
19001908

19011909
#: ../../c-api/init.rst:1666 ../../c-api/init.rst:1680
19021910
msgid "The caller must hold the :term:`GIL`."
1903-
msgstr ""
1911+
msgstr "呼叫者必須持有 :term:`GIL`。"
19041912

19051913
#: ../../c-api/init.rst:1671
19061914
msgid ""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.