tag_handling parameter to html. The API extracts the text from the HTML structure, translates it, and places the translation back into the structure. Without tag_handling, tags are treated as regular text.
Set tag_handling_version to v2 to use the improved tag handling algorithm. HTML input is never strictly parsed, so invalid HTML doesn’t cause errors in either version. For version details and defaults, see the tag_handling_version parameter.
Example request
Example response
split_sentences for HTML: with tag_handling=html it defaults to nonewlines, which splits sentences on punctuation only and gives the best translation quality for HTML. To also split sentences on newlines, set split_sentences=1.
To translate non-HTML XML content, see Translating XML.
Exclude elements from translation
To exclude an element from translation, add thetranslate="no" or class="notranslate" attribute to it. In the following example, translate="no" prevents translation of the paragraph:
Disable translation of elements example
Example request
Example response