Skip to content

Translating tutorial/module #28

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

Closed
wants to merge 3 commits into from
Closed

Translating tutorial/module #28

wants to merge 3 commits into from

Conversation

PatinaHo
Copy link
Contributor

@PatinaHo PatinaHo commented Aug 27, 2018

  • 6. Modules
  • 6.1 More on Modules
    • 6.1.1 Executing modules as scripts
    • 6.1.2 The Modules Search Path
    • 6.1.3 "Compiled" Python files
  • 6.2 Standard Modules
  • 6.3 The dir() function
  • 6.4 Packages
    • 6.4.1 Importing * From a Package
    • 6.4.2 Intra-Package References
    • 6.4.3 Packages in Multiple Directories

目前翻譯到6.1,6.2 / 6.3 / 6.4 的翻譯還在進行中。

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.

感謝你的翻譯!✨這邊我雖然留了 51 個 code review,但其實大概 70% 都是空格的修正以及 rST 語法的修正,也有很多都是用詞上面的統一化等 [1]。如果有不知道怎麼改或是我說明不清楚的地方,請儘量在 GitHub 上留言或是在 Telegram 群組或是私訊問我。再麻煩你修改了!

[1] 關於空格的使用請參考翻譯守則: https://github.com/python/python-docs-zh-tw#id5

@@ -49,6 +49,10 @@ msgid ""
"modules or into the *main* module (the collection of variables that you have "
"access to in a script executed at the top level and in calculator mode)."
msgstr ""
"為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在腳本或直譯器的互動"
"式實例中使用它們。這種檔案稱為\\ *模組(module)*\\ ;模組中的定義可以\\ *導"
Copy link
Collaborator

Choose a reason for hiding this comment

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

我覺得 "interactive instance of the interpreter" 逐字翻會有點難懂,提議可以把「直譯器的互動式實例」改成「互動模式下的直譯器」,這樣如何?

@@ -49,6 +49,10 @@ msgid ""
"modules or into the *main* module (the collection of variables that you have "
"access to in a script executed at the top level and in calculator mode)."
msgstr ""
"為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在腳本或直譯器的互動"
"式實例中使用它們。這種檔案稱為\\ *模組(module)*\\ ;模組中的定義可以\\ *導"
"入(import)*\\ 到其他模組中,或是導入至 \\ *主(main)*\\ 模組(即您在最頂"
Copy link
Collaborator

Choose a reason for hiding this comment

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

"import" 這個詞應該以不翻譯為主(見術語表),這邊的話我們可以寫成「import(導入)」,而後面所有使用到 import 一詞的地方我們可以直接寫 import。

另外,由於這邊的 import 是被動形式,所以應該要改成:模組中的定義可以「被」import 到其他模組中

"為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在腳本或直譯器的互動"
"式實例中使用它們。這種檔案稱為\\ *模組(module)*\\ ;模組中的定義可以\\ *導"
"入(import)*\\ 到其他模組中,或是導入至 \\ *主(main)*\\ 模組(即您在最頂"
"層、計算機模式下執行的腳本中,所使用的變數集合)。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

我查了一下 "calculator mode" 這個用詞,看起來 calculator mode == interactive mode [1],我覺得這樣的話翻譯裡就統一都用「互動模式」。

另外這邊語意和原文有點不太一樣,整句剖析下來應該是:

(the collection of variables that you have access to) ([in a script executed at the top level] and [in calculator mode])

所以這邊的斷句會需要修改一下。

[1] https://stackoverflow.com/questions/39240325/what-is-calculator-mode

@@ -59,28 +63,44 @@ msgid ""
"to create a file called :file:`fibo.py` in the current directory with the "
"following contents::"
msgstr ""
"模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱的字尾加上\\ :file:‘."
Copy link
Collaborator

Choose a reason for hiding this comment

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

「的字尾」在這邊應該是不需要的,因為 "suffix" 是指檔案名稱的 suffix 而不是模組名稱的字尾,這邊我覺得直接把「的字尾」拿掉就和原文的意思一樣了。

另外,這邊的 rST 語法是 :file:`.py`,是 backtick 而不是 single quote。(我上次用 PoEdit 的時候它好像會自己換掉,如果你是遇到這個狀況的話請跟我說!)

@@ -59,28 +63,44 @@ msgid ""
"to create a file called :file:`fibo.py` in the current directory with the "
"following contents::"
msgstr ""
"模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱的字尾加上\\ :file:‘."
"py’\\ 。在模組中,模組的名稱(作為字串)可用作全域變數\\ ``__name__``\\ 的"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/可用作/會是/

另外,這邊句子中的 name 算是一個中英混雜的狀況,因此前後應該要有實際的空格。這樣的情況下,就不需要在 ``__name__`` 的前後加上倒斜線

"可以在 Python 命令上使用命令參數(switch)\\ :option:`-O`\\ 或\\ :option:`-"
"OO`\\ 來減小已編譯模組的大小。命令參數\\ ``-O``\\ 刪除 assert 語句,\\ ``OO``"
"\\ 同時刪除 assert 語句和 __doc__ 字串。由於某些程式本身可能已經很依賴於可用"
"這些選項,因此只有在您知道自己在做什麼時,才應使用此選項。 「已優化"
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/選項/參數/

句點後面有多餘的空格

"OO`\\ 來減小已編譯模組的大小。命令參數\\ ``-O``\\ 刪除 assert 語句,\\ ``OO``"
"\\ 同時刪除 assert 語句和 __doc__ 字串。由於某些程式本身可能已經很依賴於可用"
"這些選項,因此只有在您知道自己在做什麼時,才應使用此選項。 「已優化"
"(Optimized)」模組有\\ ``opt-``\\ 標記,且通常較小。未來的版本可能會改變優化"
Copy link
Collaborator

Choose a reason for hiding this comment

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

opt- 前後應該有空格

另外,我覺得這邊這個 "Optimized" 並不是個專業術語,在原文裡使用引號也只是因為它「嚴格來說」是優化,但實質上只是把 assert 拿掉而已,並不是真的對計算效率上的改善。


#: ../../tutorial/modules.rst:244
msgid ""
"A program doesn't run any faster when it is read from a ``.pyc`` file than "
"when it is read from a ``.py`` file; the only thing that's faster about ``."
"pyc`` files is the speed with which they are loaded."
msgstr ""
"讀取\\ ``. pyc``\\ 檔案時,程式的執行速度並不會比讀取\\ ``. py``\\ 檔案快。唯"
Copy link
Collaborator

Choose a reason for hiding this comment

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

.pyc 以及 .py 前後應該要有空格


#: ../../tutorial/modules.rst:248
msgid ""
"The module :mod:`compileall` can create .pyc files for all modules in a "
"directory."
msgstr ""
msgstr "模組\\ : mod: `compileall`\\ 可以為資料夾中的所有模組創建 .pyc 檔。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這邊的 rST 語法需要中間沒有任何空格才能正確產生連結,另外 compileall 前後都應該有空格


#: ../../tutorial/modules.rst:251
msgid ""
"There is more detail on this process, including a flow chart of the "
"decisions, in :pep:`3147`."
msgstr ""
msgstr "更多的細節,包括決策流程圖,請參考\\ :pep: `3147`\\ 。"
Copy link
Collaborator

Choose a reason for hiding this comment

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

這邊的 rST 語法需要中間沒有任何空格,另外 pep 3147 的前面應該要有實質空格

@StevenHsuYL
Copy link
Contributor

I will continue from this commit, revise and complete it.
Thanks for your work previously.

@mattwang44
Copy link
Collaborator

closed by #72

@mattwang44 mattwang44 closed this Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants