AWS translate removes href from HTML content it is translating

0

We are using AWS Translate API to translate HTML text. An example of the English string is:

<p>For more details, please refer to our <a href="https://example.com">link 1</a> policy, <a href="https://example.com">Sexual Harassment</a> policy, <a href="https://example.com">link 2</a> policy, and <a href="https://example.com">link 3 </a>through the links provided. </p>

When the translation is run, the links have had their href tag removed and in some instances the copy has been shifted around.

This seems to be a bug as we've performed translations previously with HTML links within sentences.

Does anyone have advice around translating HTML with links within it, or has experienced this problem before?

bcn
asked 6 months ago275 views
1 Answer
0

Hi,

Let's suppose that you use the Translate API in Java.

Then, follow this documentation to see how to properly translate an HTML page when you read it: https://docs.aws.amazon.com/translate/latest/dg/examples-web.html

It relies on parsing the page tree-like DOM structure to obtain text elements and translate them on the fly.

Best,

Didier

profile pictureAWS
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions