AcclaroInc / craft-translations

Easily manage your Craft CMS website translations and drive global growth with simplified translation workflows.
https://plugins.craftcms.com/translations
Other
9 stars 11 forks source link

Google translation - 411 Length Required error #466

Closed RubenColpaert closed 9 months ago

RubenColpaert commented 9 months ago

When using the google translator for large entities with a lot of data to translate we receive an error. In the logs we can find that the google API returns a "411 Length Required" error. This can be solved by sending the data as a JSON body, as the official Google documentation states, rather than adding it as query parameters.

From code I can see that the variables are given as query paramaters.

I was also wondering why the official php client is not used to accomplish this.

shnsumit commented 9 months ago

@RubenColpaert

Thank you for bringing up the issue, we greatly appreciate your feedback, and I wanted to provide you with an update on how we plan to address this concern.

In our next hotfix release, which we are planning for early next week, we will be implementing the official PHP client provided by Google for the Translator API. This client will ensure that data is transmitted in the appropriate format, effectively resolving the error and improving the overall reliability of our translation service.

If you have any further questions or concerns, please don't hesitate to reach out.

Thank you for your understanding and collaboration.

sidedwards commented 9 months ago

@RubenColpaert, this issue should now be resolved as of https://github.com/AcclaroInc/craft-translations/releases/tag/v3.3.1

Please let us know if you experience further issues.