Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc
一个终端翻译工具,利用Google翻译,Bing翻译,Yandex翻译等。
效果
123456789101112131415
$ trans androidAndroid
noun
(in science fiction) a robot with a human appearance.
- "The science fiction fascination with robots and androids is the culmination of this perception of machines as being almost like one of us." Synonyms: robot, automaton, cyborg, droid, bot
an open-source operating system used for smartphones and tablet computers.
- "I have an Android phone and I like it a lot"Synonyms
noun
- robot, automaton, cyborg, droid, bot
- humanoid
trans :zh "What is your name?"What is your name?
你叫什么名字?
(Nǐ jiào shénme míngzì?)Definitions of What is your name?
[ English -> 简体中文 ]interjection
贵姓?
What is your name?
What is your name?
你叫什么名字?, 请问你贵姓大名?
翻译文件内容
1234
/tmp(:|✔) % cat /tmp/greetings.txt
Hello, World
/tmp(:|✔) % trans en:zh file:///tmp/greetings.txt
你好,世界
查看更多详细
1
man trans
自己简单包裹一下
将下面的内容,保存成fanyi.sh并设置可执行,同时加入环境变量PATH.
12
#!/bin/bashtrans :zh "$1
使用时就更加简单
1234567891011
fanyi.sh Google
Google
谷歌
(Gǔgē)Translations of Google
[ English -> 简体中文 ]Google
谷歌