iis服务器助手广告广告
返回顶部
首页 > 资讯 > 操作系统 >Linux下怎么安装并使用Translate Shell
  • 929
分享到

Linux下怎么安装并使用Translate Shell

2023-06-27 10:06:24 929人浏览 薄情痞子
摘要

今天小编给大家分享一下linux下怎么安装并使用Translate shell的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。

今天小编给大家分享一下linux下怎么安装并使用Translate shell的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。

Translate Shell 是一个支持 Google Translate、Bing Translator、Yandex.Translate 和 Apertium 翻译引擎的命令行翻译器,默认使用的是 Google Translate 引擎。

Linux下怎么安装并使用Translate Shell

如何安装 Translate Shell

有三种方法安装 Translate Shell。

  • 下载自包含的可执行文件
  • 手工安装
  • 通过包管理器安装

方法 1 : 下载自包含的可执行文件

下载自包含的可执行文件放到 /usr/bin 目录中。

$ wget git.io/trans$ chmod +x ./trans$ sudo mv trans /usr/bin/

方法 2 : 手工安装

克隆 Translate Shell 的 GitHub 仓库然后手工编译。

$ git clone https://github.com/soimort/translate-shell && cd translate-shell$ make$ sudo make install

方法 3 : 通过包管理器

有些发行版的官方仓库中包含了 Translate Shell,可以通过包管理器来安装。

对于 Debian/ubuntu, 使用 APT-GET 命令[2] 或者 APT 命令[3]来安装。

$ sudo apt-get install translate-shell

对于 Fedora, 使用 DNF 命令[4] 来安装。

$ sudo dnf install translate-shell

对于基于 Arch Linux 的系统, 使用 Yaourt 命令[5] 或 Packer 明快[6] 来从 AUR 仓库中安装。

$ yaourt -S translate-shellor$ packer -S translate-shell

如何使用 Translate Shell

安装好后,打开终端闭关输入下面命令。 谷歌翻译会自动探测源文本是哪种语言,并且在默认情况下将之翻译成你的 locale 所对应的语言。

$ trans [Words]

下面我将泰米尔语中的单词 “நன்றி” (Nanri) 翻译成英语。 这个单词的意思是感谢别人。

$ trans நன்றிநன்றி(Naṉṟi)ThanksDefinitions of நன்றி[ தமிழ் -> English ]noun   gratitude       நன்றி   thanks       நன்றிநன்றி   Thanks

使用下面命令也能将英语翻译成泰米尔语。

$ trans :ta thanksthanks/THaNGks/நன்றி(Naṉṟi)Definitions of thanks[ English -> தமிழ் ]noun   நன்றி       gratitude, thanksthanks   நன்றி

要将一个单词翻译到多个语种可以使用下面命令(本例中,我将单词翻译成泰米尔语以及印地语)。

$ trans :ta+hi thanksthanks/THaNGks/நன்றி(Naṉṟi)Definitions of thanks[ English -> தமிழ் ]noun   நன்றி       gratitude, thanksthanks   நன்றிthanks/THaNGks/धन्यवाद(dhanyavaad)Definitions of thanks[ English -> हिन्दी ]noun   धन्यवाद       thanks, thank, gratitude, thankfulness, felicitationthanks   धन्यवाद, शुक्रिया

使用下面命令可以将多个单词当成一个参数(句子)来进行翻译。(只需要把句子应用起来作为一个参数就行了)。

$ trans :ta "what is going on your life?"what is going on your life?உங்கள் வாழ்க்கையில் என்ன நடக்கிறது?(Uṅkaḷ vāḻkkaiyil eṉṉa naṭakkiṟatu?)Translations of what is going on your life?[ English -> தமிழ் ]what is going on your life?   உங்கள் வாழ்க்கையில் என்ன நடக்கிறது?

下面命令单独地翻译各个单词。

$ trans :ta curiOS happycuriosஆர்வம்(Ārvam)Translations of curios[ Română -> தமிழ் ]curios   ஆர்வம், அறிவாளிகள், ஆர்வமுள்ள, அறிய, ஆர்வமாகhappy/ˈhapē/சந்தோஷமாக(Cantōṣamāka)Definitions of happy[ English -> தமிழ் ]   மகிழ்ச்சியான       happy, convivial, debonair, gay   திருப்தி உடைய       happyadjective   இன்பமான       happyhappy   சந்தோஷமாக, மகிழ்ச்சி, இனிய, சந்தோஷமா

简洁模式:默认情况下,Translate Shell 尽可能多的显示翻译信息。如果你希望只显示简要信息,只需要加上 -b选项。

$ trans -b :ta thanksநன்றி

字典模式:加上 -d 可以把 Translate Shell 当成字典来用。

$ trans -d :en thanksthanks/THaNGks/Synonyms   noun       - gratitude, appreciation, acknowledgment, recognition, credit   exclamation       - thank you, many thanks, thanks very much, thanks a lot, thank you kindly, much obliged, much appreciated, bless you, thanks a millionExamples   - 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 thanksTranslate Shell(:q to quit)thanks/THaNGks/நன்றி(Naṉṟi)Definitions of thanks[ English -> தமிழ் ]noun   நன்றி       gratitude, thanksthanks   நன்றி

想知道语言代码,可以执行下面命令。

$ 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

以上就是“Linux下怎么安装并使用Translate Shell”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注编程网操作系统频道。

--结束END--

本文标题: Linux下怎么安装并使用Translate Shell

本文链接: https://www.lsjlt.com/news/310157.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Linux下怎么安装并使用Translate Shell
    今天小编给大家分享一下Linux下怎么安装并使用Translate Shell的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。...
    99+
    2023-06-27
  • Linux中如何安装和使用Translate Shell
    这篇文章主要介绍了Linux中如何安装和使用Translate Shell,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。Translate Shell 是一个支持 Googl...
    99+
    2023-06-27
  • Linux下如何安装并使用fish shell
    这篇文章将为大家详细讲解有关Linux下如何安装并使用fish shell,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。fish 是一个非常用户友好的并且功能丰富的 shell,但没有包括在大多数 Lin...
    99+
    2023-06-27
  • Linux下怎么安装并使用Hping
    本篇内容主要讲解“Linux下怎么安装并使用Hping”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Linux下怎么安装并使用Hping”吧!Hping是一个命令行下使用的TCP/IP数据包组装...
    99+
    2023-06-27
  • Linux下怎么安装并使用Dutree
    这篇文章主要介绍“Linux下怎么安装并使用Dutree”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Linux下怎么安装并使用Dutree”文章能帮助大家解决问题。dutree是一款免费的开源,快...
    99+
    2023-06-27
  • Linux下怎么安装并使用Remmina
    本篇内容主要讲解“Linux下怎么安装并使用Remmina”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Linux下怎么安装并使用Remmina”吧!Remmina 是一款在 Linux 和其他...
    99+
    2023-06-27
  • Linux下怎么安装并使用ksnip
    这篇文章主要介绍“Linux下怎么安装并使用ksnip”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Linux下怎么安装并使用ksnip”文章能帮助大家解决问题。使用你首选的包管理器安装 Ksnip...
    99+
    2023-06-27
  • Linux下如何安装并使用ClusterShell
    这篇文章主要为大家展示了“Linux下如何安装并使用ClusterShell”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux下如何安装并使用ClusterShell”这篇文章吧。Clus...
    99+
    2023-06-27
  • Linux下如何安装并使用Iperf
    这篇文章将为大家详细讲解有关Linux下如何安装并使用Iperf,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。Iperf 是一个网络性能测试工具。Iperf可以测试最大TCP和UDP带宽性能,具有多种参数...
    99+
    2023-06-27
  • Linux下如何安装并使用Speedtest
    这篇文章主要介绍了Linux下如何安装并使用Speedtest的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Linux下如何安装并使用Speedtest文章都会有所收获,下面我们一起来看看吧。安装speedte...
    99+
    2023-06-27
  • Linux下如何安装并使用tmux
    小编给大家分享一下Linux下如何安装并使用tmux,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!tmux是Linux上的终端复用神器,可从一个屏幕上管理多个终端...
    99+
    2023-06-27
  • Linux下如何安装并使用Supervisor
    这篇文章主要为大家展示了“Linux下如何安装并使用Supervisor”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux下如何安装并使用Supervisor”这篇文章吧。Supervis...
    99+
    2023-06-27
  • Linux下如何安装并使用jod
    小编给大家分享一下Linux下如何安装并使用jod,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!Jed是一个基于终端的编辑器,它的特点是有一个方便的下拉菜单,这让...
    99+
    2023-06-27
  • Linux下如何安装并使用Terminalizer
    小编给大家分享一下Linux下如何安装并使用Terminalizer,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!Terminalizer 是一个非常酷炫的命令行...
    99+
    2023-06-27
  • Linux下如何安装并使用Fcitx
    小编给大家分享一下Linux下如何安装并使用Fcitx,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!Fcitx 是一个支持扩展的输入法框架。目前,它支持Linux...
    99+
    2023-06-27
  • CentOS下怎么安装并使用ProFTPd
    本篇内容介绍了“CentOS下怎么安装并使用ProFTPd”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!安装:安装EPEL软件包代码如下:r...
    99+
    2023-06-10
  • Linux下怎么安装使用Node.js
    这篇文章主要介绍“Linux下怎么安装使用Node.js”,在日常操作中,相信很多人在Linux下怎么安装使用Node.js问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Linux下怎么安装使用Node.js...
    99+
    2023-06-27
  • Linux下如何安装并使用apt-clone
    这篇文章将为大家详细讲解有关Linux下如何安装并使用apt-clone,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。当我们在基于 Ubuntu/Debian 的系统上使用apt-clone ,包安装会变...
    99+
    2023-06-27
  • Linux下如何安装并且使用bmon
    这篇文章将为大家详细讲解有关Linux下如何安装并且使用bmon,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。bmon是一个简单但功能强大的基于文本的网络监视和调试工具 ,用于类Unix系统,捕获网络相关...
    99+
    2023-06-27
  • Linux下如何安装并使用迅雷
    这篇文章将为大家详细讲解有关Linux下如何安装并使用迅雷,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。编译环境安装必备的软件。sudo apt-get install git build-essenti...
    99+
    2023-06-27
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作