If you're asking if it can be done, then yes. However, its is a bit complex. You'd need to use sockets in order to send the data and then receive the translation. however, it won't be instant; There will be some lag due to the time it takes to send the data, to process it, and then send the translation back. Depedning on your internet speed, you're looking at anywhere from 2 to 15 seconds (give or take).
There are scripts out there that do this kind of thing, though none that I know of use that site. The Altavista translator is the one most people use.
I'd recommend you find one of those, as there isn't much sense in re-inventing the wheel.