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.
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.
Thanks @alanbchristie, this will be fixed once this gets merged
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.