Code Monkey home page Code Monkey logo

python-docs-zh-cn's Introduction

zh_CN Translation of the Python Documentation

All translations are done on transifex. https://www.transifex.com/python-doc/public/

Maintained versions:

Version Sync status Translation progress
3.13 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.13%2F.stat.json&query=%24.translation&label=zh-CN
3.12 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.12%2F.stat.json&query=%24.translation&label=zh-CN
3.11 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.11%2F.stat.json&query=%24.translation&label=zh-CN
3.10 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.10%2F.stat.json&query=%24.translation&label=zh-CN
3.9 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.9%2F.stat.json&query=%24.translation&label=zh-CN
3.8 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.8%2F.stat.json&query=%24.translation&label=zh-CN

EOL versions:

Version Sync status Translation progress
3.7 https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fpython%2Fpython-docs-zh-cn%2F3.7%2F.stat.json&query=%24.translation&label=zh-CN

Documentation Contribution Agreement

NOTE REGARDING THE LICENSE FOR TRANSLATIONS: Python's documentation is maintained using a global network of volunteers. By posting this project on Transifex, GitHub, and other public places, and inviting you to participate, we are proposing an agreement that you will provide your improvements to Python's documentation or the translation of Python's documentation for the PSF's use under the CC0 license (available at https://creativecommons.org/publicdomain/zero/1.0/legalcode). In return, you may publicly claim credit for the portion of the translation you contributed and if your translation is accepted by the PSF, you may (but are not required to) submit a patch including an appropriate annotation in the Misc/ACKS or TRANSLATORS file. Although nothing in this Documentation Contribution Agreement obligates the PSF to incorporate your textual contribution, your participation in the Python community is welcomed and appreciated.

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

Contributing to the Translation

Join the Chinese (China) team on transifex to get start.

You're recommended to read 大陆简中自由软件本地化工作指南:Free Software Localization Guide for Chinese (China) first.

python-docs-zh-cn's People

Contributors

blueglassblock avatar dumeng avatar rffontenelle avatar zhsj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-docs-zh-cn's Issues

3.7中文翻译,datamodel章节,生成器函数,such a function翻译错误

https://docs.python.org/zh-cn/3.7/reference/datamodel.html
生成器函数
一个使用 yield 语句 (见 yield 语句 章节)的函数或方法被称作一个 生成器函数。利益个函数(英文原文:Such a function),当调用时,总是返回一个可以执行函数体的迭代器对象:调用该迭代器的 iterator.next() 方法将会导致这个函数一直运行直到它使用 yield 语句提供了一个值为止。当这个函数执行 return 语句或者最后停止, 一个 StopIteration 异常被抛出并且这个迭代器将会到达将被返回的值的集合的末尾。

Issue at compile time

May be related to python/python-docs-zh-tw#62

I'm getting:

(./c-api.aux
! Text line contains an invalid character.
l.268 ...entsline {section}{\numberline {5.6}莚^^@
                                                  膕鱸^^87^^8a及^@^^8f^^98量...

? 
! Emergency stop.
l.268 ...entsline {section}{\numberline {5.6}莚^^@
                                                  膕鱸^^87^^8a及^@^^8f^^98量...

Hope it helps:

$ grep -a '膕鱸' c-api.aux
\@writefile{toc}{\contentsline {section}{\numberline {5.6}莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{31}{section.5.6}}
\newlabel{c-api/arg:parsing-arguments-and-building-values}{{5.6}{31}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section.5.6}{}}
\newlabel{c-api/arg:arg-parsing}{{5.6}{31}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section.5.6}{}}
\newlabel{c-api/arg::doc}{{5.6}{31}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section.5.6}{}}
\newlabel{c-api/arg:c.PyArg_ParseTuple}{{5.6}{34}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.160}{}}
\newlabel{c-api/arg:c.PyArg_VaParse}{{5.6}{34}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.161}{}}
\newlabel{c-api/arg:c.PyArg_ParseTupleAndKeywords}{{5.6}{34}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.162}{}}
\newlabel{c-api/arg:c.PyArg_VaParseTupleAndKeywords}{{5.6}{34}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.163}{}}
\newlabel{c-api/arg:c.PyArg_Parse}{{5.6}{34}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.164}{}}
\newlabel{c-api/arg:c.PyArg_UnpackTuple}{{5.6}{34}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.165}{}}
\newlabel{c-api/arg:c.Py_BuildValue}{{5.6}{35}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.166}{}}
\newlabel{c-api/arg:c.Py_VaBuildValue}{{5.6}{36}{莚膕鱸^^87^^8a及å^^8f^^98量膽^^96莚^^91}{section*.167}{}}

9.3.4 方法对象翻译模糊

python 3.7.4

章节: 方法对象

原文

If the name denotes a valid class attribute that is a function object, a method object is created by packing (pointers to) the instance object and the function object just found together in an abstract object: this is the method object.

译文

如果名称表示一个属于函数对象的有效类属性,会通过合并打包(指向)实例对象和函数对象到一个抽象对象中的方式来创建一个方法对象:这个抽象对象就是方法对象。

以上为方法对象的实现细节说明。

the name为特指,这句应翻译为

如果被引用的属性名称表示一个有效的类属性中的函数对象

the instance object and the function object 也是特指,这段话的上一句是 When a non-data attribute of an instance is referenced, the instance’s class is searched. 所以这句应该翻译为

会通过打包(指向)查找到的实例对象和函数对象到一个抽象对象的方式来创建方法对象:这个抽象对象就是方法对象

招募翻译review人员

为了保证翻译的质量,也本着为读者负责的态度,希望找些英语和国语都比较强的小伙伴们review我们已经翻译过的段落。
如果您对翻译Python官方文档感兴趣,且有较多的时间愿意放到这上面来,欢迎您成为我们的一员。
如果觉得自己英语水平不足以担任reviewer的职位,但又想做成贡献,也欢迎直接报名成为一名翻译员。

想参与的小伙伴可以直接在下面留言,并附上自己在transifex上的用户名。

Bug report from the @docs mailing list.

https://mail.python.org/pipermail/docs/2018-December/038721.html transcribed for convinience:

Hi, I find a mistake on https://docs.python.org/zh-cn/3.7/bugs.html, maybe
it is because the translation.
In the forth paragraph, "解决方案是使用 Python 的原始字符串表示法来表达正则样式;在以 'r' 为前缀的字符串文本中,
反斜杠没有任何转义。 因此,r"n" 是一个包含 '' 和 'n' 的双字符字符串, 而 "\n" 是包含换行符的一个字符字符串。
我们一般用原始表示法来表达样式。" while the original express is " So r"\n" is a
two-character string containing".
There is a missing "" and should be "r"\n"".
Thank you!
Best Wishes,
Bruce Wang

[勘误] 正则表达式非捕获匹配组语法的描述歧义

位置: 文档 » Python 标准库 » 文本处理服务 » re --- 正则表达式操作 » 正则表达式语法 » (?:…)
译文:

(?:…)
正则括号的非捕获版本。只识别,不取值。匹配在括号内的任何正则式,但匹配完成后,这个子串不做为结果被获取。比如 (?:a)bc 指定了匹配样式 bc,但这个样式前面必须是字符 a,它可以匹配 'abc',但不能匹配 'bbc',匹配完成后只返回 'bc' 作为匹配内容。

原文:

(?:...)
A non-capturing version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group cannot be retrieved after performing a match or referenced later in the pattern.

(?:...)结构不会将匹配内容作为一个单独的捕获组内容, 但仍会将匹配内容作为整体匹配的一部分. 示例如下:

>>> import re
>>> re.match(r"abc", "abc")
<re.Match object; span=(0, 3), match='abc'>
>>> re.match(r"(?:a)bc", "abc")
<re.Match object; span=(0, 3), match='abc'>

注意到(?:a)bc捕获内容为abc而非bc.

求:相同条目2次修改后无法自动同步的补救方法

一个资源,如果在transifex的多个版本中同时存在

在第一次译的时候(由空白到第一次保存),保存内容会自动同步下去
python-newest -->Python 3.6 -->Python 3.5 -->Python ...
上面除了第一个是自己保存的,后面的条目都是自动同步下去的(TRANSLATED BY TM)

如果非常不幸保存错了,再次修改保存的内容就无法同步下去了,得逐一手工修改
有没有好的补救方法?

翻译进度跟踪以及常见问题汇总

中文翻译项目完成百分比 进度条也许能有些激励作用~
加入翻译时选择语言“Chinese (China) zh_CN”),等待通过即可

项目进度是按条目统计的,当前版本有约五万个条目,每翻五个条目则增加万分之一的进度
实际的文本量是超过一百万个单词,一个条目也许只有一个单词,也许有一百个单词

  • 20181113 - 10%
  • 20190330 - 20%
  • 20190420 - 30%
  • 20190824 - 40%
  • 20190902 - 更新至 3.8
  • 20200128 - 50%
  • 20200531 - 更新至 3.9
  • 20201214 - 60%
  • 20211005 - 更新至 3.10
  • 20211212 - 70%
  • 20220616 - 80%
  • 20221106 - 更新至 3.11
    py_cn.png
  • 20230506 - 90%
  • 20230524 - 更新至 3.12
  • 20230920 - 91%
  • 20231106 - 92%
  • 20240111 - 93%
  • 20240216 - 94%
  • 20240320 - 95%
  • 20240511 - 更新至 3.13

中文翻译项目同步记录 同步如有错误会显示红叉,点击相应链接将列出错误所在位置例如 sample.rst:123,则打开 Transifex 的相应页面并在搜索栏中输入 occurrence:'sample.rst:123' 就能找到对应的翻译条目。

这里汇总一些常见问题:最关键的就是 rst 格式标记的前后应有分隔符,如空格、逗号、句号等等,否则文档不能正确显示,因此在翻译时请保留 rst 格式标记前后的空格。特别注意中文全角的冒号和括号等不被视为分隔符,需要额外添加空格或是改用对应的西文半角字符。

以下 rst 格式标记示例中,xxx 为显示内容 ,其它为标记符号;显示内容有些可以翻译有些不能,标记符号则不能去动。

  • :term:`xxx` 内容不能改动,应当整个保持原样 (那两个冒号也不能改成中文全角冒号)
  • :term:`xxx (1]` 内容可以翻译 (先复制源文本区到翻译区因为无法手工输入起跳转作用的 (1])
  • *xxx* 内容可以翻译
  • ``xxx`` 内容可以翻译

Translation mistake

In the Section of "Creating a Socket" from https://docs.python.org/3/howto/sockets.html# , "Finally, the argument to listen tells the socket library that we want it to queue up as many as 5 connect requests (the normal max) before refusing outside connections. If the rest of the code is written properly, that should be plenty." is wrongly translated as "最后,listen 方法的参数会告诉套接字库,我们希望在拒绝外部请求连接前最多使用 5 个连接请求的队列。如果所有的代码都要正确的写出来,代码量将会很大。".
I recommend "最后,listen 方法的参数会告诉套接字库,我们希望在队列中累积多达5个(通常的最大值)连接请求后再拒绝外部连接。如果所有其他代码都准确无误,这个队列长度应该就很充裕了。"

管理员写个wiki 或者公告吧

请把transifex到 github 到 travis-ci到docs.python.org的处理流程写个wiki,有变更公告一下吧
常见问题和要求也汇总说一下吧,不说提高效率了,至少避免新人猜坑吧

5号突然加了分支,编辑的内容提交到新分支了(这个自动提交的机制是什么?)
自己没有注意到,结果 反复在transifex 和github 3.7分支 和docs.python.org 核对,一个条目改了十几遍,都快不相信自己的眼睛了

浪费了大半天的时间,黑灯瞎火的全靠摸索...
感觉心好累,要修整一段时间...

勘误?

https://docs.python.org/zh-cn/3/reference/datamodel.html 里:
numbers.Real (float)
此类对象表示机器级的双精度浮点数。其所接受的取值范围和溢出处理将受制于底层的机器架构 (以及 C 或 Java 实现)。Python 不支持单精度浮点数;支持后者通常的理由是节省处理器和内存消耗,但这会妨碍在 Python 中使用对象,因此没有理由包含两种浮点数而令该语言变得复杂。
原文:
Python does not support single-precision floating point numbers; the savings in processor and memory usage that are usually the reason for using these are dwarfed by the overhead of using objects in Python, so there is no reason to complicate the language with two kinds of floating point numbers.
原文要表达的意思应该是说使用单精度浮点数节省的消耗相对于对象的使用来说微不足道所以Python没有部署单精度?

12. 虚拟环境和包

https://docs.python.org/zh-cn/3/tutorial/venv.html#introduction

然后,不同的应用可以使用不同的虚拟环要解决先前的冲突需求示例,应用程序A可以拥有自己的1.0版本安装虚拟环境,而应用程序B则具有2.0版本的另一个虚拟环境。如果应用程序B要求将库升级到3.0版本,也不会影响应用程序A的环境。

如果有 issue 模板就更好了。

现在提交时的错误信息

这个错误信息需要处理吗

Warning, treated as error:
/home/travis/build/python/cpython/Doc/locales/zh_CN/LC_MESSAGES/README.rst:document isn't included in any toctree
make: *** [build] Error 2

参与两天后的3个小建议

感谢这个组织让我有机会参与到中文文档的翻译工作,我原来计划今年开始自己翻译,再分享给需要的朋友,昨天发现这个项目之后,第一时间参与了进来,经过昨天和今天两天的翻译工作,我有以下3个建议:

  1. 是否使用协作工具(我愿意负责提供免费的足够满足所有人参与的工具)来协调每个人翻译,尽量每一个篇有一个人完整翻译,以保证同一稿里面的语言风格和词汇翻译统一(因为不是所有人都会主动添加关键词)
  2. 是否从组织参与翻译的人,集中力量从某个版本翻译起,然后再各自将自己翻译的成果快速同步到其它版本,在提高翻译质量的同时,也能够高效地推进翻译进度
  3. 是否可以组建微信群让参与翻译的人一起相互交流讨论

threading.enumerate()翻译问题

翻译为:它包含了已终结的线程和尚未开始的线程。
原文为: It excludes terminated threads and threads that have not yet been started.
正解:它不包含.......

2.7版本

Python 2.7 版本连基础的 tutorial 部分都没有翻译完成,甚至在transifex已经翻译的部分都已经不会更新。虽然 Python 2 已经不再支持,但是毕竟legacy数量众多,基础部分还是应该考虑完成(可以大幅借鉴 Python 3 文档)

内置函数

警告 如果编译足够大或者足够复杂的字符串成 AST 对象时,Python 解释器会因为 Python AST 编译器的栈深度限制而奔溃

奔溃 -> 崩溃

docs.python.org/zh-cn/3/library/functions.html

Terms not in glossary / build failing

I wrongly opened this issue on zh-tw because it was failing on zh-tw in the logs, but it looks like sphinx is picking those translations from this repo:

python/python-docs-zh-tw#56

Typically line 1483-1384 of library/functions.po you're having:

:term:`path-like 对象`

Should be:

:term:`path-like object`

(Or you should also translate it in glossary, I think both fixes are working).

Error on docs.python.org

From the logs:

Warning, treated as error:
/srv/docsbuild/3.8/cpython-zh-cn/Doc/c-api/bool.rst:33:<translated>:1:Inline interpreted text or phrase reference start-string without end-string.

To avoid this, in the french translation, we're using travis to check the build: https://github.com/python/python-docs-fr/blob/3.7/.travis.yml
You may not need pospell (don't know if it make sense or if it works well in zh-cn).

Po文件已更新,通过编译,但官方文档未更新

Use/Windows.po 开始的第一小节,4个安装包的介绍(rst行号32-45),4个都翻出中文了,po文件有更新了
但是doc.python.org中,只有第3条有中文,其他还是英文
我等两天了,看两个分支都编译过了,为什么没更新到官方文档?还是我哪里写错了?

内置常量翻译少一个字

原文

A small number of constants live in the built-in namespace. 

译文:

量常量存在于内置命名空间中。

应该是少量常量存在于内置命名空间中。

python 3.7.3 版本中译文版本。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.