Skip to content

Translate Chinese Annotations in Python to English.

License

Notifications You must be signed in to change notification settings

Saltsmart/TransAnno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

TransAnno

Translate Chinese Annotations in Python to English. 快速翻译Package中所有py的中文注释到英文,方便发布为公共包。修改trans.py中的"from""to",可以修改语言设置。

目前采用有道翻译API,Google翻译需安装googletrans包,参见Link

使用:

a = AnnoTranslator()
a.anno_translate(rsc : str, bak : str)  # package所在的文件夹, 备份文件夹

会将rsc中所有py文件中的中文注释('''块注释''',"""块注释"""和#行注释)原位转为英文并加上"TRANS: "标记,便于进一步修改

About

Translate Chinese Annotations in Python to English.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages