翻译成品项目: https://github.com/foyoux/InstallShield2020-Documents
docts
库pip install docts
或
pip install docts -i https://pypi.org/simple
必要时可加上 --upgrade
参数
Sisulizer
具体参考 docts 项目: https://github.com/foyoux/docts
在此不再赘述.
chm
帮助文档文件这里以 Sisulizer 的帮助文档为例
docts 中提供了一个默认的快捷翻译函数 todo
def todo(path: str):
doc = Doc(path)
doc.add_filter(filter_eq_symbol)
doc.add_filter(filter_not_str)
return doc.save_words()
尝试一下
from docts import *
xlf_path = r"H:\docts-demo\Sisulizer.xlf"
todo(xlf_path)
在实际翻译过程中, 不可能有一种通用的翻译方法, 针对不同的文档, 我们可能有一些不想翻译, docts 中提供了一些方法进行过滤, 映射替换
add_filter
add_contain_filter
add_start_filter
add_end_filter
add_map
add_replace
具体参考 docts 项目: https://github.com/foyoux/docts
原文:https://www.cnblogs.com/foyou/p/15102615.html