Translate button unable to translate one post, popup error - The field Text must be a string or array type with a maximum length of '5000'

Folks are reporting issues with translating one particular post from spanish into english - when they select the translate button, an error pops up. On latest. Also in safe mode with theme and unofficial plugins disabled. The post only has about 3000 characters so under the limit. Works fine with other posts.

37%20AM

The javascript console also shows an error.

Any thoughts on what’s going on here?

3 Likes

Try removing letters until it works on a demo post? What is the threshold?

1 Like

Huh. I was able to find the source of the problem but I do not understand it. :slight_smile:

I created a demo post with the same exact text, and was able to replicate the error in the demo post. Then I removed this image from the first line:

![unnamed|690x345,100%](upload://s5tXufHbUuH390gDYIkgW9bna3I.png)

And it successfully translated with no error.

It seems Microsoft is unhappy with something in that string of markdown.

3 Likes

@kris.kotlarek can you investigate this issue?

5 Likes

Is that post publicly available? Could you send me a link?

I generated myself random Spanish text with 4000 characters, added image and it was translated correctly, so there must be something specific in your case.

I would like to copy the content to reproduce it on my machine

2 Likes

This is the topic. Still exhibiting same problem.

4 Likes

Perfect, thank you! I see that error on my machine.

I will check what is wrong there

5 Likes

I investigated that issue and it is a valid case.

To keep all text formatting like bold, italic, images etc. HTML code is sent to translation service. In your case it is 5365 characters.

As an alternative, you may want to check Google, because they got higher limits Quotas & Limits  |  Cloud Translation  |  Google Cloud

Before making decision please estimate your usage because google may be more expensive.

I checked it on your example post and it was translated without an error

5 Likes

Hi Kris! Thanks for looking into this issue. I see. I had thought it was a bug because the markdown is about 3000 characters, well below the limit. But the plugin sends the baked html which ends up being larger than the limit. Makes sense.

It would be nice if the error were a bit more human friendly, but this situation is rare. Thanks for helping resolve it.

6 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.