Interacting with web pages is a nice hobby, and in case you want to try some yourself here are a few points on how this was put together.
You need a basic idea of, or willingness to learn, html, regular expressions, grep, sed and probably awk. A basic idea will go a long way. 
1) Have a look at the code. Your browser will show it. http://translate.google.com is a horrible porridge of html tags and lots of javascript, all packed into a mere 17 lines, broken apparently at random. I nearly gave up at this point, but try selecting the bit round the result box where the translated text appears and right-click "View selection source" (in Firefox anyway). That's more reasonable, though still huge:
<div id="gt-res-wrap"><div id="gt-res-content" class="almost_half_cell"><div dir="ltr" style=""><div id="tts_button" style="" class=""><div role="button" tabindex="0" dataattribute="http://www.gstatic.com/translate/sound_player2.swf" title="http://www.gstatic.com/translate/sound_player2.swf" style="background: url("chrome://flashblock/content/flash.png") no-repeat scroll center center transparent ! important; min-width: 32px ! important; min-height: 32px ! important; width: 32px; height: 32px; border: 1px solid rgb(223, 223, 223); cursor: pointer; overflow: hidden; display: inline-block; visibility: visible ! important; -moz-box-sizing: border-box;" bgactive="url(chrome://flashblock/content/flashplay.png) no-repeat center" bginactive="url(chrome://flashblock/content/flash.png) no-repeat center"></div></div><span id="result_box" class="short_text" lang="en"><span class="hps">dog</span></span></div></div><div id="spell-place-holder" style="height: 27px;"></div>
The translation, "dog" in this case, is near the end of this section, inside a span with an id of "result_box". That's good news because an id means nothing else on the page can share it - it's a unique identifier for our results. Hmm OK maybe it's possible.
2) Try it in a terminal. I used curl here, though wget is probably OK too.
john@raffles3:~$ curl http://translate.google.com
<!DOCTYPE html><html lang=en><meta charset=utf-8><title>Error 403 (Forbidden)!!1</title><style>*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAADVCAMAAAAfHvCaAAAAGFBMVEVYn%2BH [i](lots and lots of this stuff - probably a base64 coded image)[/i] KJF%2FzufdnZtz7PrrevDZ03GPAaJDjbRA8dGsW6X6cgNmAhSEG%2FUiY%2Fsfiv02O7iVu1LunAAAAAElFTkSuQmCC);display:block;height:55px;margin:0 0 -7px;width:150px}* > #g{margin-left:-2px}#g img{visibility:hidden}* html #g img{visibility:visible}*+html #g img{visibility:visible}</style><a href=//www.google.com/ id=g><img src=//www.google.com/images/logo_sm.gif alt=Google></a><p><b>403.</b> <ins>That’s an error.</ins><p>Your client does not have permission to get URL <code>/</code> from this server. (Client IP address: 61.211.133.253)<br><br>
<ins>That’s all we know.</ins>
Anyway it's no good. It was OK in Firefox but Google don't like curl (or wget). Both of them are honest by default and tell the server who they are. We can fix it with the --user-agent option, just an empty string "" is enough, so
curl --user-agent "" http://translate.google.com > test.html
will get us a local copy of the page to play with without hitting Google over and over.
3) How to send the request? There's a handy perl script called formfind.pl here from the curl people. Send it that Google porridge and it will tell you about the webform inside:
john@raffles3:~$ curl --user-agent "" http://translate.google.com | ./scripts/formfind.pl
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 37418 0 37418 0 0 217k 0 --:--:-- --:--:-- --:--:-- 285k
--- FORM report. Uses POST to URL "/"
--- type: application/x-www-form-urlencoded
Select: NAME="sl"
Option VALUE="auto" (SELECTED)
Option VALUE="separator"
Option VALUE="af"
Option VALUE="sq"
Option VALUE="ar"
Option VALUE="hy"
Option VALUE="az"
Option VALUE="eu"
Option VALUE="be"
Option VALUE="bn"
Option VALUE="bg"
Option VALUE="ca"
Option VALUE="zh-CN"
Option VALUE="hr"
Option VALUE="cs"
Option VALUE="da"
Option VALUE="nl"
Option VALUE="en"
Option VALUE="et"
Option VALUE="tl"
Option VALUE="fi"
Option VALUE="fr"
Option VALUE="gl"
Option VALUE="ka"
Option VALUE="de"
Option VALUE="el"
Option VALUE="gu"
Option VALUE="ht"
Option VALUE="iw"
Option VALUE="hi"
Option VALUE="hu"
Option VALUE="is"
Option VALUE="id"
Option VALUE="ga"
Option VALUE="it"
Option VALUE="ja"
Option VALUE="kn"
Option VALUE="ko"
Option VALUE="la"
Option VALUE="lv"
Option VALUE="lt"
Option VALUE="mk"
Option VALUE="ms"
Option VALUE="mt"
Option VALUE="no"
Option VALUE="fa"
Option VALUE="pl"
Option VALUE="pt"
Option VALUE="ro"
Option VALUE="ru"
Option VALUE="sr"
Option VALUE="sk"
Option VALUE="sl"
Option VALUE="es"
Option VALUE="sw"
Option VALUE="sv"
Option VALUE="ta"
Option VALUE="te"
Option VALUE="th"
Option VALUE="tr"
Option VALUE="uk"
Option VALUE="ur"
Option VALUE="vi"
Option VALUE="cy"
Option VALUE="yi"
[end of select]
Select: NAME="tl"
Option VALUE="af"
Option VALUE="sq"
Option VALUE="ar"
Option VALUE="hy"
Option VALUE="az"
Option VALUE="eu"
Option VALUE="be"
Option VALUE="bn"
Option VALUE="bg"
Option VALUE="ca"
Option VALUE="zh-CN"
Option VALUE="zh-TW"
Option VALUE="hr"
Option VALUE="cs"
Option VALUE="da"
Option VALUE="nl"
Option VALUE="en" (SELECTED)
Option VALUE="et"
Option VALUE="tl"
Option VALUE="fi"
Option VALUE="fr"
Option VALUE="gl"
Option VALUE="ka"
Option VALUE="de"
Option VALUE="el"
Option VALUE="gu"
Option VALUE="ht"
Option VALUE="iw"
Option VALUE="hi"
Option VALUE="hu"
Option VALUE="is"
Option VALUE="id"
Option VALUE="ga"
Option VALUE="it"
Option VALUE="ja"
Option VALUE="kn"
Option VALUE="ko"
Option VALUE="la"
Option VALUE="lv"
Option VALUE="lt"
Option VALUE="mk"
Option VALUE="ms"
Option VALUE="mt"
Option VALUE="no"
Option VALUE="fa"
Option VALUE="pl"
Option VALUE="pt"
Option VALUE="ro"
Option VALUE="ru"
Option VALUE="sr"
Option VALUE="sk"
Option VALUE="sl"
Option VALUE="es"
Option VALUE="sw"
Option VALUE="sv"
Option VALUE="ta"
Option VALUE="te"
Option VALUE="th"
Option VALUE="tr"
Option VALUE="uk"
Option VALUE="ur"
Option VALUE="vi"
Option VALUE="cy"
Option VALUE="yi"
[end of select]
Button: "Translate" (SUBMIT)
Input: NAME="js" VALUE="n" (HIDDEN)
Input: NAME="prev" VALUE="_t" (HIDDEN)
Input: NAME="hl" VALUE="en" (HIDDEN)
Input: NAME="ie" VALUE="ISO-8859-1" (HIDDEN)
Input: NAME="layout" VALUE="2" (HIDDEN)
Input: NAME="eotf" VALUE="1" (HIDDEN)
Textarea: NAME="text"
Input: NAME="file" (FILE)
--- end of FORM
So it looks as if "sl" is "source language", "tl" is "target language" and "text" might be our input. There are also some mysterious hidden values but I haven't found leaving them out seems to do any harm. If anyone knows what they're for, please share the info! Now we can send a request with curl something like:
curl --user-agent "" -d "sl=$source" -d "tl=$target" --data-urlencode "text=$1" http://translate.google.com
The text has to be sent with the --data-urlencode option because it might have spaces etc, or use multi-byte characters like Japanese. If you have problems with curl you can check what it's actually sending to the server by running netcat in a separate terminal
then substitute 'http://localhost:3333' for the google url in your curl command.
4) Analyse what comes back. This is where those regular expressions come in, but I'll have to leave that a couple of days because it's time to crash and I'll be gone tomorrow.
John
------------------------
( a boring
Japan blog , and idle
twitterings )
“Good morning sir, which way up would you like your reality today?” "As it comes, Jeeves, as it comes..."