When a message is sent for translation and reaches the Unbabel pipeline, we are actually receiving the HTML content the message consists of. Some features such as no-translate rely on correct HTML structure to identify the strings of text that are selected and tell them apart from the remaining text. As such, there are some scenarios where the HTML of the message content may comprise invalid syntax for the no-translate feature.
Whenever the message contains invalid syntax, an internal note following the translation attempt will be posted reading "The message posted contains a "no-translate" syntax error. Please use the correct format, more information on "no-translate" can be found here".
Trying to submit a message with a no-translate syntax error will prevent it from reaching our pipeline, and the customer will never obtain a reply as a consequence.
Below you can find the most common scenarios where errors can appear. Please bear in mind that spotting these problems may be relatively easy, if the change in styling is very evident, or may prove more difficult, depending on how the platform's HTML handles it, and you may wish to try writing the segment from scratch.
- markers have content that is in different HTML levels and have content surrounding them
This is the case whenever opening and closing brackets are formatted differently and have content around them, or are included in different HTML elements for another reason.
ex: This <<< text is not to be translated or >>> is it?
- the HTML is resulting in non-consecutive markers
We need three consecutive brackets, with no HTML between them, in each end to be able to form a valid HTML element. If any of the sequences are interrupted by formatting, for example, that may not be guaranteed.
ex: This <<<text is not to be translated>>> or is it?
- markers are too deep in the HTML tree
The text may contain a lot of HTML elements preceding and including the no-translate markers. Try closing as many HTML elements as possible and/or isolate the no-translate segment.
How to ensure valid syntax
In order to ensure valid syntax when using the no-translate feature and send a translation request successfully, there are some best practices you can follow when writing the brackets:
- avoid formatting the brackets themselves unless the no-translate segment is contained within a portion of the message already formatted like that. You should avoid creating new HTML elements preceding or following the segment.
- be sure to select the full segment if you really need to apply formatting, or leave the brackets out of the selection
- consider clearing all styling and formatting by selecting the segment and choosing the option "Clear Formatting" in the format bar.
- have the brackets surround a block of content which you format separately
this is not
to be translated
Should you still find difficulties, reach out to us at email@example.com.