timo.design
timo.design

Reputation: 21

Microsoft Translator API 3.0 to HTML

is it possible to use microsoft translator text api 3.0 and return html instead of json. Right now I can input html and it will be returned into the json like this:

Input:

<div>hi</div>

Output:

[ { "translations": [ { "text": " Ciao</div>", "to": "it" } ] } ]


Desired result:

Input:

<div>hi</div>

Output:

<div>Ciao</div>

Would really appreciate any help I can get on this.

Upvotes: 1

Views: 918

Answers (1)

Nicolas R
Nicolas R

Reputation: 14619

In the Translate method of Microsoft Translator API 3.0, there is the following textType parameter:

enter image description here

By default, the API method is considering your text as plain text. Add this parameter with html value and the result will not drop the <div> like in your question

Upvotes: 2

Related Questions