Translate Shell 是一个支持 Google Translate、Bing Translator、Yandex.Translate 和 Apertium 默认使用翻译引擎的命令行翻译器 Google Translate 引擎,下面给大家讲解一下Linux安装和使用Translate Shell具体方法。
如何安装 Translate Shell
安装方法有三种 Translate Shell。
-
下载包含的可执行文件
-
手工安装
-
安装包管理器
方法 1 : 下载包含的可执行文件
下载包含的可执行文件并放入 /usr/bin 目录中。
$wgetgit.io/trans $chmod x./trans $sudomvtrans/usr/bin/
方法 2 : 手工安装
克隆 Translate Shell 的 GitHub 然后手工编译仓库。
$gitclonehttps://github.com/soimort/translate-shell&&cdtranslate-shell $make $sudomakeinstall
方法 3 : 通过包管理器
一些发行版的官方仓库包括 Translate Shell,可通过包管理器安装。
对于 Debian/Ubuntu, 使用APT-GET 命令[2] 或者APT 安装命令[3]。
$sudoapt-getinstalltranslate-shell
对于 Fedora, 使用DNF 命令[4] 来安装。
$sudodnfinstalltranslate-shell
对于基于 Arch Linux 的系统, 使用Yaourt 命令[5] 或Packer 明快[6] 来从 AUR 仓库中安装。
$yaourt-Stranslate-shell or $packer-Stranslate-shell
如何使用 Translate Shell
安装后,打开终端闭关输入以下命令。 谷歌翻译将自动探索源文本的语言,并在默认情况下将其翻译成您 locale 对应语言。
$trans[Words]
接下来,我将泰米尔语中的单词 ??” (Nanri) 翻译成英语。 这个词的意思是感谢别人。
$trans????? ????? (Na??i) Thanks Definitionsof????? [?????->English] noun gratitude ????? thanks ????? ????? Thanks
英语也可以用下面的命令翻译成泰米尔语。
$trans:tathanks thanks /THaNGks/ ????? (Na??i) Definitionsofthanks [English->?????] noun ????? gratitude,thanks thanks ?????
下面的命令可以用来翻译一个单词到多个语言(在这种情况下,我单词翻译成泰米尔语和印地语)。
$trans:ta hithanks thanks /THaNGks/ ????? (Na??i) Definitionsofthanks [English->?????] noun ????? gratitude,thanks thanks ????? thanks /THaNGks/ ??????? (dhanyavaad) Definitionsofthanks [English->??????] noun ??????? thanks,thank,gratitude,thankfulness,felicitation thanks ???????,????????
使用下面的命令可以翻译多个单词作为参数(句子)。(只需将句子作为参数应用即可)。
$trans:ta"whatisgoingonyourlife?" whatisgoingonyourlife? ???????????????????????????????? (U?ka?vā?kkaiyile??ana?akki?atu?) Translationsofwhatisgoingonyourlife? [English->?????] whatisgoingonyourlife? ????????????????????????????????
以下命令单独翻译每个单词。
$trans:tacurioshappy curios ?????? (ārvam) Translationsofcurios [Roman?->?????] curios ??????,??????????,?????????,????,??????? happy /?hapē/ ?????????? (Cantō?amāka) Definitionsofhappy [English->?????] ???????????? happy,convivial,debonair,gay ???????????? happy adjective ??????? happy happy ??????????,?????????,????,?????????
简约模式:默认情况下,Translate Shell 尽可能多地显示翻译信息。如果只显示简短信息,只需添加 -b选项。
$trans-b:tathanks ???
字典模式:添加 -d 可以把 Translate Shell 作为字典使用。
$trans-d:enthanks thanks /THaNGks/ Synonyms noun -gratitude,appreciation,acknowledgment,recognition,credit exclamtion
- thank you, many thanks, thanks very much, thanks a lot, thank you kindly, much obliged, much appreciated, bless you, thanks a million
Examples
- In short, thanks for everything that makes this city great this Thanksgiving.
- many thanks
- There were no thanks in the letter from him, just complaints and accusations.
- It is a joyful celebration in which Bolivians give thanks for their freedom as a nation.
- festivals were held to give thanks for the harvest
- The collection, as usual, received a great response and thanks is extended to all who subscribed.
- It would be easy to dwell on the animals that Tasmania has lost, but I prefer to give thanks for what remains.
- thanks for being so helpful
- It came back on about half an hour earlier than predicted, so I suppose I can give thanks for that.
- Many thanks for the reply but as much as I tried to follow your advice, it's been a bad week.
- To them and to those who have supported the office I extend my grateful thanks .
- We can give thanks and words of appreciation to others for their kind deeds done to us.
- Adam, thanks for taking time out of your very busy schedule to be with us tonight.
- a letter of thanks
- Thank you very much for wanting to go on reading, and thanks for your understanding.
- Gerry has received a letter of thanks from the charity for his part in helping to raise this much needed cash.
- So thanks for your reply to that guy who seemed to have a chip on his shoulder about it.
- Suzanne, thanks for being so supportive with your comments on my blog.
- She has never once acknowledged my thanks , or existence for that matter.
- My grateful thanks go to the funders who made it possible for me to travel.
- festivals were held to give thanks for the harvest
- All you secretaries who made it this far into the article… thanks for your patience.
- So, even though I don't think the photos are that good, thanks for the compliments!
- And thanks for warning us that your secret service requires a motorcade of more than 35 cars.
- Many thanks for your advice, which as you can see, I have passed on to our readers.
- Tom Ryan was given a bottle of wine as a thanks for his active involvement in the twinning project.
- Mr Hill insists he has received no recent complaints and has even been sent a letter of thanks from the forum.
- Hundreds turned out to pay tribute to a beloved former headteacher at a memorial service to give thanks for her life.
- Again, thanks for a well written and much deserved tribute to our good friend George.
- I appreciate your doing so, and thanks also for the compliments about the photos!
See also
Thanks!, thank, many thanks, thanks to, thanks to you, special thanks, give thanks, thousand thanks, Many thanks!, render thanks, heartfelt thanks, thanks to this
使用下面格式可以使用 Translate Shell 来翻译文件。
$ trans :ta file:///home/magi/gtrans.txt
உங்கள் வாழ்க்கையில் என்ன நடக்கிறது?
下面命令可以让 Translate Shell 进入交互模式。 在进入交互模式之前你需要明确指定源语言和目标语言。本例中,我将英文单词翻译成泰米尔语。
$ trans -shell en:ta thanks
Translate Shell
(:q to quit)
thanks
/THaNGks/
நன்றி
(Naṉṟi)
Definitions of thanks
[ English -> தமிழ் ]
noun
நன்றி
gratitude, thanks
thanks
நன்றி
想知道语言代码,可以执行下面命令。
$ trans -R
或者
$ trans -T
┌───────────────────┬────────────────────┬────────────────────┐
│ Afrikaans - af │ Hindi - hi │ Punjabi - pa │
│ Albanian - sq │ Hmong - hmn │ Querétaro Otomi- otq │
│ Amharic - am │ Hmong Daw - mww │ Romanian - ro │
│ Arabic - ar │ Hungarian - hu │ Russian - ru │
│ Armenian - hy │ Icelandic - is │ Samoan - sm │
│ Azerbaijani - az │ Igbo - ig │ Scots Gaelic - gd │
│ Basque - eu │ Indonesian - id │ Serbian (Cyr...-sr-Cyrl
│ Belarusian - be │ Irish - ga │ Serbian (Latin)-sr-Latn
│ Bengali - bn │ Italian - it │ Sesotho - st │
│ Bosnian - bs │ Japanese - ja │ Shona - sn │
│ Bulgarian - bg │ Javanese - jv │ Sindhi - sd │
│ Cantonese - yue │ Kannada - kn │ Sinhala - si │
│ Catalan - ca │ Kazakh - kk │ Slovak - sk │
│ Cebuano - ceb │ Khmer - km │ Slovenian - sl │
│ Chichewa - ny │ Klingon - tlh │ Somali - so │
│ Chinese Simp...- zh-CN│ Klingon (pIqaD)tlh-Qaak Spanish - es │
│ Chinese Trad...- zh-TW│ Korean - ko │ Sundanese - su │
│ Corsican - co │ Kurdish - ku │ Swahili - sw │
│ Croatian - hr │ Kyrgyz - ky │ Swedish - sv │
│ Czech - cs │ Lao - lo │ Tahitian - ty │
│ Danish - da │ Latin - la │ Tajik - tg │
│ Dutch - nl │ Latvian - lv │ Tamil - ta │
│ English - en │ Lithuanian - lt │ Tatar - tt │
│ Esperanto - eo │ Luxembourgish - lb │ Telugu - te │
│ Estonian - et │ Macedonian - mk │ Thai - th │
│ Fijian - fj │ Malagasy - mg │ Tongan - to │
│ Filipino - tl │ Malay - ms │ Turkish - tr │
│ Finnish - fi │ Malayalam - ml │ Udmurt - udm │
│ French - fr │ Maltese - mt │ Ukrainian - uk │
│ Frisian - fy │ Maori - mi │ Urdu - ur │
│ Galician - gl │ Marathi - mr │ Uzbek - uz │
│ Georgian - ka │ Mongolian - mn │ Vietnamese - vi │
│ German - de │ Myanmar - my │ Welsh - cy │
│ Greek - el │ Nepali - ne │ Xhosa - xh │
│ Gujarati - gu │ Norwegian - no │ Yiddish - yi │
│ Haitian Creole - ht │ Pashto - ps │ Yoruba - yo │
│ Hausa - ha │ Persian - fa │ Yucatec Maya - yua │
│ Hawaiian - haw │ Polish - pl │ Zulu - zu │
│ Hebrew - he │ Portuguese - pt │ │
└───────────────────┴────────────────────┴────────────────────┘
想了解更多选项的内容,可以查看其 man 手册。
$ man trans