Deepl – Command Line Language Translator Tool for Linux

14 Feb, 2021
Deepl is the best language translator command-line tool that detects the language of input text and translates it into the desired language using advanced machine learning and neural networking algorithms. It is open source and powered by a German tech Company under the MIT license.
It supports the following languages 
English (EN)
Italian (IT)
Spanish (ES)
Polish (PL)
French (FR)
German (DE)
Dutch (NL)
It also provides a paid subscription for the interested user and also has a free version (Deepl — CLI Translator Tool). This article will discuss the installation steps of the Deepl — CLI Translator Tool and the use of this Tool with some examples. 
Note: we will see a screenshot of only Ubuntu Linux Machine cause all Linux versions has similarity in installation process run all these command same as Ubuntu.
Step 1: Install the latest version of the Node.Js or If you have already installed then check the version of Node.js and it should be > 6.0
Step 2: Install Yarn package dependency manager in Linux Distribution
For different Linux distribution Run different Following Commands.
For Ubuntu:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
yarn --version 
For Centos / Fedora / RHEL:
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
yum install yarn  [On CentOS/RHEL Linux distribution ]
dnf install yarn  [On Fedora Linux distribution ]
yarn --version 
For Gentoo Linux:
sudo emerge --ask sys-apps/yarn
yarn --version 
Step 3: Now, Install Deepl – CLI Translator Tool
 yarn global add deepl-translator-cli
Step 4: Check Installation
deepl --version 
or
./yarn/bin/deepl  --version 
To Translate the text:
deepl translate  -t  '${ target_language_ISO_code }' '${ Input_string }'
To detect the language:
deepl detect   '${ target_language_ISO_code }' '${ Input_string }
To get a better understanding you can see the following drawing:
Example:
Command: deepl translate -t ‘DE’ ‘geeks for geeks is the best site’
Output : ‘geeks für geeks ist die beste Seite’
Explanation : Here given above command has three part 
Initial Command Syntax to translate → deepl translate -t target language ISO code → ‘DE’ (for german)Sentence that you want to translate → ‘geeks for geeks is the best site’
Initial Command Syntax to translate → deepl translate -t 
target language ISO code → ‘DE’ (for german)
Sentence that you want to translate → ‘geeks for geeks is the best site’
Command : deepl detect ‘geeks for geeks is the best site’
Output : English(EN)
Explanation : Here given above command has only two part
Initial Command Syntax to translate → deepl detectSentence for that you want to detect language → ‘geeks for geeks is the best site’
Initial Command Syntax to translate → deepl detect
Sentence for that you want to detect language → ‘geeks for geeks is the best site’
Linux-Tools
Picked
Linux-Unix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.