Skip to content
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

Continue tutorial/modules.po #72

Merged
merged 6 commits into from
Jun 7, 2021
Merged

Continue tutorial/modules.po #72

merged 6 commits into from
Jun 7, 2021

Conversation

StevenHsuYL
Copy link
Contributor

This is the work continued from PR #28.
The review comments were all fixed.
I will start from this point (rst:262).

@StevenHsuYL
Copy link
Contributor Author

The tutorial/modules.po was completed.
Thanks for review.

Reference: https://terms.naer.edu.tw/

Fix missed time data and small bug.
Copy link
Collaborator

@adrianliaw adrianliaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

剩下 package 的部分還沒看


#: ../../tutorial/modules.rst:97
msgid ""
"This does not introduce the module name from which the imports are taken in "
"the local symbol table (so in the example, ``fibo`` is not defined)."
msgstr ""
"在 import 之後的名稱會被導入,但定義該函式的整個模組名稱並不會被引入在本地符"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/本地/區域


#: ../../tutorial/modules.rst:127
msgid ""
"It can also be used when utilising :keyword:`from` with similar effects::"
msgstr ""
"在使用時也可用 :keyword:`from` 獲得類似的效果:\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在使用 from 時也可以用同樣的方式獲得類似的效果


#: ../../tutorial/modules.rst:160
msgid ""
"you can make the file usable as a script as well as an importable module, "
"because the code that parses the command line only runs if the module is "
"executed as the \"main\" file:"
msgstr ""
"你可以將檔案作為腳本也同時可以作為被 import 的模組,因為解析 (parse) 指令行的"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/指令行/命令列


#: ../../tutorial/modules.rst:160
msgid ""
"you can make the file usable as a script as well as an importable module, "
"because the code that parses the command line only runs if the module is "
"executed as the \"main\" file:"
msgstr ""
"你可以將檔案作為腳本也同時可以作為被 import 的模組,因為解析 (parse) 指令行的"
"程式碼只會在當模組是 “main “ 檔案時,才會執行:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊我覺得可以把 main 翻譯過來,例如 「主」檔案。原文的 main 也只是要說明「主要」的這個概念而不是真的 Python 術語,__main__ 才是不能翻譯的部分。


#: ../../tutorial/modules.rst:169
msgid "If the module is imported, the code is not run::"
msgstr ""
"如果 import 模組,則不會執行程式碼:\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果此模組是被 import 的,則該段程式碼不會被執行

"Python 附帶了一個標準模組庫,詳細的介紹在另一份文件,稱為「Python 程式庫參考"
"手冊」(簡稱為「程式庫參考手冊」)。有些模組被內嵌在直譯器中;它們使一些不屬"
"於語言核心但依然內建的運算得以存取,其目的是為了提高效率,或提供作業系統基本"
"操作(例如系統呼叫)的存取。這些模組的集合是一個組態選項,它們取決於底層平"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

的存取

"於語言核心但依然內建的運算得以存取,其目的是為了提高效率,或提供作業系統基本"
"操作(例如系統呼叫)的存取。這些模組的集合是一個組態選項,它們取決於底層平"
"台。例如:\\ :mod:`winreg` 模組僅供 Windows 使用。值得注意的模組是 :mod:`sys`"
"\\ ,它被內嵌到每個 Python 直譯器中。變數 ``sys.ps1`` 和 ``sys.ps2`` 則用來定"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/內嵌到/內建在

@@ -345,39 +454,55 @@ msgid ""
"default if :envvar:`PYTHONPATH` is not set. You can modify it using "
"standard list operations::"
msgstr ""
"變數 ``sys.path`` 是一個字串 list,它決定直譯器的模組搜尋路徑。它的初始化為環"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/初始化/初始值

@@ -345,39 +454,55 @@ msgid ""
"default if :envvar:`PYTHONPATH` is not set. You can modify it using "
"standard list operations::"
msgstr ""
"變數 ``sys.path`` 是一個字串 list,它決定直譯器的模組搜尋路徑。它的初始化為環"
"境變數 :envvar:`PYTHONPATH` 中提取的預設路徑,或是當 :envvar:`PYTHONPATH` 未"
"設定時,從內建預設值提取。你可以用標準的 list 運算修改該變數:\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/運算/操作

msgid ""
":func:`dir` does not list the names of built-in functions and variables. If "
"you want a list of those, they are defined in the standard module :mod:"
"`builtins`::"
msgstr ""
":func:`dir` 不會列出內建函式和變數的名稱。如果你想要上述內容的 list,它們被定"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊的 list 指的不是 Python 的 list,「如果你想要列出它們」我覺得就可以了

All above suggestion fixed. Thanks!
cache: "快取"
@@ -387,8 +512,12 @@ msgid ""
"authors of multi-module packages like NumPy or Pillow from having to worry "
"about each other's module names."
msgstr ""
"套件是一種使用「點分隔模組名稱」建構 Python 模組命名空間的方法。例如,模組名"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/建構/組織

@@ -402,58 +531,90 @@ msgid ""
"operations. Here's a possible structure for your package (expressed in "
"terms of a hierarchical filesystem):"
msgstr ""
"假設你想設計一個能統一處理音訊檔案及音訊數據的模組集合(「套件」)。因為音訊"
"檔案有很多的不同的格式(通常以它們的擴充來辨識,例如:\\ :file:`.wav`"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/擴充/副檔名

@@ -402,58 +531,90 @@ msgid ""
"operations. Here's a possible structure for your package (expressed in "
"terms of a hierarchical filesystem):"
msgstr ""
"假設你想設計一個能統一處理音訊檔案及音訊數據的模組集合(「套件」)。因為音訊"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感覺說「模組集」就可以了

"檔案有很多的不同的格式(通常以它們的擴充來辨識,例如:\\ :file:`.wav`"
"\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間的轉"
"換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多不同"
"作業(例如,音訊混合、增加迴聲、套用等化器功能、創造人工立體音效),你將編寫"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/迴聲/回聲

"\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間的轉"
"換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多不同"
"作業(例如,音訊混合、增加迴聲、套用等化器功能、創造人工立體音效),你將編寫"
"一個無止盡的模組流來執行這些作業。以下是你的套件可能的架構(以階層式檔案系統"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你將編寫一系列無止盡的模組來執行這些作業

msgid ""
"You can also write relative imports, with the ``from module import name`` "
"form of import statement. These imports use leading dots to indicate the "
"current and parent packages involved in the relative import. From the :mod:"
"`surround` module for example, you might use::"
msgstr ""
"你也可以用 ``from module import name`` 的 import 陳述式,編寫「相對 "
"import」。這些 import 使用前導句號 (leading dot) 指示相對 import 中的當前套件"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leading dot 應該不需要註釋原文,不是一個專業術語,只是說模組名稱前面要加句點而已

msgid ""
"Packages support one more special attribute, :attr:`__path__`. This is "
"initialized to be a list containing the name of the directory holding the "
"package's :file:`__init__.py` before the code in that file is executed. "
"This variable can be modified; doing so affects future searches for modules "
"and subpackages contained in the package."
msgstr ""
"套件也支援一個特殊屬性 :attr:`__path__`\\ 。在初始化時,它是一個包含該套件檔"
"案 :file:`__init__.py` 的目錄名稱 list,初始化時機是在這個檔案的程式碼被執行"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

它在初始化時是一個 list,包含該套件的 __init__.py 檔案所在的目錄名稱

(也就是說 __path__ 一開始只有一個元素而已)

msgid ""
"Packages support one more special attribute, :attr:`__path__`. This is "
"initialized to be a list containing the name of the directory holding the "
"package's :file:`__init__.py` before the code in that file is executed. "
"This variable can be modified; doing so affects future searches for modules "
"and subpackages contained in the package."
msgstr ""
"套件也支援一個特殊屬性 :attr:`__path__`\\ 。在初始化時,它是一個包含該套件檔"
"案 :file:`__init__.py` 的目錄名稱 list,初始化時機是在這個檔案的程式碼被執行"
"之前。這個變數可以被修改,但這樣做會影響將來對套件內含模組和子套件的搜尋。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/套件內含/套件內的

msgid ""
"While this feature is not often needed, it can be used to extend the set of "
"modules found in a package."
msgstr ""
msgstr "雖然這個特色不太常用,但它可用於擴充套件中的模組集合。"
Copy link
Collaborator

@adrianliaw adrianliaw Jun 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

雖然這個特性不太常被需要

msgid ""
"In fact function definitions are also 'statements' that are 'executed'; the "
"execution of a module-level function definition enters the function name in "
"the module's global symbol table."
msgstr ""
"實際上,函式定義也是「被執行」的「陳述式」;在執行模組層次的函式定義時,會輸"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/層次/階層

All suggestions were applied. Thanks!
@StevenHsuYL
Copy link
Contributor Author

All suggestions were applied.
Thanks for the professional review!

@adrianliaw adrianliaw merged commit 8a817c1 into python:3.9 Jun 7, 2021
@StevenHsuYL StevenHsuYL deleted the module branch October 9, 2021 06:06
This was referenced Oct 26, 2021
beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull request Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants