docs: make it easy to add more other translations (#5874)
Co-authored-by: YobeZhou <smilezyb@163.com>
This commit is contained in:
@@ -1,6 +1,25 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
"""
|
||||||
|
Please add the translation language you want to add here, while also modifying the variable URL_BASE in _ext/link_roles.py
|
||||||
|
For example:
|
||||||
|
|
||||||
|
LANGUAGE = ':link_to_translation:`zh_CN:[中文]`\t' + \
|
||||||
|
':link_to_translation:`en:[English]`\t' + \
|
||||||
|
'\n\n'
|
||||||
|
|
||||||
|
|
||||||
|
URL_BASE = {
|
||||||
|
"zh_CN": "https://lvgl.100ask.net/",
|
||||||
|
"en": "https://docs.lvgl.io/"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
LANGUAGE = ':link_to_translation:`zh_CN:[中文]`\t' + \
|
||||||
|
'\n\n'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def find_files(dir_path, suffix):
|
def find_files(dir_path, suffix):
|
||||||
files = []
|
files = []
|
||||||
@@ -20,4 +39,4 @@ def exec(temp_directory):
|
|||||||
with open(rst_file, 'r+', encoding='utf-8') as f:
|
with open(rst_file, 'r+', encoding='utf-8') as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
f.seek(0, 0)
|
f.seek(0, 0)
|
||||||
f.write(':link_to_translation:`zh_CN:[中文]`\n\n' + content)
|
f.write(LANGUAGE + content)
|
||||||
|
|||||||
Reference in New Issue
Block a user