You can send a request to translate.google.com which generates a file named "json.txt" in JSON format, that you can parse.
Main parameters are :
q="sentence to be translated"
sl=source language
or
sl=auto
tl=translation language
For example, with a french sentence "ma voiture est tombée en panne" :
(link is cutted by editor, do copy-paste of the 2 lines...)
https://translate.google.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q="ma voiture est tombée en panne"
generates "json.txt" file with the translation "my car broke down"