doc-guide: add help documentation checktransupdate.rst

This commit adds help documents - doc-guide/checktransupdate.rst
and zh_CN/doc-guide/checktransupdate.rst for scripts/checktransupdate.py
, including English and Chinese versions

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
[jc: fixed missing title problem in the new file]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240719041400.3909775-3-dzm91@hust.edu.cn
This commit is contained in:
Dongliang Mu 2024-07-19 12:13:34 +08:00 committed by Jonathan Corbet
parent 63e96ce050
commit d409813508
4 changed files with 111 additions and 0 deletions

View File

@ -0,0 +1,54 @@
.. SPDX-License-Identifier: GPL-2.0
Checking for needed translation updates
=======================================
This script helps track the translation status of the documentation in
different locales, i.e., whether the documentation is up-to-date with
the English counterpart.
How it works
------------
It uses ``git log`` command to track the latest English commit from the
translation commit (order by author date) and the latest English commits
from HEAD. If any differences occur, the file is considered as out-of-date,
then commits that need to be updated will be collected and reported.
Features implemented
- check all files in a certain locale
- check a single file or a set of files
- provide options to change output format
- track the translation status of files that have no translation
Usage
-----
::
./scripts/checktransupdate.py --help
Please refer to the output of argument parser for usage details.
Samples
- ``./scripts/checktransupdate.py -l zh_CN``
This will print all the files that need to be updated in the zh_CN locale.
- ``./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools/testing-overview.rst``
This will only print the status of the specified file.
Then the output is something like:
::
Documentation/dev-tools/kfence.rst
No translation in the locale of zh_CN
Documentation/translations/zh_CN/dev-tools/testing-overview.rst
commit 42fb9cfd5b18 ("Documentation: dev-tools: Add link to RV docs")
1 commits needs resolving in total
Features to be implemented
- files can be a folder instead of only a file

View File

@ -12,6 +12,7 @@ How to write kernel documentation
parse-headers parse-headers
contributing contributing
maintainer-profile maintainer-profile
checktransupdate
.. only:: subproject and html .. only:: subproject and html

View File

@ -0,0 +1,55 @@
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../disclaimer-zh_CN.rst
:Original: Documentation/doc-guide/checktransupdate.rst
:译者: 慕冬亮 Dongliang Mu <dzm91@hust.edu.cn>
检查翻译更新
这个脚本帮助跟踪不同语言的文档翻译状态,即文档是否与对应的英文版本保持更新。
工作原理
------------
它使用 ``git log`` 命令来跟踪翻译提交的最新英文提交(按作者日期排序)和英文文档的
最新提交。如果有任何差异,则该文件被认为是过期的,然后需要更新的提交将被收集并报告。
实现的功能
- 检查特定语言中的所有文件
- 检查单个文件或一组文件
- 提供更改输出格式的选项
- 跟踪没有翻译过的文件的翻译状态
用法
-----
::
./scripts/checktransupdate.py --help
具体用法请参考参数解析器的输出
示例
- ``./scripts/checktransupdate.py -l zh_CN``
这将打印 zh_CN 语言中需要更新的所有文件。
- ``./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools/testing-overview.rst``
这将只打印指定文件的状态。
然后输出类似如下的内容:
::
Documentation/dev-tools/kfence.rst
No translation in the locale of zh_CN
Documentation/translations/zh_CN/dev-tools/testing-overview.rst
commit 42fb9cfd5b18 ("Documentation: dev-tools: Add link to RV docs")
1 commits needs resolving in total
待实现的功能
- 文件参数可以是文件夹而不仅仅是单个文件

View File

@ -18,6 +18,7 @@
parse-headers parse-headers
contributing contributing
maintainer-profile maintainer-profile
checktransupdate
.. only:: subproject and html .. only:: subproject and html