Skip to content

Commit

Permalink
Merge branch '3.10' into feat/trans-library-pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwang44 committed May 21, 2022
2 parents b52a345 + a31c167 commit ac0a9a7
Show file tree
Hide file tree
Showing 185 changed files with 15,940 additions and 15,006 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
run: sudo apt-get install gettext

- name: Validate
run: VERSION=${{ github.event.pull_request.base.ref }} MODE=dummy make
run: VERSION=${{ github.event.pull_request.base.ref }} MODE=dummy make all
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gh-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: sudo apt-get install gettext

- name: Build
run: make
run: make all

- name: Deploy to gh page
uses: JamesIves/[email protected]
Expand Down
42 changes: 32 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Here is what you can do:
#
# - make # Automatically build an html local version
# - make all # Automatically build an html local version
# - make todo # To list remaining tasks
# - make merge # To merge pot from upstream
# - make fuzzy # To find fuzzy strings
Expand All @@ -15,6 +15,27 @@
#
# Credits: Python Documentation French Translation Team (https://github.com/python/python-docs-fr)

.DEFAULT_GOAL := help # Sets default action to be help

define PRINT_HELP_PYSCRIPT # start of Python section
import re, sys

output = []
# Loop through the lines in this file
for line in sys.stdin:
# if the line has a command and a comment start with
# two pound signs, add it to the output
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
output.append("%-10s %s" % (target, help))
# Sort the output in alphanumeric order
output.sort()
# Print the help result
print('\n'.join(output))
endef
export PRINT_HELP_PYSCRIPT # End of python section

CPYTHON_CLONE := ../cpython/
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
LANGUAGE := zh_TW
Expand All @@ -25,16 +46,17 @@ MODE := autobuild-dev-html
BRANCH := $(or $(VERSION), $(shell git describe --contains --all HEAD))
JOBS := 4


.PHONY: all
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone
all: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build an html local version
mkdir -p $(LC_MESSAGES)
for dirname in $$(find . -name '*.po' | xargs -n1 dirname | sort -u | grep -v '^\.$$'); do mkdir -p $(LC_MESSAGES)/$$dirname; done
for file in *.po */*.po; do ln -f $$file $(LC_MESSAGES)/$$file; done
. $(VENV)/bin/activate; $(MAKE) -C $(CPYTHON_CLONE)/Doc/ SPHINXOPTS='-j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE)

help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clone:
clone: ## Clone latest cpython repository to `../cpython/` if it doesn't exist
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git $(CPYTHON_CLONE) || echo "cpython exists"
cd $(CPYTHON_CLONE) && git checkout $(BRANCH)

Expand All @@ -53,24 +75,24 @@ $(VENV)/bin/blurb: $(VENV)/bin/activate


.PHONY: upgrade_venv
upgrade_venv: $(VENV)/bin/activate
upgrade_venv: $(VENV)/bin/activate ## Upgrade the venv that compiles the doc
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx python-docs-theme blurb


.PHONY: progress
progress:
progress: ## Compute current progression
@python3 -c 'import sys; print("{:.1%}".format(int(sys.argv[1]) / int(sys.argv[2])))' \
$(shell msgcat *.po */*.po | msgattrib --translated | grep -c '^msgid') \
$(shell msgcat *.po */*.po | grep -c '^msgid')


.PHONY: todo
todo:
todo: ## List remaining tasks
for file in *.po */*.po; do echo $$(msgattrib --untranslated $$file | grep ^msgid | sed 1d | wc -l ) $$file; done | grep -v ^0 | sort -gr


.PHONY: merge
merge: upgrade_venv
merge: upgrade_venv ## To merge pot from upstream
ifneq "$(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD)" "$(BRANCH)"
$(error "You're merging from a different branch")
endif
Expand Down Expand Up @@ -102,9 +124,9 @@ update_txconfig:


.PHONY: fuzzy
fuzzy:
fuzzy: ## Find fuzzy strings
for file in *.po */*.po; do echo $$(msgattrib --only-fuzzy --no-obsolete "$$file" | grep -c '#, fuzzy') $$file; done | grep -v ^0 | sort -gr

.PHONY: rm_cpython
rm_cpython:
rm_cpython: ## Remove cloned cpython repo
rm -rf $(CPYTHON_CLONE)
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
Python 官方說明文件臺灣繁體中文翻譯計畫
=======================================

.. image:: https://badgen.now.sh/badge/chat/on%20Telegram/blue
:target: https://t.me/PyDocTW
:alt: Join Chat on Telegram
.. image:: https://badgen.net/badge/chat/on%20Discord/blue
:target: https://discord.gg/44XheGXhWH
:alt: Join Chat on Discord

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

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

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

想問問題、認識翻譯同好,歡迎加入 Telegram 聊天室 `t.me/PyDocTW`_
想問問題、認識翻譯同好,歡迎加入 Discord 頻道 `discord.gg/44XheGXhWH`_

.. _t.me/PyDocTW: https://t.me/PyDocTW
.. _discord.gg/44XheGXhWH: https://discord.gg/44XheGXhWH

.. contents:: **目錄 Table of Contents**

Expand Down Expand Up @@ -132,7 +132,7 @@ the PSF for inclusion in the documentation.

3. 存檔以後,執行以下列指令編譯輸出文件,以確保你的修改沒有 rST 的語法錯誤或警告 ::

make
make all

如果你還沒有執行 `維護、預覽`_ 的 clone CPython 的動作,此指令會自動幫你 clone CPython,\
並且會使用 Sphinx 幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning \
Expand Down Expand Up @@ -326,10 +326,10 @@ Sprint中共同討論是否合併進術語列表。
==============

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

.. _Issue: https://github.com/python/python-docs-zh-tw/issues
.. _Telegram: https://t.me/PyDocTW
.. _Discord: https://discord.gg/44XheGXhWH

另外,此翻譯的 coordinator 為 `mattwang44 <https://github.com/mattwang44>`_ 和 \
`josix <https://github.com/josix>`_,你也可以分別透過以下 email 聯繫:\
Expand All @@ -339,7 +339,7 @@ Sprint中共同討論是否合併進術語列表。
額外翻譯資源
============

- Telegram group `t.me/PyDocTW`_
- Discord channel `discord.gg/44XheGXhWH`_
- `Doc-SIG mailing list <https://mail.python.org/mailman/listinfo/doc-sig>`_
- `PEP 545 <https://www.python.org/dev/peps/pep-0545/>`_
- `zh_CN Translation of the Python Documentation
Expand Down
21 changes: 11 additions & 10 deletions about.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-26 18:54+0800\n"
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
"POT-Creation-Date: 2022-05-21 17:35+0000\n"
"PO-Revision-Date: 2022-05-12 00:11+0800\n"
"Last-Translator: hsiao yi <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand All @@ -24,6 +24,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.0.1\n"

#: ../../about.rst:3
msgid "About these documents"
Expand Down Expand Up @@ -57,7 +58,7 @@ msgid ""
"Fred L. Drake, Jr., the creator of the original Python documentation toolset "
"and writer of much of the content;"
msgstr ""
"Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者"
"Fred L. Drake, Jr.,原始 Python 文件工具集的創造者以及一大部份內容的作者"

#: ../../about.rst:24
msgid ""
Expand All @@ -69,17 +70,17 @@ msgstr ""

#: ../../about.rst:26
msgid ""
"Fredrik Lundh for his `Alternative Python Reference <http://effbot.org/zone/"
"pyref.htm>`_ project from which Sphinx got many good ideas."
"Fredrik Lundh for his Alternative Python Reference project from which Sphinx "
"got many good ideas."
msgstr ""
"Fredrik Lundh 先生,Sphinx 從他的 `Alternative Python Reference <http://"
"effbot.org/zone/pyref.htm>`_ 計劃中獲得許多的好主意。"
"Fredrik Lundh 先生,Sphinx 從他的 Alternative Python Reference 計劃中獲得許多"
"的好主意。"

#: ../../about.rst:32
#: ../../about.rst:31
msgid "Contributors to the Python Documentation"
msgstr "Python 文件的貢獻者們"

#: ../../about.rst:34
#: ../../about.rst:33
msgid ""
"Many people have contributed to the Python language, the Python standard "
"library, and the Python documentation. See :source:`Misc/ACKS` in the "
Expand All @@ -88,7 +89,7 @@ msgstr ""
"許多人都曾為 Python 這門語言、Python 標準函式庫和 Python 說明文件貢獻過。"
"Python 所發佈的原始碼中含有部份貢獻者的清單,請見 :source:`Misc/ACKS` 。"

#: ../../about.rst:38
#: ../../about.rst:37
msgid ""
"It is only with the input and contributions of the Python community that "
"Python has such wonderful documentation -- Thank You!"
Expand Down
48 changes: 30 additions & 18 deletions bugs.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"PO-Revision-Date: 2021-09-05 00:55+0800\n"
"POT-Creation-Date: 2022-04-17 00:15+0000\n"
"PO-Revision-Date: 2022-04-21 17:54+0800\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand All @@ -23,7 +23,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 2.4.3\n"
"X-Generator: Poedit 3.0.1\n"

#: ../../bugs.rst:5
msgid "Dealing with Bugs"
Expand Down Expand Up @@ -93,7 +93,7 @@ msgid ""
"Overview of the process involved in reporting an improvement on the tracker."
msgstr "在追蹤系統上回報改進建議的過程簡介。"

#: ../../bugs.rst:35
#: ../../bugs.rst:36
msgid ""
"`Helping with Documentation <https://devguide.python.org/docquality/#helping-"
"with-documentation>`_"
Expand All @@ -107,11 +107,23 @@ msgid ""
"Python documentation."
msgstr "給有意成為 Python 說明文件貢獻者的綜合指南。"

#: ../../bugs.rst:41
#: ../../bugs.rst:38
msgid ""
"`Documentation Translations <https://devguide.python.org/documenting/"
"#translating>`_"
msgstr "`文件翻譯 <https://devguide.python.org/documenting/#translating>`_"

#: ../../bugs.rst:39
msgid ""
"A list of GitHub pages for documentation translation and their primary "
"contacts."
msgstr ""

#: ../../bugs.rst:45
msgid "Using the Python issue tracker"
msgstr "使用 Python 問題追蹤系統"

#: ../../bugs.rst:43
#: ../../bugs.rst:47
msgid ""
"Bug reports for Python itself should be submitted via the Python Bug Tracker "
"(https://bugs.python.org/). The bug tracker offers a web form which allows "
Expand All @@ -121,7 +133,7 @@ msgstr ""
"python.org/) 提交。這個錯誤追蹤系統提供了一個網頁表單,可以輸入並提交相關資訊"
"給開發者。"

#: ../../bugs.rst:47
#: ../../bugs.rst:51
msgid ""
"The first step in filing a report is to determine whether the problem has "
"already been reported. The advantage in doing so, aside from saving the "
Expand All @@ -137,7 +149,7 @@ msgstr ""
"迎您提供資訊!)。要確認是否重複回報,請使用頁面頂端的搜尋框來搜尋錯誤資料"
"庫。"

#: ../../bugs.rst:54
#: ../../bugs.rst:58
msgid ""
"If the problem you're reporting is not already in the bug tracker, go back "
"to the Python Bug Tracker and log in. If you don't already have a tracker "
Expand All @@ -149,15 +161,15 @@ msgstr ""
"統。如果您還沒有系統的帳號,請點選「註冊 (Register)」,如果您有 OpenID,也可"
"以在側邊欄中點選其中一個 OpenID 的提供者圖示。您無法以匿名方式提交錯誤報告。"

#: ../../bugs.rst:59
#: ../../bugs.rst:63
msgid ""
"Being now logged in, you can submit a bug. Select the \"Create New\" link "
"in the sidebar to open the bug reporting form."
msgstr ""
"如果已經登入,那您就可以提交一個錯誤。請點選側邊欄中的「新建 (Create New)」連"
"結,開啟錯誤回報表單。"

#: ../../bugs.rst:62
#: ../../bugs.rst:66
msgid ""
"The submission form has a number of fields. For the \"Title\" field, enter "
"a *very* short description of the problem; less than ten words is good. In "
Expand All @@ -169,7 +181,7 @@ msgstr ""
"型 (Type)」欄位,選擇您的問題類型;也要選擇與錯誤相關的「Component(組件)」"
"和「Versions(版本)」。"

#: ../../bugs.rst:67
#: ../../bugs.rst:71
msgid ""
"In the \"Comment\" field, describe the problem in detail, including what you "
"expected to happen and what did happen. Be sure to include whether any "
Expand All @@ -180,7 +192,7 @@ msgstr ""
"情況。請確定說明中包含了涉及到的任何擴充模組,以及您當時所使用的硬體和軟體平"
"台(視情況而定,可以附上版本資訊)。"

#: ../../bugs.rst:72
#: ../../bugs.rst:76
msgid ""
"Each bug report will be assigned to a developer who will determine what "
"needs to be done to correct the problem. You will receive an update each "
Expand All @@ -189,42 +201,42 @@ msgstr ""
"每一份錯誤報告會被分派給一位開發者,並由他決定要做出什麼變更來修正這個問題。"
"每當該錯誤有修正動作時,您會收到更新回報。"

#: ../../bugs.rst:81
#: ../../bugs.rst:85
msgid ""
"`How to Report Bugs Effectively <https://www.chiark.greenend.org.uk/"
"~sgtatham/bugs.html>`_"
msgstr ""
"`如何有效地回報錯誤 <https://www.chiark.greenend.org.uk/~sgtatham/bugs."
"html>`_"

#: ../../bugs.rst:80
#: ../../bugs.rst:84
msgid ""
"Article which goes into some detail about how to create a useful bug report. "
"This describes what kind of information is useful and why it is useful."
msgstr ""
"這篇文章詳細說明如何建立一份有用的錯誤報告。它描述了什麼樣的資訊是有用的,以"
"及這些資訊為什麼有用。"

#: ../../bugs.rst:84
#: ../../bugs.rst:88
msgid ""
"`Bug Writing Guidelines <https://bugzilla.mozilla.org/page.cgi?id=bug-"
"writing.html>`_"
msgstr ""
"`錯誤撰寫指南 <https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html>`_"

#: ../../bugs.rst:84
#: ../../bugs.rst:88
msgid ""
"Information about writing a good bug report. Some of this is specific to "
"the Mozilla project, but describes general good practices."
msgstr ""
"撰寫一份優良錯誤報告的相關資訊。部分的文章內容是針對 Mozilla 專案,但它也描述"
"了通用的好習慣。"

#: ../../bugs.rst:90
#: ../../bugs.rst:94
msgid "Getting started contributing to Python yourself"
msgstr "開始讓自己貢獻 Python"

#: ../../bugs.rst:92
#: ../../bugs.rst:96
msgid ""
"Beyond just reporting bugs that you find, you are also welcome to submit "
"patches to fix them. You can find more information on how to get started "
Expand Down

0 comments on commit ac0a9a7

Please sign in to comment.