Well, here's the deal. The Translation API as deployed by Google
utilizes a technique called JSONP to send your original string to
Google and receive a translated string in response. The only way that
works, though, is by appending a remote script element to the document
head and sending parameters via its url (i.e., the get method). The
problem here is that MSIE has a url length limit, and Google has
implemented one of its own for security reasons. So the only way to
utilize the full 5,000 urlencoded string length limit is to submit the
information via the POST method as a header instead of on the url.
Unfortunately, JSONP doesn't support this. So you have to resort to
building your own server-side proxy. This proxy will be a very simple
application which will simply send the data on to Google using the
POST method, receive the response from Google, and then push it back
to the client. So the whole process ends up looking like this:
In the client, you initialize an XMLHttpRequest object and send your
source string via POST to your own server-side proxy. Your server-side
proxy gathers the information, sends it on to Google, receives a
response, and returns that response to the client. Your client-side
script receives and parses the response, and then finishes the
translation process.
Jeremy R. Geerdes
Effective website design & development
Des Moines, IA
For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
jgee...@mchsi.com
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.
If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!
And check out my blog, Adventures in Web Development, at
http://jgeerdes.blogspot.com
!