HTML translation to sr-Cyrl incorrectly handles notranslate elements

Fredrick Johan van der Merwe 0 Reputation points
2024-12-02T08:35:20.3733333+00:00

Hi,

When we try to translate the following text:
"Text is: <span class='notranslate'>Do not translate</span>"

or

"Text is: <span translate='no'>Do not translate</span>"

From en to sr-Cyrl using the https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=EN&to=SR-CYRL&textType=HTML endpoint with a JSON request body:

[
    {"Text":"Text is: <span class='notranslate'>Do not translate</span>"}
]

We receive the following response:

[
    {
        "translations": [
            {
                "text": "Текст је: @но__т_0_",
                "to": "sr-Cyrl"
            }
        ]
    }
]

This is the first language we've encountered with the issue as we've been able to translate other languages without issue. Such as sr-Latn which returns the expected result:

[
    {
        "translations": [
            {
                "text": "Tekst je: <span class='notranslate'>Do not translate</span>",
                "to": "sr-Latn"
            }
        ]
    }
]

Any assistance would be greatly appreciated.

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
429 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.