8000 Merge branch '3.10' of https://github.com/python/python-docs-zh-tw in… · python/python-docs-zh-tw@6a40b94 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a40b94

Browse files
committed
Merge branch '3.10' of https://github.com/python/python-docs-zh-tw into 3.10
2 parents 97199e1 + 383270f commit 6a40b94

File tree

493 files changed

+20717
-18813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

493 files changed

+20717
-18813
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "3.7"
7+
- "3.8"
8+
- "3.9"
9+
- "3.10"
10+
11+
jobs:
12+
ci:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Dependencies
18+
run: sudo apt-get install gettext
19+
20+
- name: Validate
21+
run: VERSION=${{ github.event.pull_request.base.ref }} MODE=dummy make all

.github/workflows/deploy-gh-page.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: deploy-gh-page
2+
3+
on:
4+
push:
5+
branches:
6+
- "3.10"
7+
8+
jobs:
9+
cd:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Install Dependencies
15+
run: sudo apt-get install gettext
16+
17+
- name: Build
18+
run: make all
19+
20+
- name: Deploy to gh page
21+
uses: JamesIves/github-pages-deploy-action@3.7.1
22+
with:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
BRANCH: gh-pages
25+
FOLDER: ../cpython/Doc/build/html
26+
CLEAN: true

Makefile

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Here is what you can do:
44
#
5-
# - make # Automatically build an html local version
5+
# - make all # Automatically build an html local version
66
# - make todo # To list remaining tasks
77
# - make merge # To merge pot from upstream
88
# - make fuzzy # To find fuzzy strings
@@ -15,71 +15,89 @@
1515
#
1616
# Credits: Python Documentation French Translation Team (https://github.com/python/python-docs-fr)
1717

18-
SHELL = C:/Program Files/Git/bin/bash.exe
18+
.DEFAULT_GOAL := help # Sets default action to be help
19+
20+
define PRINT_HELP_PYSCRIPT # start of Python section
21+
import re, sys
22+
23+
output = []
24+
# Loop through the lines in this file
25+
for line in sys.stdin:
26+
# if the line has a command and a comment start with
27+
# two pound signs, add it to the output
28+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
29+
if match:
30+
target, help = match.groups()
31+
output.append("%-10s %s" % (target, help))
32+
# Sort the output in alphanumeric order
33+
output.sort()
34+
# Print the help result
35+
print('\n'.join(output))
36+
endef
37+
export PRINT_HELP_PYSCRIPT # End of python section
38+
1939
CPYTHON_CLONE := ../cpython/
2040
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
2141
LANGUAGE := zh_TW
2242
LC_MESSAGES := $(CPYTHON_CLONE)/Doc/locales/$(LANGUAGE)/LC_MESSAGES
2343
VENV := ~/.venvs/python-docs-i18n/
24-
PYTHON := $(shell which python)
44+
PYTHON := $(shell which python3)
2545
MODE := autobuild-dev-html
2646
BRANCH := $(or $(VERSION), $(shell git describe --contains --all HEAD))
2747
JOBS := 4
2848

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

56+
help:
57+
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
3758

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

4263

43-
$(VENV)/Scripts/activate:
64+
$(VENV)/bin/activate:
4465
mkdir -p $(VENV)
4566
$(PYTHON) -m venv $(VENV)
4667

4768

48-
$(VENV)/Scripts/sphinx-build: $(VENV)/Scripts/activate
49-
. $(VENV)/Scripts/activate; $(PYTHON) -m pip install sphinx python-docs-theme
69+
$(VENV)/bin/sphinx-build: $(VENV)/bin/activate
70+
. $(VENV)/bin/activate; python3 -m pip install sphinx python-docs-theme
5071

5172

52-
$(VENV)/Scripts/blurb: $(VENV)/Scripts/activate
53-
. $(VENV)/Scripts/activate; $(PYTHON) -m pip install blurb
73+
$(VENV)/bin/blurb: $(VENV)/bin/activate
74+
. $(VENV)/bin/activate; python3 -m pip install blurb
5475

5576

5677
.PHONY: upgrade_venv
57-
upgrade_venv: $(VENV)/Scripts/activate
58-
. $(VENV)/Scripts/activate; $(PYTHON) -m pip install --upgrade python-docs-theme blurb
59-
$(PYTHON) -m pip install -U pip setuptools
60-
$(PYTHON) -m pip install -r $(CPYTHON_CLONE)/Doc/requirements.txt
61-
@echo "The venv has been created in the $(VENV) directory"
78+
upgrade_venv: $(VENV)/bin/activate ## Upgrade the venv that compiles the doc
79+
. $(VENV)/bin/activate; python3 -m pip install --upgrade sphinx python-docs-theme blurb
6280

6381

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

7088

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

7593

7694
.PHONY: merge
77-
merge: upgrade_venv
95+
merge: upgrade_venv ## To merge pot from upstream
7896
ifneq "$(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD)" "$(BRANCH)"
7997
$(error "You're merging from a different branch")
8098
endif
8199
(cd $(CPYTHON_CLONE)/Doc; rm -f build/NEWS)
82-
(cd $(CPYTHON_CLONE)/Doc; $(VENV)/Scripts/sphinx-build -Q -b gettext -D gettext_compact=0 . locales/pot/)
100+
(cd $(CPYTHON_CLONE)/Doc; $(VENV)/bin/sphinx-build -Q -b gettext -D gettext_compact=0 . locales/pot/)
83101
find $(CPYTHON_CLONE)/Doc/locales/pot/ -name '*.pot' |\
84102
while read -r POT;\
85103
do\
@@ -106,9 +124,9 @@ update_txconfig:
106124

107125

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

112130
.PHONY: rm_cpython
113-
rm_cpython:
131+
rm_cpython: ## Remove cloned cpython repo
114132
rm -rf $(CPYTHON_CLONE)

README.rst

Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
Python 官方說明文件臺灣繁體中文翻譯計畫
33
=======================================
44

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

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

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

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

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

17-
.. _t.me/PyDocTW: https://t.me/PyDocTW
17+
.. _discord.gg/44XheGXhWH: https://discord.gg/44XheGXhWH
1818

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

@@ -132,7 +132,7 @@ the PSF for inclusion in the documentation.
132132

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

135-
make
135+
make all
136136

137137
如果你還沒有執行 `維護、預覽`_ 的 clone CPython 的動作,此指令會自動幫你 clone CPython,\
138138
並且會使用 Sphinx 幫你檢查 rST 語法錯誤,我們盡量保持沒有 warning \
@@ -228,7 +228,8 @@ po 檔皆為首要的翻譯對象。你也可以幫忙校對已經翻譯過的
228228
在 Glossary 中的譯文仍保持原文,並加註市面上的翻譯。
229229

230230
例如:``int``、``float``、``str``、``bytes``、``list``、``tuple``、
231-
``dict``、``set``、``iterator``、``generator``、``iterable``
231+
``dict``、``set``、``iterator``、``generator``、``iterable``、
232+
``pickle``
232233

233234

234235
括號的使用
@@ -313,56 +314,22 @@ rST 語法注意事項
313314
術語表 Glossary
314315
===============
315316

316-
為了讓翻譯保持統一,我們在這邊整理了一個術語列表,如果你有不同意的地方,歡迎\
317-
打開一個 issue 或是 pull request 一起討論。
318-
319-
===================== =====================
320-
原文 翻譯
321-
===================== =====================
322-
argument 引數
323-
attribute 屬性
324-
approximate 近似
325-
boolean boolean(布林)
326-
class class(類別)
327-
condition 條件
328-
contributor 貢獻者
329-
deprecated 已棄用
330-
dictionary dictionary(字典)
331-
element 元素
332-
exception 例外
333-
expression 運算式
334-
float float(浮點數)
335-
function 函式
336-
import import(不翻譯)
337-
index 索引
338-
instance 實例
339-
int int(整數)
340-
interpreter 直譯器
341-
iterate 疊代
342-
list list(串列)
343-
loop 迴圈
344-
method method(方法)
345-
module module(模組)
346-
object 物件
347-
operand 運算元
348-
operator 運算子
349-
parameter 參數
350-
prompt 提示字元
351-
return 回傳
352-
set set(集合)
353-
statement 陳述式
354-
type 型別
355-
===================== =====================
317+
為了讓翻譯保持統一,我們整理了一份 `術語列表
318+
<https://airtable.com/shrHlRP52bZ9C7aY3/tbl7dhPe9Ph9XIAy3>`_ \
319+
如果翻譯過程中你覺得需要術語列表有所缺漏,請填寫 `術語列表擴充表單 \
320+
<https://airtable.com/shr6sU4HHSKAz0Y7J>`_。新增的術語,將會於每次\
321+
Sprint中共同討論是否合併進術語列表。
322+
356323

357324

358325
問題回報與討論
359326
==============
360327

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

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

367334
另外,此翻譯的 coordinator 為 `mattwang44 <https://github.com/mattwang44>`_ 和 \
368335
`josix <https://github.com/josix>`_,你也可以分別透過以下 email 聯繫:\
@@ -372,7 +339,7 @@ type 型別
372339
額外翻譯資源
373340
============
374341

375-
- Telegram group `t.me/PyDocTW`_
342+
- Discord channel `discord.gg/44XheGXhWH`_
376343
- `Doc-SIG mailing list <https://mail.python.org/mailman/listinfo/doc-sig>`_
377344
- `PEP 545 <https://www.python.org/dev/peps/pep-0545/>`_
378345
- `zh_CN Translation of the Python Documentation

about.po

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2021, Python Software Foundation
2+
# Copyright (C) 2001-2022, Python Software Foundation
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
@@ -14,8 +14,8 @@ msgid ""
1414
msgstr ""
1515
"Project-Id-Version: Python 3.10\n"
1616
"Report-Msgid-Bugs-To: \n"
17-
"POT-Creation-Date: 2018-06-26 18:54+0800\n"
18-
"PO-Revision-Date: 2017-09-22 18:26+0000\n"
17+
"POT-Creation-Date: 2022-05-21 17:35+0000\n"
18+
"PO-Revision-Date: 2022-05-12 00:11+0800\n"
1919
"Last-Translator: hsiao yi <hsiaoyi0504@gmail.com>\n"
2020
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
2121
"tw)\n"
@@ -24,6 +24,7 @@ msgstr ""
2424
"Content-Type: text/plain; charset=UTF-8\n"
2525
"Content-Transfer-Encoding: 8bit\n"
2626
"Plural-Forms: nplurals=1; plural=0;\n"
27+
"X-Generator: Poedit 3.0.1\n"
2728

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

6263
#: ../../about.rst:24
6364
msgid ""
@@ -69,17 +70,17 @@ msgstr ""
6970

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

78-
#: ../../about.rst:32
79+
#: ../../about.rst:31
7980
msgid "Contributors to the Python Documentation"
8081
msgstr "Python 文件的貢獻者們"
8182

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

91-
#: ../../about.rst:38
92+
#: ../../about.rst:37
9293
msgid ""
9394
"It is only with the input and contributions of the Python community that "
9495
"Python has such wonderful documentation -- Thank You!"

0 commit comments

Comments
 (0)
0