Let’s take a look at the approaches you can take to maintain the original structure of your rich text elements in the translated texts.
Rich text elements might contain images, linked items, components, and formatted text. You need to convert the rich text elements into a format that preserves the information about the position of linked items or images used in the rich text.Also, make sure to transform the translation unit into a format supported by your TMS, for example, JSON or XLIFF.
A. Insert placeholders in the rich text content
Insert placeholders that are not supposed to be translated into the text and then use the placeholders to insert the references back into the translated text.
➕ Advantages
➖ Disadvantages
Easy to implement.
Content from the rich text element remains as one piece of text in the TMS.
Some translation management systems might not support placeholders in the text sent for translation.
B. Split the rich text using references
Split the rich text using references into text chunks and encode the references that should be between them as translation keys or metadata of those chunks.
For example, you can use a slight modification of XPath to encode a place of each text chunk in a JSON and use an empty string as a value for keys pointing to a reference.
➕ Advantages
➖ Disadvantages
Doesn’t require special placeholders in the text.
More challenging to implement than placeholders.
The rich text element is split into multiple chunks, which might be more difficult to translate for the TMS, especially for human translators.