python-translator
Simple yet effective module for translating.
Uses requests to access https://translate.google.com/ and fetches the translated text.
installation:
-
pip install ptranslator
Dont forget to add "<path_to_python>/Scripts" to PATH
-
sudo pip install ptranslator
Probably won't run unless you use
sudo
when installing -
In this case refer to this article or if you need any aditional help please feel free to contact me :)
Usage:
ptranslator "text" to_language(default=en) from_language(optional)
-
> ptranslator "Hallo Welt!" Hello World! > ptranslator "Здраво Свете!" en Hello World! > ptranslator "Hola Mundo!" en es Hello World!
-
from ptranslator import translate # translate( text , to_language , from_language ) translate("Hello World!", "de") #second and third arguments are optional #output: Hallo Welt!