Skip to content
This repository has been archived by the owner on Nov 26, 2021. It is now read-only.

fengkx/translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translator

Build Status
多引擎命令行翻译工具 PreBuild下载

Usage of tl:
  -e string
    	engine (default "google")
  -raw
    	raw output without color escape
  -s string
    	source language (default "auto")
  -t string
    	target language
Supported engines: ciba, youdao, bdfanyi, google
Config ini path: /home/fengkx/.config

engine名 中文 备注
google Google翻译 ajax接口
ciba 金山词霸 ajax接口
youdao 有道翻译 ajax接口
bdfanyi 百度翻译 商业接口

通过环境变量http_proxy or https_proxy来代理请求

通过 ini 配置文件设置输出终端颜色,API host等参数。ini路径在Usage中有显示 文件名为go-translator.ini

默认ini内容

# Translator configuration
[google]
HOST=https://translate.googleapis.com/

[ciba]
HOST=http://fy.iciba.com/ajax.php

[youdao]
HOST=http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule

[bdfanyi]
HOST=https://fanyi-api.baidu.com/api/trans/vip/translate
APPID=XXXXXXXXX
APPKEY=XXXXXXXXXX

[output]
# only support black red green yellow blue magenta cyan white
# raw=true # output to raw text without color
LabelColor=green
TextColor=white
EgColor=yellow

感谢 翻译接口总结

windows linux