Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc
一个终端翻译工具,利用Google翻译,Bing翻译,Yandex翻译等。
效果
123456789101112131415
$ trans Android
Android
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 -R
┌───────────────────────┬───────────────────────┬───────────────────────┐
│ Afrikaans - af │ Hebrew - he │ Portuguese - pt │
│ Albanian - sq │ Hill Mari - mrj │ Punjabi - pa │
│ Amharic - am │ Hindi - hi │ Querétaro Otomi- otq │
│ Arabic - ar │ Hmong - hmn │ Romanian - ro │
│ Armenian - hy │ Hmong Daw - mww │ Russian - ru │
│ Azerbaijani - az │ Hungarian - hu │ Samoan - sm │
│ Bashkir - ba │ Icelandic - is │ Scots Gaelic - gd │
│ Basque - eu │ Igbo - ig │ Serbian (Cyr...-sr-Cyrl
│ Belarusian - be │ Indonesian - id │ Serbian (Latin)-sr-Latn
│ Bengali - bn │ Irish - ga │ Sesotho - st │
│ Bosnian - bs │ Italian - it │ Shona - sn │
│ Bulgarian - bg │ Japanese - ja │ Sindhi - sd │
│ Cantonese - yue │ Javanese - jv │ Sinhala - si │
│ Catalan - ca │ Kannada - kn │ Slovak - sk │
│ Cebuano - ceb │ Kazakh - kk │ Slovenian - sl │
│ Chichewa - ny │ Khmer - km │ Somali - so │
│ Chinese Simp...- zh-CN│ Klingon - tlh │ Spanish - es │
│ Chinese Trad...- zh-TW│ Klingon (pIqaD)tlh-Qaak Sundanese - su │
│ Corsican - co │ Korean - ko │ Swahili - sw │
│ Croatian - hr │ Kurdish - ku │ Swedish - sv │
│ Czech - cs │ Kyrgyz - ky │ Tahitian - ty │
│ Danish - da │ Lao - lo │ Tajik - tg │
│ Dutch - nl │ Latin - la │ Tamil - ta │
│ Eastern Mari - mhr │ Latvian - lv │ Tatar - tt │
│ Emoji - emj │ Lithuanian - lt │ Telugu - te │
│ English - en │ Luxembourgish - lb │ Thai - th │
│ Esperanto - eo │ Macedonian - mk │ Tongan - to │
│ Estonian - et │ Malagasy - mg │ Turkish - tr │
│ Fijian - fj │ Malay - ms │ Udmurt - udm │
│ Filipino - tl │ Malayalam - ml │ Ukrainian - uk │
│ Finnish - fi │ Maltese - mt │ Urdu - ur │
│ French - fr │ Maori - mi │ Uzbek - uz │
│ Frisian - fy │ Marathi - mr │ Vietnamese - vi │
│ Galician - gl │ Mongolian - mn │ Welsh - cy │
│ Georgian - ka │ Myanmar - my │ Xhosa - xh │
│ German - de │ Nepali - ne │ Yiddish - yi │
│ Greek - el │ Norwegian - no │ Yoruba - yo │
│ Gujarati - gu │ Papiamento - pap │ Yucatec Maya - yua │
│ Haitian Creole - ht │ Pashto - ps │ Zulu - zu │
│ Hausa - ha │ Persian - fa │ │
│ Hawaiian - haw │ Polish - pl │ │
└───────────────────────┴───────────────────────┴───────────────────────┘
翻译句子
123456789101112131415
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
谷歌