Skip to content

ltranslate is a simple Bash script that utilizes the LibreTranslate API from the terminal.

License

Notifications You must be signed in to change notification settings

tomit4/ltranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ltranslate: libretranslate in the terminal

Preview

asciicast

ltranslate is a simple translation tool written in bash. It was inspired by mariodujic's bash translate script. The major difference is that ltranslate uses the LibreTranslate API instead of Google's.

Installation

From your terminal emulator, clone this repository using 'git clone' followed by this url.

git clone <this_url>

cd ltranslate

ltranslate is packaged with an installation script for your convenience (this installation script does require root privileges, so please review it carefully before executing it).

You'll need to change the permissions on the install script in order to execute it:

chmod +x ./install.sh

Afterwards which simply invoke the script:

./install.sh

ltranslate also comes with an uninstall script, repeat the above commands above to uninstall, simply replacing 'install' with 'uninstall'.

Basic Usage

ltranslate sourcelang targetlang query

For example, if you wish to translate from English to Ukrainian:

ltranslate en uk Free as in Freedom!

Changing the LibreTranslate Mirror

This script utilizes the US Mirror of LibreTranslate. Should you wish to change it, simply open up the ltranslate script in your favorite text editor and change the url variiable to whichever Mirror you'd like.

Why did you make this?

I created ltranslate because I was inspired by mariodujic's bash translate script. It was simple and demonstrated the power of the curl command, as well as the standard UNIX utilities. I did, however, wish specifically to use a more FOSS friendly API, thus utilizing LibreTranslate instead of Google. LibreTranslate has far less language support (at the time of this writing), but is a fine FOSS alternative, so I decided it would be worth my time to write a variation on this.

Better CLI Translation Tools

For those of you wishing to simply get the most bang for your buck, you may want to check out translate-shell.

Supported Languages

Arabic ar
Azerbaijani az
Chinese zh
Czech cs
Danish da
Dutch nl
English en
Esperanto eo
Finnish fi
French fr
German de
Greek el
Hindi hi
Hungarian hu
Indonesian id
Irish ga
Italian it
Japanese ja
Korean ko
Persian fa
Polish pl
Portuguese pt
Russian ru
Slovak sk
Spanish es
Swedish sv
Turkish tr
Ukrainian uk

About

ltranslate is a simple Bash script that utilizes the LibreTranslate API from the terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages