translater
Version, currently 0.7.026 versions
- 0.7.0latestJul 13, 2024
- 0.6.6not indexedDec 6, 2024
- 0.6.5not indexedDec 6, 2024
- 0.6.4not indexedDec 6, 2024
- 0.6.3not indexedDec 6, 2024
- 0.6.2not indexedDec 6, 2024
- 0.6.1not indexedDec 6, 2024
- 0.6.0not indexedDec 6, 2024
- 0.5.0not indexedDec 6, 2024
- 0.4.9not indexedDec 6, 2024
- 0.4.8not indexedDec 6, 2024
- 0.4.6not indexedDec 6, 2024
- 0.4.4not indexedDec 6, 2024
- 0.4.3not indexedDec 6, 2024
- 0.4.2not indexedDec 6, 2024
- 0.4.1not indexedDec 6, 2024
- 0.4.0not indexedDec 6, 2024
- 0.3.0not indexedDec 6, 2024
- 0.2.3not indexedDec 6, 2024
- 0.2.2not indexedDec 6, 2024
- 0.2.1not indexedDec 6, 2024
- 0.2.0not indexedDec 6, 2024
- 0.1.1not indexedDec 6, 2024
- 0.1.0not indexedDec 6, 2024
- test1not indexedDec 6, 2024
- t0.3.0not indexedDec 6, 2024
github.com/crystal-china/translater
command line translate tools, Use headless firefox internally, support Linux/Mac for now.
Installation
# Add this to your shard.yml
dependencies:
translater:
github: crystal-china/translater
version: ~> 0.7.0Then run:
shards installshard.yml
- Crystal
1.11.2- License
- MIT
- Author
- Billy.Zheng
- Target
translaterfrom src/cli.cr
Dependencies
Runtime Dependencies
- sqlite3*github: crystal-lang/crystal-sqlite3
- timeout*github: wyhaines/timeout.cr
- selenium*github: zw963/selenium.cr
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
translater
基于多翻译引擎的整句翻译命令行程序,仅支持 中英、英中 整句互译,会根据要翻译的语言自动判断。
目前支持如下如下引擎:
但是不保证以上所有引擎都可用, 建议电脑启动后第一次使用前, 运行 ./translater --init 来检测引擎可用性, 此操作会关闭所有不可用引擎, 确保稍后的使用体验.
本工具适合中英文整句互译,如需翻译单词详细释义,请使用其他工具。
默认会随机选择一个支持的引擎来翻译,这可以避免过于频繁的使用某一翻译引擎而导致 IP 被封。
搭配 goldendict 作为词典之一,一起食用效果更佳!

╰─ $ bin/translater 'hello world!'
Using Ali
---------- Ali, spent 7.15 seconds use Firefox ----------
你好世界!
╰─ $ bin/translater '那些杀不死你的,终将使你变得更强大'
Using Bing
---------- Bing, spent 6.07 seconds use Firefox ----------
What doesn't kill you will make you stronger
某一翻译引擎运行一次之后,如果再次选择该引擎,因为使用了浏览器 cache, 速度将得到极大提升!
在我本地测试,平均出翻译结果时间在两秒左右。
╰─ $ bin/translater -e ali "Those who can't kill you will eventually make you stronger."
Using Ali
---------- Ali, spent 1.91 seconds use Firefox cache ----------
那些不能杀死你的人最终会让你更强大
╰─ $ bin/translater -e bing '你好,世界!'
Using Bing
---------- Bing, spent 2.90 seconds use Firefox cache ----------
Hello, world!
translater --help 获取有关参数的更多帮助。
Arch Linux 安装
可以通过 Arch Linux 的 AUR 仓库安装 translater-git 或自建源
yay -Syu translater
Dependencies
火狐(Firefox)浏览器及 geckodriver (selenium driver for Firefox).
以 Arch Linux 为例:
$: pacman -S firefox geckodriver
或安装 Firefox 之后,自己下载 geckodriver,并拷贝至 /usr/local/bin
Sqlite3
translater 使用 Sqlite3 保存缓存的 session,来加速翻译流程。
translster 同时还维护一个最快引擎的数据库,会自动记录每次不同引擎翻译的耗时, 可以使用 --profile 初始化数据库以及分析那个翻译引擎速度快一些。,见:--auto 以及 --profile 选项。
Installation
从 release 页面 下载(单文件)最新版, 扔到 $PATH 的文件夹里,目前支持 Linux 和 OSX.
或者从源码编译安装:
$: make release
$: sudo make install
TODO
- 支持字节的火山翻译引擎, 当前,甚至非 headless 启动,手动输入翻译内容也不工作,字节,你真牛逼~
- 腾讯翻译现在也不能用了, 🌿你个垃圾腾讯!
Contributing
- Fork it (https://github.com/zw963/translater/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Billy.Zheng - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.7.0- Tagged
- Jul 13, 2024
- Commit
6f23530f5264- Crystal
1.11.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/crystal-china/translater
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 26