Skip to content

Translate Fuchsia markdown docs automatically with Google Translate

Notifications You must be signed in to change notification settings

y2-Whyto/Fuchsia-Doc-Machine-Translate-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuchsia Doc 简体中文翻译工具

功能

利用 https://translate.google.com/ 自动按照

<!--
Original Text
 -->
译文

格式进行文档翻译并保存。可以自动跳过代码块。

注意:本程序仅实现了自动化机器翻译,自动翻译后需要人工核查并调整翻译内容与格式。

使用方法

首先安装依赖库:

pip install -r requirements.txt

安装依赖后即可使用:

python main.py -i [ipath] -o [opath] -p [proxy]
  • -i [ipath](必需)指定输入路径,其中 [ipath] 为待翻译英文原文件路径
  • -o [ipath]:(可选)指定输出路径,其中 [opath] 为翻译后文件输出路径。不指定时覆盖输入文件。
  • -p [proxy]:(可选)指定代理地址,其中 [proxy] 为代理地址,形如 a.b.c.d:eprotocol://a.b.c.d:e不指定时请确保可以直连 https://translate.google.com/

亦支持长参数。如需了解请参阅源代码,在此不进行赘述。

我使用的 Python 版本为 3.10.5。

更新说明与功能计划

  • 2023-04-17:代码区前置空格检测
  • 2023-04-17:还原列表、引言等格式前的换行
  • 2023-05-18:改进了翻译,现在的翻译与网页版翻译一致
  • 保留列表、引言等格式标记的原样
  • 保留图表格式,仅翻译注解

About

Translate Fuchsia markdown docs automatically with Google Translate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages