Skip to content

Commit d409813

Browse files
mudongliangJonathan Corbet
authored andcommitted
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
1 parent 63e96ce commit d409813

4 files changed

Lines changed: 111 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Checking for needed translation updates
4+
=======================================
5+
6+
This script helps track the translation status of the documentation in
7+
different locales, i.e., whether the documentation is up-to-date with
8+
the English counterpart.
9+
10+
How it works
11+
------------
12+
13+
It uses ``git log`` command to track the latest English commit from the
14+
translation commit (order by author date) and the latest English commits
15+
from HEAD. If any differences occur, the file is considered as out-of-date,
16+
then commits that need to be updated will be collected and reported.
17+
18+
Features implemented
19+
20+
- check all files in a certain locale
21+
- check a single file or a set of files
22+
- provide options to change output format
23+
- track the translation status of files that have no translation
24+
25+
Usage
26+
-----
27+
28+
::
29+
30+
./scripts/checktransupdate.py --help
31+
32+
Please refer to the output of argument parser for usage details.
33+
34+
Samples
35+
36+
- ``./scripts/checktransupdate.py -l zh_CN``
37+
This will print all the files that need to be updated in the zh_CN locale.
38+
- ``./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools/testing-overview.rst``
39+
This will only print the status of the specified file.
40+
41+
Then the output is something like:
42+
43+
::
44+
45+
Documentation/dev-tools/kfence.rst
46+
No translation in the locale of zh_CN
47+
48+
Documentation/translations/zh_CN/dev-tools/testing-overview.rst
49+
commit 42fb9cfd5b18 ("Documentation: dev-tools: Add link to RV docs")
50+
1 commits needs resolving in total
51+
52+
Features to be implemented
53+
54+
- files can be a folder instead of only a file

Documentation/doc-guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ How to write kernel documentation
1212
parse-headers
1313
contributing
1414
maintainer-profile
15+
checktransupdate
1516

1617
.. only:: subproject and html
1718

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
.. include:: ../disclaimer-zh_CN.rst
4+
5+
:Original: Documentation/doc-guide/checktransupdate.rst
6+
7+
:译者: 慕冬亮 Dongliang Mu <dzm91@hust.edu.cn>
8+
9+
检查翻译更新
10+
11+
这个脚本帮助跟踪不同语言的文档翻译状态,即文档是否与对应的英文版本保持更新。
12+
13+
工作原理
14+
------------
15+
16+
它使用 ``git log`` 命令来跟踪翻译提交的最新英文提交(按作者日期排序)和英文文档的
17+
最新提交。如果有任何差异,则该文件被认为是过期的,然后需要更新的提交将被收集并报告。
18+
19+
实现的功能
20+
21+
- 检查特定语言中的所有文件
22+
- 检查单个文件或一组文件
23+
- 提供更改输出格式的选项
24+
- 跟踪没有翻译过的文件的翻译状态
25+
26+
用法
27+
-----
28+
29+
::
30+
31+
./scripts/checktransupdate.py --help
32+
33+
具体用法请参考参数解析器的输出
34+
35+
示例
36+
37+
- ``./scripts/checktransupdate.py -l zh_CN``
38+
这将打印 zh_CN 语言中需要更新的所有文件。
39+
- ``./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools/testing-overview.rst``
40+
这将只打印指定文件的状态。
41+
42+
然后输出类似如下的内容:
43+
44+
::
45+
46+
Documentation/dev-tools/kfence.rst
47+
No translation in the locale of zh_CN
48+
49+
Documentation/translations/zh_CN/dev-tools/testing-overview.rst
50+
commit 42fb9cfd5b18 ("Documentation: dev-tools: Add link to RV docs")
51+
1 commits needs resolving in total
52+
53+
待实现的功能
54+
55+
- 文件参数可以是文件夹而不仅仅是单个文件

Documentation/translations/zh_CN/doc-guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
parse-headers
1919
contributing
2020
maintainer-profile
21+
checktransupdate
2122

2223
.. only:: subproject and html
2324

0 commit comments

Comments
 (0)