python / python-docs-zh-cn

zh_CN translation of the Python documentation
https://docs.python.org/zh-cn/
431 stars 74 forks source link

“3.5.2 新版功能.”,“在 3.7 版更改:”这样的版本变更信息是在哪里翻译的? #164

Closed jaystone776 closed 3 years ago

jaystone776 commented 3 years ago

请问诸如“3.5.2 新版功能.”,“在 3.7 版更改:”这样的版本变更信息是在哪里翻译的?在transifex里没找到

zhsj commented 3 years ago

文档的源文件可以在python源码中找到,比如 https://docs.python.org/zh-cn/3.7/library/functions.html#bool 显示:

在 3.7 版更改: x 现在只能作为位置参数

那么可以看对应的源文件,看原文是啥,

https://raw.githubusercontent.com/python/cpython/dcc997cd28ab33ebac44182ee55533c1b37689f7/Doc/library/functions.rst

可以看到这是sphinx的一个语法:

.. versionchanged:: 3.7

这个翻译是在 sphinx 项目中翻译的,可以看 https://github.com/sphinx-doc/sphinx/blob/c99412695d2dc9e5392ede894ce7354d3236761f/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po#L1879

jaystone776 commented 3 years ago

我在 sphinx.po 和 changes.po 里都没找到 versionadded:: 3.5,这样的翻译,能帮我看下具体是哪个文件吗

jaystone776 commented 3 years ago

https://github.com/sphinx-doc/sphinx-doc-translations/blob/master/locale/zh_CN/LC_MESSAGES/changes.po,我是在这里找的

jaystone776 commented 3 years ago

https://github.com/sphinx-doc/sphinx-doc-translations/blob/master/locale/zh_CN/LC_MESSAGES/sphinx.po,还有这里

zhsj commented 3 years ago

versionchanged 是 sphinx 的一个语法,叫 Directives。对应的英文原文是在代码中定义的,https://github.com/sphinx-doc/sphinx/blob/68cc0f7e94f360a2c62ebcb761f8096e04ebf07f/sphinx/domains/changeset.py#L30

jaystone776 commented 3 years ago

那如果想改它的中文怎么改呢

zhsj commented 3 years ago

请参考 https://www.sphinx-doc.org/en/master/internals/contributing.html#writing-documentation sphinx本身的翻译也是托管在 transifex 上的,项目地址为 https://www.transifex.com/sphinx-doc/sphinx-1/

jaystone776 commented 3 years ago

了解了,多谢你这么耐心解答