There are two things to consider when it comes to the translation string length limit. First, Google imposes a 2,000-character limit on URLs, effectively limiting the string you can translate with the GET method to 2,000 - the length of the url and all other parameters, etc. And second, the translation string is uri encoded before being sent off, so a bunch of characters are translated into their hex equivalents.
That said, technically, the Translation API supports strings up to 5,000 characters in length. You just have to utilize the POST method to take advantage of that larger limit. This is a simple matter from a server-side script, but when you're trying to make your page dynamic with JS, you have to get a little more creative. Specifically, you have to write your own API that will take the strings to be translated, pass them back to a proxy application on your own server via an XMLHttpRequest object, have that server-side application run the translation and return it back to your JS, and then eval the response and do with it as desired. 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 [email protected] 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 ! On Mar 2, 2009, at 9:54 AM, ani007 wrote: > > Hi, > > The google AJAX API for translation fails for more than 1400 > characters. > > The IE crashes if the input is ore than 1415 characters. Is this is > the maximum limit in characters that can be translated using this > API ? > > Thanks > Ani > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-AJAX-Search-API?hl=en -~----------~----~----~----~------~----~------~--~---
