python翻译工具包,目前支持谷歌
[introduction]
- 支持版本: python 3.0+
down install
- 安装方式:
pip install translate-util
DEMO
from translate_util.translate_tool import translate_other2cn,translate_other2en,translate_text
# 将其他语言翻译成中文 (default use google)
print(translate_other2cn('china'))
# 将其它语言翻译成英文 (default use google)
print(translate_other2en('中国'))
# 支持任意语言之间互相翻译,tl待翻译的语言
# tl demo: zh-CN/de/fr/en/it/es
print(translate_text('china', tl='de'))