mzubairsaleem / gtranslate-api-php

Automatically exported from code.google.com/p/gtranslate-api-php
GNU General Public License v3.0
0 stars 0 forks source link

cURL POST does not resolve Google char limit problem #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Try to translate any string longer than about 1,500 characters.

What is the expected output? What do you see instead?

Would like a translated string, but Google baulks because it won't do it.

What version of the product are you using? On what operating system?

Any.

Please provide any additional information below.

We have worked around this in this Drupal module, by breaking the string to 
be translated in to pieces and translating each chunk in turn. It would 
make more sense of the GTranslate PHP wrapper managed this instead of our 
module though. It would be a nice feature. Code is GPL v2, so feel free to 
use if you can: http://drupal.org/project/i18n_auto_draft

Original issue reported on code.google.com by greg.har...@gmail.com on 14 Jan 2010 at 10:45

GoogleCodeExporter commented 8 years ago
Am experiencing this issue as well.

Original comment by Hudson.A...@gmail.com on 3 Feb 2010 at 1:42

GoogleCodeExporter commented 8 years ago
I guess this is just a documentation fix required, as release notes imply 
longer 
strings are possible when in fact they are not because of API restrictions in 
place.

Original comment by greg.har...@gmail.com on 3 Feb 2010 at 3:12

GoogleCodeExporter commented 8 years ago
Google terms and conditions points out 5000 characters as limitation.

http://code.google.com/apis/ajaxlanguage/terms.html

Original comment by josedasilva on 23 Jul 2010 at 6:25

GoogleCodeExporter commented 8 years ago
This is an Api limitation, no much to do on this!

Original comment by josedasilva on 26 Nov 2010 at 4:19

GoogleCodeExporter commented 8 years ago
I wouldn't say that. You *could* incorporate a version of the code linked to in 
the opening comment (which has now moved here: 
http://drupal.org/project/i18n_auto) if you wanted to.

In other words, if you want to provide a comprehensive API that doesn't care so 
much about string length, you can work around the API limitations of Google by 
splitting the string and sending each segment for translation. As I said at the 
start, I currently do this in a Drupal module, but it would be nice if the 
gtranslate API did it for me. =)

But otherwise, no, there is nothing to do.

Other people looking into a solution for longer strings are welcome to look at 
the Drupal 6 version of this project:
http://drupal.org/project/i18n_auto

It is open source, you are free to borrow the code I wrote to achieve this.

Original comment by greg.har...@gmail.com on 26 Nov 2010 at 5:49

GoogleCodeExporter commented 8 years ago
I respect that there is a Google character limit of 5000.  But the API seems to 
fail after about 1500.

Original comment by stevenmc...@gmail.com on 12 May 2011 at 8:36