Translate Shell is a command line tool that translates text into a different language. This tool supports various translation engines. Google Translate engine is used by default.
This tutorial demonstrates how to install Translate Shell on Raspberry Pi.
Use SSH to connect to Raspberry Pi. Download the trans
script and place it to the /usr/local/bin
directory. Then add execute permission to the script.
sudo wget -O /usr/local/bin/trans https://git.io/trans
sudo chmod a+x /usr/local/bin/trans
Translate Shell is available as trans
command for all users. Use version
option in order to get version of Translate Shell and various configuration settings such as user locale, default translation engine, etc.
trans -version
Now run the trans
command and provide a text as argument to translate. Google Translate is used by default and it can identify the language of the source text automatically. By default, source text will be translated into the language of user locale which can be determined with locale
command.
trans "Hallo Welt"
Output:
Hallo Welt
Hello World
Translations of Hallo Welt
[ Deutsch -> English ]
Hallo Welt
Hello World
We can translate a text from any language into specific language as follows:
trans :es "Hallo Welt"
We can also translate a text from specific language into the language of user locale:
trans de: "Hallo Welt"
Also possible to specify the languages of the source and target text:
trans de:es "Hallo Welt"
We can use -S
option to get a list of available translation engines.
trans -S
Use -e
option to specify the translation engine.
trans -e bing "Hallo Welt"
If you wish to remove Translate Shell, just delete related script:
sudo rm -rf /usr/local/bin/trans
Leave a Comment
Cancel reply