Increase Amazon translate limit to ~10,000 characters

Why have you limited the Amazon translation text size to 5,000 characters in the plug-in’s amazon.rb?

According to Amazon their API supports text that is up to 10,000 characters.

Is there any chance you can modify the MAXLENGTH in your amazon.rb to 10000 anytime soon, and modify values in any related code files? I suspect my translations are truncated unnecessarily.

2 Likes

Probably a safety thing, since that API doc also says:

Depending on your character set, this may be fewer than 10,000 characters.

2 Likes

Thanks.

Depending on your character set, this may be fewer than 10,000 characters.

If that is the reason, why are the values for LibreTranslate and Google also 5000? Their limits are 5000. So if 50% of the text capacity is stripped from Amazon why isn’t 50% (or 5,000 characters) stripped from these? (Stripping 5,000 characters off LibreTranslate makes no sense anyway - that would leave 0!).

If that is indeed the reason the logic is clearly a) not applied consistently and b) not documented.

Isn’t this more likely to be a cut-and-paste typo?

Regardless, taking 5,000 characters off the limit of one translator and not the others just doesn’t make sense. Why not permit the documented limit and handle any errors? You have to handle errors anyway.

2 Likes

Thanks @alanbchristie, this will be fixed once this gets merged :+1:

While at it I fixed the truncate method to work at the byte-level instead of the character-level since the API expect at most 10k bytes, not 10k characters.

11 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.