Use DeepL translator to fix English texts (through EN->DE->EN pipeline)
jq
for parsing JSON (install using sudo apt install jq
)curl
for making POST request to deepl json rpc server (install using sudo apt install curl
)Download the deepl-fix-english.sh
file and make sure it is executable.
The easiest way is to clone the latest version from github as follows:
git clone --depth 1 https://github.com/vsimko/deepl-fix-english.git
cd deepl-fix-english
For shorter texts use command line arguments
$ ./deepl-fix-english.sh Please translate this text
output
######################################################################## 100,0%
######################################################################## 100,0%
Please translate the following text
NOTE: not implemented properly yet, see issue #1
Multiline texts can be piped to the script through stdin as follows:
$ ./deepl-fix-english.sh
now you can write or copy-paste to console and hit ENTER and CTRL+D when finished:
This document contains multiple
lines and should also be translated
by DeepL without problems. (hit ENTER and CTRL+D)
######################################################################## 100,0%
######################################################################## 100,0%
This document contains several lines and should be easily translated by DeepL.
or from file
$ ./deepl-fix-english.sh < my_file_to_fix.txt
######################################################################## 100,0%
######################################################################## 100,0%
This document contains several lines and should be easily translated by DeepL.