locked
HTML return markup RRS feed

  • Question

  • I am rookie in Translations

        I am trying to translate the simple strings for instance "Hello how are you" to french

        Translation is working. But if I consider a parameter contenType as "text/plain" and actually add the tags such as <b>Hello how are you</b> and translate it will retrun <b>french text</b>. And if I consider contentType as "text/html" I again get the same result that is <b>french text</b>.

           I would like to know what is the actual difference between "text/plain" and "text/html" when both are returning me the same result.

    My code is below

    uri As String = "http://api.microsofttranslator.com/v2/Http.svc/Translate?&text=" & System.Web.HttpUtility.UrlEncode(srcText) & "&from=" & from & "&to=" & [to] & "&contentType=" & contentType

    Thanks

    Sunday, February 12, 2012 5:21 PM

Answers

  • Hi MT_001,

    with more complex markup the difference in the modes will be visible. If your input is well-formed HTML you should use text/html in order to maintain proper placement of the tags even when the words are significantly rearranged in the translation. In text/plain the tags are treated like words, without regard to the structure of the document.

    Hope this helps,
    Chris Wendt
    Microsoft Translator

    • Marked as answer by MT_001 Monday, February 13, 2012 2:53 PM
    Monday, February 13, 2012 5:50 AM