Google Translate is the one-stop service that most of us use for text or url translation. How cool is that if we can use in the terminal? Thanks to Translate Shell, which is a command-line utility which can help you to translate any text from your shell. Translate Shell is compatible with GNU/Linux, OS X (MacOS from now on), FreeBSD and even Windows (via Cygwin or MSYS2).
wget git.io/trans chmod +x ./trans sudo mv ./trans /usr/bin/
Note: In OS X if you encounter Operation Not Permitted error then please follow my previous article How to fix El Capitan 10.11 Operation Not Permitted error.
Basic Usage examples:
Show available languages:
Translate Shell uses your locale as your target language if you haven’t provided one as input. Setting UTF-8 codeset as your default locale is advisable as it supports multiple-languages. You can check your default locale using the following command,
Translate in brief:
trans -b お元気ですか?
Translate briefly and Interactively:
trans -b -I
and follow the prompt
Translate into a specific language:
trans :ja How are you?
Translate into multiple languages:
trans :ta+ja How are you?
Translate by providing input and output languages:
trans ja:en お元気ですか?
For advance usage, please read the github readme instructions.