Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
234 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi there,
I just find azure provides API "document translation" which can translate html file.
I am wondering if only the texts in html file are changed. Also, the tags or format of html file keep the same after translation completes?
Hi, yes only text is translated. Here's an example request and response:
Request:
curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=zh-Hans&textType=html" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'<div class=\"notranslate\">This will not be translated.</div><div>This will be translated.</div>'}]"
Response:
[
{
"translations":[
{"text":"<div class=\"notranslate\">This will not be translated.</div><div>这将被翻译。</div>","to":"zh-Hans"}
]
}
]
--- *Kindly Accept Answer if the information helps. Thanks.*