Question

We're using google translate to translate some shorter texts dynamically on our site. The current implementation looks pretty much like this example in google code playground.

Now we need to translate slightly longer texts, which are too long for GET-method. From google documentation it seems to be possible to use POST for sending the translation string.

Can anybody explain how to get it to use POST as there is no form that's submitted and the data sent to google contains only text and source/target languages?

Thanks in advance.

Was it helpful?

Solution

As it says in the documentation, it is not possible with JavaScript. But what you can do is create a webservice in between Google and you in a server side language. And then use JavaScript to run parameter to the.

alt text

(http://bildr.no/view/551563)

OTHER TIPS

To answer my own question: It seems it's impossible to get the JS translator call to use POST. The workaround would be to send(ajax) the translation-string to our server, make the server connect to Google, get the translation, send(ajax) it back to client and update it.

The other evident option is to clip to text to small enough chunks to fit GET...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top