Skip to content

Translate EAP Premium - BadRequestException with large text #250

@lakano

Description

@lakano

Hello !

We are in the Early Access Program for Google Translate Premium Beta, and with the last « master » branch of your PHP API, this works perfectly with short sentences ( we receive in return the « nmt » field confirmation ).

But for long text ( tested with a text of about 2500 characters ), we have an error:

[error] 1165#0: *198 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Google\Cloud\Exception\ServiceException: Client error: `GET https://translation.googleapis.com/language/translate/v2?model=nmt&format=text&q=Le%20progiciel%20de%20gestio (...)

May be it's because the text is too long for an URL request through GET method.
So I tried to change the HTTP method from GET to POST in the « translate-v2.json » definition (line 215). This still works for short sentence but not for long sentence.

Thanks in advance for your time and your help :)

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: translationIssues related to the Cloud Translation API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions