A simple translator that allows you to translate any text you copy in linux.
Due to the keyboard library, you need to run the python script with sudo privilege, run sudo -i
for the package installation and then install the following packages.
pip3 install googletrans==3.1.0a0
pip3 install keyboard
apt install gxmessage
apt install xsel
The script takes 2 parameters. Source language and destination language. In the example below, source language is English and destination language is Turkish. (See other languages)
python3 translate.py en tr &
Do not forget to run script with sudo privilege.
After copying any text on your computer, you can get the translation result by pressing the q
button.
If you want to use a button other than q, change the part below in translate.py.
keyboard.wait('q')
Check out the keyboard library for buttons.