Skip to content

Address formatting issues identified by powrap #792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 35 additions & 34 deletions library/__main__.po
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ msgid ""
"ref:`tut-modules` for an introduction."
msgstr ""
"這兩種機制都與 Python 模組有關;使用者如何與它們互動以及它們如何彼此互動。下"
"面會詳細解釋它們。如果你不熟悉 Python 模組,請參閱教學章節 :ref:`tut-modules` "
"的介紹。"
"面會詳細解釋它們。如果你不熟悉 Python 模組,請參閱教學章節 :ref:`tut-"
"modules` 的介紹。"

#: ../../library/__main__.rst:25
msgid "``__name__ == '__main__'``"
Expand Down Expand Up @@ -92,9 +92,9 @@ msgid ""
"program needs. Sometimes \"top-level code\" is called an *entry point* to "
"the application."
msgstr ""
"``__main__`` 是執行頂層程式碼的環境名稱。「頂層程式碼」是使用者指定且第一"
"個開始運作的 Python 模組。它是「頂層」的原因是因為它引入程式所需的所有其他模"
"組。有時「頂層程式碼」被稱為應用程式的\\ *入口點*。"
"``__main__`` 是執行頂層程式碼的環境名稱。「頂層程式碼」是使用者指定且第一個開"
"始運作的 Python 模組。它是「頂層」的原因是因為它引入程式所需的所有其他模組。"
"有時「頂層程式碼」被稱為應用程式的\\ *入口點*。"

#: ../../library/__main__.rst:53
msgid "The top-level code environment can be:"
Expand Down Expand Up @@ -179,8 +179,8 @@ msgid ""
"function named ``main`` encapsulates the program's primary behavior::"
msgstr ""
"在 ``if __name__ == '__main__'`` 下面的區塊中放置盡可能少的陳述式可以提高程式"
"碼的清晰度和正確性。大多數情況下,名為 ``main`` 的函式封裝 (encapsulate) 了程式"
"的主要行為: ::"
"碼的清晰度和正確性。大多數情況下,名為 ``main`` 的函式封裝 (encapsulate) 了程"
"式的主要行為: ::"

#: ../../library/__main__.rst:151
msgid ""
Expand Down Expand Up @@ -219,8 +219,8 @@ msgid ""
"return value of ``main`` is passed into :func:`sys.exit`. For example::"
msgstr ""
"``main`` 函式通常用於透過將它們指定為控制台腳本的入口點來建立命令列工具。完成"
"後,`pip <https://pip.pypa.io/>`_ 將函式呼叫插入到模板腳本中,其中 "
"``main`` 的回傳值被傳遞到 :func:`sys.exit` 中。例如: ::"
"後,`pip <https://pip.pypa.io/>`_ 將函式呼叫插入到模板腳本中,其中 ``main`` "
"的回傳值被傳遞到 :func:`sys.exit` 中。例如: ::"

#: ../../library/__main__.rst:175
msgid ""
Expand All @@ -230,8 +230,8 @@ msgid ""
"if your function does not have a return statement)."
msgstr ""
"由於對 ``main`` 的呼叫包含在 :func:`sys.exit` 中,因此期望你的函式將傳回一些"
"可接受作為 :func:`sys.exit` 輸入的值;通常來說,會是一個整數或 "
"``None``\\(如果你的函式沒有 return 陳述式,則相當於回傳此值)。"
"可接受作為 :func:`sys.exit` 輸入的值;通常來說,會是一個整數或 ``None``\\(如"
"果你的函式沒有 return 陳述式,則相當於回傳此值)。"

#: ../../library/__main__.rst:180
msgid ""
Expand All @@ -252,9 +252,9 @@ msgid ""
"py`` example from earlier exemplifies using the ``sys.exit(main())`` "
"convention."
msgstr ""
"特別是,要謹慎處理從 ``main`` 函式回傳字串。:func:`sys.exit` 會將字串引數直"
"譯為失敗訊息,因此你的程式將有一個表示失敗的結束代碼 ``1``,並且該字串將被"
"寫入 :data:`sys.stderr`。前面的 ``echo.py`` 範例使用慣例的 ``sys."
"特別是,要謹慎處理從 ``main`` 函式回傳字串。:func:`sys.exit` 會將字串引數直譯"
"為失敗訊息,因此你的程式將有一個表示失敗的結束代碼 ``1``,並且該字串將被寫"
" :data:`sys.stderr`。前面的 ``echo.py`` 範例使用慣例的 ``sys."
"exit(main())`` 進行示範。"

#: ../../library/__main__.rst:193
Expand All @@ -263,8 +263,8 @@ msgid ""
"collection of tutorials and references on how to distribute and install "
"Python packages with modern tools."
msgstr ""
"`Python 打包使用者指南 <https://packaging.python.org/>`_\\ 包含一系列如何使"
"用現代工具發行和安裝 Python 套件的教學和參考資料。"
"`Python 打包使用者指南 <https://packaging.python.org/>`_\\ 包含一系列如何使用"
"現代工具發行和安裝 Python 套件的教學和參考資料。"

#: ../../library/__main__.rst:199
msgid "``__main__.py`` in Python Packages"
Expand Down Expand Up @@ -307,8 +307,8 @@ msgid ""
"the :ref:`tut-modules` section of the tutorial."
msgstr ""
"請注意,``from .student import search_students`` 是相對引入的範例。在引用套件"
"內的模組時,可以使用此引入樣式。有關更多詳細資訊,請參閱 :ref:`tut-"
"modules` 教學章節中的 :ref:`intra-package-references`。"
"內的模組時,可以使用此引入樣式。有關更多詳細資訊,請參閱 :ref:`tut-modules` "
"教學章節中的 :ref:`intra-package-references`。"

#: ../../library/__main__.rst:241
msgid ""
Expand All @@ -327,8 +327,9 @@ msgid ""
"for a ``__main__.py`` file within a package, because its ``__name__`` "
"attribute will include the package's path if imported::"
msgstr ""
"如果在套件裡面的 ``__main__.py`` 檔案使用 ``if __name__ == '__main__'`` 區塊,"
"它依然會如預期般地運作。因為當引入套件,其 ``__name__`` 屬性將會包含套件的路徑: ::"
"如果在套件裡面的 ``__main__.py`` 檔案使用 ``if __name__ == '__main__'`` 區"
"塊,它依然會如預期般地運作。因為當引入套件,其 ``__name__`` 屬性將會包含套件"
"的路徑: ::"

#: ../../library/__main__.rst:254
msgid ""
Expand All @@ -345,8 +346,8 @@ msgid ""
"in the standard library. It doesn't contain a ``if __name__ == '__main__'`` "
"block. You can invoke it with ``python -m venv [directory]``."
msgstr ""
"請參閱 :mod:`venv` 作為標準函式庫中具有最小 ``__main__.py`` 的套件為範例。它不"
"包含 ``if __name__ == '__main__'`` 區塊。你可以使用 ``python -m venv "
"請參閱 :mod:`venv` 作為標準函式庫中具有最小 ``__main__.py`` 的套件為範例。"
"不包含 ``if __name__ == '__main__'`` 區塊。你可以使用 ``python -m venv "
"[directory]`` 來呼叫它。"

#: ../../library/__main__.rst:264
Expand Down Expand Up @@ -400,8 +401,8 @@ msgid ""
"the line with ``my_name = \"Dinsdale\"`` fixes the program and now it exits "
"with status code 0, indicating success:"
msgstr ""
"程式的結束代碼將為 1,表示出現錯誤。取消註解 ``my_name = \"Dinsdale\"`` "
"修復程式後,現在它以狀態碼 0 結束,表示成功:"
"程式的結束代碼將為 1,表示出現錯誤。取消註解 ``my_name = \"Dinsdale\"`` 而修"
"復程式後,現在它以狀態碼 0 結束,表示成功:"

#: ../../library/__main__.rst:335
msgid ""
Expand All @@ -410,9 +411,9 @@ msgid ""
"the ``if __name__ == \"__main__\"`` block of the ``start`` module. Why does "
"this work?"
msgstr ""
"請注意,引入 ``__main__`` 並不會因為不經意地執行放在 ``start`` 模組中 "
"``if __name__ == \"__main__\"`` 區塊的頂層程式碼(本來是給腳本使用的)而造成任何問題"
"。為什麼這樣做會如預期運作?"
"請注意,引入 ``__main__`` 並不會因為不經意地執行放在 ``start`` 模組中 ``if "
"__name__ == \"__main__\"`` 區塊的頂層程式碼(本來是給腳本使用的)而造成任何問"
"。為什麼這樣做會如預期運作?"

#: ../../library/__main__.rst:339
msgid ""
Expand All @@ -426,21 +427,21 @@ msgid ""
"<import-dunder-main>` in the import system's reference for details on how "
"this works."
msgstr ""
"當 Python 直譯器啟動時,會在 :data:`sys.modules` 中插入一個空的 ``__main__`` "
",並透過執行頂層程式碼來填充它。在我們的範例中,這是 ``start`` 模組,它將逐"
"行執行並引入 ``namely``。接著,``namely`` 引入 ``__main__``\\ (其實是 "
"當 Python 直譯器啟動時,會在 :data:`sys.modules` 中插入一個空的 ``__main__`` "
"模組,並透過執行頂層程式碼來填充它。在我們的範例中,這是 ``start`` 模組,它將"
"逐行執行並引入 ``namely``。接著,``namely`` 引入 ``__main__``\\ (其實是 "
"``start``)。這就是一個引入循環!幸運的是,由於部分填充的 ``__main__`` 模組存"
"在於 :data:`sys.modules` 中,Python 將其傳遞給 ``namely``。請參閱引入系統參考"
"文件中的\\ :ref:`關於 __main__ 的特別考量 <import-dunder-main>`\\ 了解其工作原理"
"的詳細資訊。"
"文件中的\\ :ref:`關於 __main__ 的特別考量 <import-dunder-main>`\\ 了解其工作"
"原理的詳細資訊。"

#: ../../library/__main__.rst:348
msgid ""
"The Python REPL is another example of a \"top-level environment\", so "
"anything defined in the REPL becomes part of the ``__main__`` scope::"
msgstr ""
"Python REPL 是「頂層環境」的另一個範例,因此 REPL 中定義的任何內容都成為 "
"作域的一部分: ::"
"Python REPL 是「頂層環境」的另一個範例,因此 REPL 中定義的任何內容都成為 作域"
"的一部分: ::"

#: ../../library/__main__.rst:364
msgid ""
Expand Down
16 changes: 8 additions & 8 deletions library/asyncio-runner.po
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ msgstr ""
msgid ""
"This function cannot be called when another asyncio event loop is running in "
"the same thread."
msgstr ""
"當另一個非同步事件迴圈在同一執行緒中執行時,無法呼叫此函式。"
msgstr "當另一個非同步事件迴圈在同一執行緒中執行時,無法呼叫此函式。"

#: ../../library/asyncio-runner.rst:36 ../../library/asyncio-runner.rst:83
msgid ""
"If *debug* is ``True``, the event loop will be run in debug mode. ``False`` "
"disables debug mode explicitly. ``None`` is used to respect the global :ref:"
"`asyncio-debug-mode` settings."
msgstr ""
"如果 *debug* 為 ``True``,事件迴圈會以除錯模式執行。``False`` 則會關閉除錯模式。"
"``None`` 則會優先使用\\ :ref:`除錯模式 <asyncio-debug-mode>`\\ 的全域設定。"
"如果 *debug* 為 ``True``,事件迴圈會以除錯模式執行。``False`` 則會關閉除錯模"
"式。``None`` 則會優先使用\\ :ref:`除錯模式 <asyncio-debug-mode>`\\ 的全域設"
"定。"

#: ../../library/asyncio-runner.rst:40
msgid ""
Expand All @@ -76,10 +76,10 @@ msgid ""
"programs, and should ideally only be called once. It is recommended to use "
"*loop_factory* to configure the event loop instead of policies."
msgstr ""
"如果 *loop_factory* 不為 ``None``,它會被用於建立一個新的事件迴圈;"
"否則會改用 :func:`asyncio.new_event_loop`。迴圈會在最後關閉。這個函式應該要作為"
"asyncio 程式的主要進入點,且理想上僅會被呼叫一次。推薦使用 *loop_factory* 來設定"
"事件迴圈時而不是使用 policies(政策)。"
"如果 *loop_factory* 不為 ``None``,它會被用於建立一個新的事件迴圈;否則會改"
" :func:`asyncio.new_event_loop`。迴圈會在最後關閉。這個函式應該要作為"
"asyncio 程式的主要進入點,且理想上僅會被呼叫一次。推薦使用 *loop_factory* "
"設定事件迴圈時而不是使用 policies(政策)。"

#: ../../library/asyncio-runner.rst:46
msgid ""
Expand Down