balazs-endresz/jquery-translate

(414) Request-URI Too Large for content length > 2K characters

GoogleCodeExporter opened this issue · 0 comments

jquery-translate version: 1.4.7
jQuery version: 1.6.2
browser: FF 10.0.2
OS: Win7 x64

URL of the page, with non-minified JavaScript, http://jsfiddle.net/qV9zx/
can be used too: http://www.f1widget.com/

What steps will reproduce the problem?
1. Include jquery-translate js file, on a page that's larger than 2K
2. Initialize jquery-translate with a Google Translate v2 API key:   
$.translate.load("XXXXXXXXX");
3. Call Google Translate API v2: $('body').translate('en', 'fr');

What is the expected output? What do you see instead?
Should translate the page. Instead, nothing happens.

Please provide any additional information below.
When the "q" parameter sent to Google is larger than 2K characters, Google 
Translate will no longer allow "GET" requests. The solution is to use "POST" 
requests, with a crafted header line added ("X-HTTP-Method-Override: GET").

It would be very helpful if jquery-translate could provide this extension -- or 
some other workaround such as sending text in multiple chunks for translating 
large pages.

Thanks!

Original issue reported on code.google.com by freecorv...@gmail.com on 26 Feb 2012 at 6:52