@@ -71,7 +71,7 @@ msgid ""
7171"when Python was compiled and installed."
7272msgstr ""
7373"整個函式庫中包含了許多模組,有許多方法可以從函式庫中取用這些模組。有些模組是"
74- "以 C 語言撰寫並建置於 Python 編譯器之中 ,其他的是由 Python 撰寫並以源碼的方"
74+ "以 C 語言撰寫並建置於 Python 直譯器之中 ,其他的是由 Python 撰寫並以源碼的方"
7575"式 (source form) 引入。有些模組提供的功能是專屬於 Python 的,像是把 stack "
7676"trace 印出來;有些則是針對特定作業系統,去試著存取特定硬體;還有些提供對特定"
7777"應用的功能與操作介面,像是 World Wide Web。模組的使用情況會因機器與 Python 的"
@@ -142,6 +142,9 @@ msgid ""
142142"note *Availability: Linux >= 3.17 with glibc >= 2.27* requires both Linux "
143143"3.17 or newer and glibc 2.27 or newer."
144144msgstr ""
145+ "如果可用性標註同時包含最低核心 (Kernel) 版本及最低 libc 版本,則兩項條件"
146+ "必須同時符合。例如,標註為 *適用:Linux >= 3.17 與 glibc >= 2.27* 的功能"
147+ "需要 Linux 3.17 或更新版本以及 glibc 2.27 或更新版本。"
145148
146149#: ../../library/intro.rst:71
147150msgid "WebAssembly platforms"
@@ -160,6 +163,14 @@ msgid ""
160163"Other blocking operations like :func:`~time.sleep` block the browser event "
161164"loop."
162165msgstr ""
166+ "`WebAssembly`_ 平台 ``wasm32-emscripten`` (`Emscripten`_) 及 "
167+ "``wasm32-wasi`` (`WASI`_) 提供一組 POSIX API 的子集。WebAssembly 執行環境 "
168+ "(runtime) 與瀏覽器均採用沙盒機制,並限制對主機與外部資源的存取。任何使用到"
169+ "行程 (process)、執行緒 (threading)、網路、訊號 (signal) 或其他形式行程間通"
170+ "訊 (IPC) 的 Python 標準函式庫模組,皆可能無法使用,或無法像在其他類 Unix "
171+ "系統上正常運作。檔案 I/O、檔案系統以及與 Unix 權限相關的函式亦有限制。"
172+ "Emscripten 不允許阻塞式 (blocking) I/O。其他阻塞操作(如 :func:"
173+ "`~time.sleep`)則會阻塞瀏覽器的事件迴圈 (event loop)。"
163174
164175#: ../../library/intro.rst:83
165176msgid ""
@@ -169,6 +180,10 @@ msgid ""
169180"are evolving standards; some features like networking may be supported in "
170181"the future."
171182msgstr ""
183+ "Python 在 WebAssembly 平台上的特性與行為取決於 `Emscripten`_-SDK 或 "
184+ "`WASI`_-SDK 的版本、WASM 執行環境(瀏覽器、NodeJS、`wasmtime`_)以及 "
185+ "Python 的編譯時期 (build time) 旗標。WebAssembly、Emscripten 及 WASI 均為"
186+ "不斷演進中的標準;某些功能(如網路)未來可能獲得支援。"
172187
173188#: ../../library/intro.rst:89
174189msgid ""
@@ -178,6 +193,10 @@ msgid ""
178193"as well as limited networking capabilities with JavaScript's "
179194"``XMLHttpRequest`` and ``Fetch`` APIs."
180195msgstr ""
196+ "若要在瀏覽器中使用 Python,使用者應考慮 `Pyodide`_ 或 `PyScript`_。"
197+ "PyScript 建構於 Pyodide 之上,而 Pyodide 本身則建構於 CPython 與 "
198+ "Emscripten 之上。Pyodide 提供存取瀏覽器 JavaScript 與 DOM API 的管道,並"
199+ "透過 JavaScript 的 ``XMLHttpRequest`` 與 ``Fetch`` API 提供有限的網路功能。"
181200
182201#: ../../library/intro.rst:95
183202msgid ""
@@ -187,6 +206,10 @@ msgid ""
187206"kill`), or otherwise interact with processes. The :mod:`subprocess` is "
188207"importable but does not work."
189208msgstr ""
209+ "與行程 (process) 相關的 API 皆無法使用,或一律回傳錯誤。這包含建立新行程("
210+ ":func:`~os.fork`、:func:`~os.execve`)、等待行程(:func:`~os.waitpid`)、"
211+ "發送訊號(:func:`~os.kill`)或以其他方式與行程互動的 API。雖然可以引入 "
212+ "(import) :mod:`subprocess` 模組,但它無法正常運作。"
190213
191214#: ../../library/intro.rst:101
192215msgid ""
@@ -197,19 +220,26 @@ msgid ""
197220"information. WASI snapshot preview 1 only permits sockets from an existing "
198221"file descriptor."
199222msgstr ""
223+ ":mod:`socket` 模組雖可使用,但功能受限且行為與其他平台不同。在 Emscripten "
224+ "上,socket 一律為非阻塞的 (non-blocking),且需要在伺服器端搭配額外的 JavaScript 程"
225+ "式碼與輔助工具來透過 WebSocket 代理 TCP;詳情請參閱 `Emscripten "
226+ "Networking`_。WASI 快照預覽 1 (snapshot preview 1) 僅允許透過現有的檔案描"
227+ "述器 (file descriptor) 使用 socket。"
200228
201229#: ../../library/intro.rst:108
202230msgid ""
203231"Some functions are stubs that either don't do anything and always return "
204232"hardcoded values."
205- msgstr ""
233+ msgstr "部分函式僅為虛設常式 (stub),它們不執行任何操作,且一律回傳固定的 (hardcoded) 數值。 "
206234
207235#: ../../library/intro.rst:111
208236msgid ""
209237"Functions related to file descriptors, file permissions, file ownership, and "
210238"links are limited and don't support some operations. For example, WASI does "
211239"not permit symlinks with absolute file names."
212240msgstr ""
241+ "與檔案描述器 (file descriptor)、檔案權限、檔案所有權及連結相關的函式均受限"
242+ ",且不支援某些操作。例如,WASI 不允許使用絕對路徑檔名的符號連結 (symlink)。"
213243
214244#: ../../library/intro.rst:127
215245msgid "Mobile platforms"
@@ -221,6 +251,9 @@ msgid ""
221251"socket handling, and threading all behave as they would on any POSIX "
222252"operating system. However, there are several major differences:"
223253msgstr ""
254+ "在大多數方面,Android 與 iOS 皆屬於 POSIX 作業系統。檔案 I/O、socket 處理"
255+ "及執行緒 (threading) 的行為均與任何 POSIX 作業系統相同。然而,兩者仍有幾項"
256+ "重大差異。"
224257
225258#: ../../library/intro.rst:133
226259msgid ""
@@ -230,10 +263,14 @@ msgid ""
230263"use the :ref:`Python embedding API <embedding>`. For more details, see :ref:"
231264"`using-android` and :ref:`using-ios`."
232265msgstr ""
266+ "行動平台僅能以「嵌入 (embedded)」模式使用 Python。這些平台不提供 Python "
267+ "REPL,也無法使用獨立的可執行檔(如 :program:`python` 或 :program:`pip`)"
268+ "。若要在行動應用程式中加入 Python 程式碼,您必須使用 :ref:`Python 嵌入 "
269+ "API <embedding>`。詳情請參閱 :ref:`using-android` 與 :ref:`using-ios`。"
233270
234271#: ../../library/intro.rst:139
235272msgid "Subprocesses:"
236- msgstr ""
273+ msgstr "子行程 (Subprocess): "
237274
238275#: ../../library/intro.rst:141
239276msgid ""
@@ -242,6 +279,10 @@ msgid ""
242279"particular, Android does not support any part of the System V IPC API, so :"
243280"mod:`multiprocessing` is not available."
244281msgstr ""
282+ "在 Android 上雖可建立子行程 (subprocess),但 `官方並不支援 "
283+ "<https://issuetracker.google.com/issues/128554619#comment4>`__。具體而言"
284+ ",Android 不支援 System V IPC API 的任何部分,因此無法使用 "
285+ ":mod:`multiprocessing` 模組。"
245286
246287#: ../../library/intro.rst:146
247288msgid ""
@@ -252,17 +293,23 @@ msgid ""
252293"communicate with other running applications, outside of the iOS-specific "
253294"APIs that exist for this purpose."
254295msgstr ""
296+ "iOS 應用程式無法使用任何形式的子行程、多行程 (multiprocessing) 或行程間通"
297+ "訊 (IPC)。若 iOS 應用程式嘗試建立子行程,該發起動作的行程將會卡死或崩潰。"
298+ "除了 iOS 專用的 API 外,iOS 應用程式無法得知其他正在執行的應用程式,也無法"
299+ "與其進行通訊。"
255300
256301#: ../../library/intro.rst:153
257302msgid ""
258303"Mobile apps have limited access to modify system resources (such as the "
259304"system clock). These resources will often be *readable*, but attempts to "
260305"modify those resources will usually fail."
261306msgstr ""
307+ "行動應用程式修改系統資源(如系統時鐘)的權限有限。這類資源通常 *可供讀取* "
308+ ",但嘗試修改時多半會失敗。"
262309
263310#: ../../library/intro.rst:157
264311msgid "Console input and output:"
265- msgstr ""
312+ msgstr "主控台 (Console) 輸入與輸出: "
266313
267314#: ../../library/intro.rst:159
268315msgid ""
@@ -271,6 +318,9 @@ msgid ""
271318"system log. These can be seen under the tags ``python.stdout`` and ``python."
272319"stderr`` respectively."
273320msgstr ""
321+ "在 Android 上,原生的 ``stdout`` 與 ``stderr`` 未導向至任何地方,因此 "
322+ "Python 會安裝自有的串流 (stream),將訊息重新導向至系統日誌。您可以分別在 "
323+ "``python.stdout`` 與 ``python.stderr`` 標籤下查看這些訊息。"
274324
275325#: ../../library/intro.rst:164
276326msgid ""
@@ -281,16 +331,22 @@ msgid ""
281331"a diagnostic aid, they will not include any detail written to ``stdout`` or "
282332"``stderr``."
283333msgstr ""
334+ "iOS 應用程式的主控台輸出功能有限。雖然 ``stdout`` 與 ``stderr`` *確實存"
335+ "在*,且在 Xcode 中執行時可看見寫入其中的內容,但這些內容 *不會* 記錄在系統"
336+ "日誌中。若使用者提供應用程式日誌作為診斷輔助,其中並不會包含任何寫入 "
337+ "``stdout`` 或 ``stderr`` 的細節。"
284338
285339#: ../../library/intro.rst:171
286340msgid ""
287341"Mobile apps have no usable ``stdin`` at all. While apps can display an on-"
288342"screen keyboard, this is a software feature, not something that is attached "
289343"to ``stdin``."
290344msgstr ""
345+ "行動應用程式完全沒有可用的 ``stdin``。雖然應用程式可以顯示螢幕鍵盤,但那"
346+ "是軟體功能,並未連接至 ``stdin``。"
291347
292348#: ../../library/intro.rst:175
293349msgid ""
294350"As a result, Python modules that involve console manipulation (such as :mod:"
295351"`curses` and :mod:`readline`) are not available on mobile platforms."
296- msgstr ""
352+ msgstr "因此,涉及主控台操作的 Python 模組(如 :mod:`curses` 與 :mod:`readline`)在行動平台上均無法使用。 "
0 commit comments