Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

s973125108/python-docs-zh-tw

 
 

Repository files navigation

Join Chat on Telegram

這是 Python 3.7 官方說明文件的臺灣繁體中文(zh_TW)翻譯。

翻譯之前,請務必詳讀並同意授權與 License。參與方式請參考參加翻譯

您可以在https://python-doc-tw.github.io/ 瀏覽目前翻譯的成果。

想問問題、認識翻譯同好,歡迎加入 Telegram 聊天室t.me/PyDocTW

以下為 Documentation Contribution Agreement,說明文件貢獻協議,請在貢獻以前務必詳讀以下內容。原文後附有中文翻譯,但譯文不保證完全正確,請以原文為準。

NOTE REGARDING THE LICENSE FOR TRANSLATIONS: Python's documentation ismaintained using a global network of volunteers. By posting thisproject on Transifex, GitHub, and other public places, and invitingyou to participate, we are proposing an agreement that you willprovide your improvements to Python's documentation or the translationof Python's documentation for the PSF's use under the CC0 license(available athttps://creativecommons.org/publicdomain/zero/1.0/legalcode). Inreturn, you may publicly claim credit for the portion of thetranslation you contributed and if your translation is accepted by thePSF, you may (but are not required to) submit a patch including anappropriate annotation in the Misc/ACKS or TRANSLATORS file. Althoughnothing in this Documentation Contribution Agreement obligates the PSFto incorporate your textual contribution, your participation in thePython community is welcomed and appreciated.

You signify acceptance of this agreement by submitting your work tothe PSF for inclusion in the documentation.

請注意此予翻譯專案的授權:Python 的說明文件是以全球的志工社群來維護。透過張貼此專案在 Transifex、GitHub 以及其他公眾場合,以及邀請您參與,我們向您提出一個協議:您必須將您對於 Python 說明文件或是 Python 說明文件翻譯的貢獻以 CC0(請參考https://creativecommons.org/publicdomain/zero/1.0/legalcode)的方式授權給 PSF 使用。您可以公開地聲明您所貢獻翻譯的部分,並且如果您的翻譯被 PSF採用,您可以(但並不須要)送出一個修改,其包含在 Misc/ACKS 或是 TRANSLATORS檔案裡增加合適的注釋。雖然這個說明文件貢獻協議並沒有說明 PSF 有義務納入您的文本貢獻,您在 Python 社群的參與是受歡迎且受感激的。

您在對 PSF 送出說明文件貢獻的同時,即表示同意上述的協議。

事先需要有:

在進行任何動作以前,你必須在 GitHub 上 fork 此專案(按下右上角的Fork按鈕),這樣會把整個專案複製一份到你的 GitHub 帳號底下,你可以對這個 fork進行修改。

第一次貢獻以前(還沒有 clone 過),請在 terminal 裡依照以下步驟:

# 用 git clone 將你的 fork 下載到本機端git clone git@github.com:<你的 GitHub 帳號>/python-docs-zh-tw.git# 進入 clone 下來的資料夾裡:cd python-docs-zh-tw/# 將 python/python-docs-zh-tw 設為 upstream remotegit remote add upstream https://github.com/python/python-docs-zh-tw.git

每一次翻譯時請遵照以下步驟(GitHub Flow):

首先,新增一個 issue,如:「翻譯 tutorial/introduction.po」,讓大家知道您正在翻譯這個檔案。

接著在 terminal 裡按照以下步驟:

  1. 基於最新版本的upstream/3.7 開啟一個 branch,現在假設我們想要翻譯 Glossary所以把這個 branch 叫做glossary

    git fetch upstreamgit checkout -b glossary upstream/3.7
  2. 接著就可以開始翻譯,你可以使用 Poedit 應用程式將檔案打開,或是用以下指令(翻譯不同檔案時將 glossary 換成別的檔名)

    poedit glossary.po
  3. 存檔以後,可以輸出文件以確保你的修改沒有 rST 的語法錯誤或警告

    make

    這個過程中 Sphinx 會幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning的狀態,因此如果有出現 warning 的話請修復它。另外也記得檢查是否符合翻譯守則

  4. 在瀏覽器中打開編譯出來的文件以確認整份文件的語意通暢(翻譯別的檔案時將 glossary 換成別的檔名)

    open ../cpython/Doc/build/html/glossary.html
  5. 檢查完畢後,即可以將你的翻譯 commit 起來,請使用明確的 commit message

    git add glossary.pogit commit -m "Working on glossary."
  6. 將你的修改 push 到你的 GitHub clone 上。為了簡單,我們可以用origin HEAD來告訴 git 我們將修改 push 到 origin,branch 則和本機端的 branch 名稱一樣

    git push origin HEAD
  7. 這時候你就可以打開一個 pull request 了,請打開https://github.com/python/python-docs-zh-tw,你會看到一個「Compare & PullRequest」按鈕,按下它就可以對此專案發送一個 pull request。

  8. 如果有人在 GitHub 上 review 了你的 pull request,並且你想要修改你的內容,那麼(如果你切換到了別的 branch 上)你要先切換回到你的 branch 上

    git checkout glossary

    接著修改你要修正的問題,並再次 commit、push

    git add glossary.pogit commit -m "glossary: small fixes"git push origin HEAD

這整個流程裡有幾件事情值得注意:

  • 從 upstream(我們的主要 GitHub repo)做 fetch 的動作
  • 對 origin(你的 fork)做 push
  • 永遠不對3.7 branch 進行修改,請保持讓這個 branch 唯讀,可以避免掉很多問題。

最簡單的貢獻方式就是更新fuzzy entries,讓翻譯的內容保持與最新版本的文件同步。請參考尋找 fuzzy entries 段落。

此外,當前的目標為完成Tutorial 的翻譯,因此在tutorial/ 底下的所有po 檔皆為首要的翻譯對象。您也可以幫忙校對已經翻譯過的內容。

  1. 譯文應兼顧前後文大意,在翻譯一份文件前請務必熟讀該文件的原文。

  2. 中文句使用全形標點符號;英文句維持半形的標點符號。

    例如:「」()、,。

    例如:Python is supported by Python Software Foundation (PSF).

  3. 中英文交雜時要插入空白;符號英文間不用。

    例如:使用 CPU 運算、使用「CPU」運算

  4. 專有名詞應該參考術語表 Glossary 裡翻譯方式。

  5. 專有名詞可以選擇不翻譯。

    例如:CPU、Unicode

  6. 在翻譯名稱不常用或不確定的情形,宜用括號註解或直接保留原文。單頁只要首次出現有註解即可。

    例如:正規表示式 (regular expression)

    例如:Network News Transfer Protocol、Portable Network Graphics(可攜式網路圖形)

  7. 務必保留 reStructuredText 格式(如:超連結名稱)

  8. po 檔單行不應超過 79 字元寬度(Poedit 會處理,但也可以使用poindent 來確保格式)

  9. 高頻詞保留原文。因為翻譯後不一定能較好理解市面上 Python 的文章。 這些高頻詞在 Glossary 中的譯文仍保持原文,並加註市面上的翻譯。

    例如:intfloatstrbyteslisttupledictsetiteratorgeneratoriterable

如果括號中的文字包含中文,使用全形括號;如果括號中只有英文,使用半形括號並比照英文的形式加入前後文的空白。

例如:

  • list(串列)是 Python 中很常見的資料型別。
  • 在本情況使用zip(*[iter(x)]*n) 是很常見的情況(Python 慣例)。
  • 在超文件標示語言 (HTML) 中應注意跳脫符號。
  • :xxx:`...` 即為 rST 的語法,應該在譯文中保留。

  • rST 諸多語法需要保留前後的空白。在中文裡,該空白可以用\來取代,製造一個沒有寬度的分隔符號。

    例如:

    For more information, please see:ref:`detail-instruction`.

    翻譯為

    更多資訊請參考\:ref:`detail-instruction`\
  • 超連結語法該要在譯文中保留原字串。

    例如:

    `Documentation bugs`_ on the Python issue tracker

    應更改為

    Python issue tracker 上\`文件相關的錯誤<Documentation bugs_>`_

    才能正確顯示為「Python issue tracker 上文件相關的錯誤」,連結與前文才不會有多餘的空白。

  • 舉例中有程式碼時,前一段經常為:: 結尾,此記號具有特殊意義,除了該段落結尾為冒號外,也代表下段縮排為程式碼。翻譯時應改為全型冒號,並增加以::開頭的新段落

    例如:

    Here is a code example::  import sys  print(sys.version)

    程式碼並不會出現在 po 檔之中,故在 po 檔中會顯示為

    Here is a code example::

    此時翻譯應為:

    以下是個程式範例:::

    注意額外的空行是必須的

為了讓翻譯保持統一,我們在這邊整理了一個術語列表,如果您有不同意的地方,歡迎打開一個 issue 或是 pull request 一起討論。

原文翻譯
argument引數
attribute屬性
booleanboolean(布林)
classclass(類別)
condition條件
contributor貢獻者
deprecated已棄用
dictionarydictionary(字典)
element元素
exception例外
expression運算式
floatfloat(浮點數)
function函式
importimport(不翻譯)
index索引
instance實例
intint(整數)
interpreter直譯器
iterate疊代
listlist(串列)
loop迴圈
methodmethod(方法)
modulemodule(模組)
object物件
operand運算元
operator運算子
parameter參數
prompt提示字元
return回傳
setset(集合)
statement陳述式
type型別

如果有需要共同討論的問題,請開設一個新的Issue。如果是翻譯上遇到困難需要幫助,則可以使用Telegram

另外,此翻譯的 coordinator 為adrianliaw,您也可以透過此 email 聯繫:adrianliaw2000 at gmail dot com

以下的指令皆預設在本機端python-docs-zh-tw clone 的根目錄執行,同時預設在同一個目錄底下有一個 CPython clone,如下:

~/├── python-docs-zh-tw/└── cpython/

若要在本機端 clone 一個 CPython,可以使用以下指令:

$ git clone --depth 1 --no-single-branch https://github.com/python/cpython.git

這樣可以避免下載完整的 commit 歷史(對輸出文件沒什麼幫助),但仍然能把所有的branch clone 下來。

$ make merge

Fuzzy entries 係指更新 po 檔的原始字串(msgid)以後,大部分內容相同但有些許差異的字串,即表示該字串的翻譯需要更新。在 po 檔中,您會看到#, fuzzy的字樣,這就表示了接下來的字串是 fuzzy entry,需要更新翻譯。

$ make fuzzy

輸出的文件會被放置在您的本地端 CPython clone(見維護、預覽 段落的圖示)底下的Doc/build/html,切換到該目錄再使用python3 -m http.server或類似的靜態網頁伺服器即可以預覽成果。編譯程序則使用:

$ make

This translation project was created by Liang-Bo Wang in late-2015, thetranslations were hosted onhttps://docs.python.org.tw/3, and the projectincludes daily auto-build sever, documentation website enhancement fortranslations and project management on thepython-doc-tw GitHub organisation. The translationswere done on Transifex, withour own translation team and project. People who've contributedon this Transifex project are listed inTRANSLATORS

In mid-2018, thanks toPEP 545and the Doc-SIG community, this project has migrated to Python's Githuborganisation and will become the official Taiwanese Mandarin translation of thedocumentation.

This translation project is highly influenced bypython-doc-ja andpython-doc-fr's translation architecture and workflow (i.e. a shamelesscopy). We truly appreciate their contributions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile88.2%
  • Shell11.8%

[8]ページ先頭

©2009-2025 Movatter.jp