google-translate-api icon indicating copy to clipboard operation
google-translate-api copied to clipboard

Text Limit with English characters

Open mklam2 opened this issue 8 years ago • 1 comments

I found that using this package, the text limit is around 1500 characters. is it because it is using GET request instead of POST ? As i am expecting a 5000 characters limit.

Thanks

mklam2 avatar Feb 02 '17 05:02 mklam2

I also think it is using GET request instead of POST。 In my case, I found the author use 'got' module. So I change the index.js file to convert GET => POST. Here is my change: `
... var data = { client: 't', sl: opts.from, tl: opts.to, hl: opts.to, dt: ['at', 'bd', 'ex', 'ld', 'md', 'qca', 'rw', 'rm', 'ss', 't'], ie: 'UTF-8', oe: 'UTF-8', otf: 1, ssel: 0, tsel: 0, kc: 7, // q: text }; data[token.name] = token.value; //return url + '?' + querystring.stringify(data); //}).then(function (url) { return got(url+'?'+querystring.stringify(data), {method:'POST', query:querystring.stringify(text)} ).then(function (res) {

... ` Hope it will work fine with you.

yangperasd avatar Mar 25 '17 11:03 yangperasd