Quantcast
Channel: Microsoft Translator User Forum (Including Bing Translator) forum
Viewing all articles
Browse latest Browse all 529

Using translateArray with language auto-detect

$
0
0

Hi:

I am trying to use the translateArray HTTP API without specifying the From language parameter.  Is it possible to specify texts with different source languages?  It seems the texts are translated correctly to the target language, but the detected source languages returned is always from the first input text, see example below.

Request:

<?xml version="1.0" encoding="utf-8"?><TranslateArrayRequest><AppId/><From/><Texts><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">這是一句中文例句。
  </string><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
   This is an English string.</string></Texts><To>
  ja</To></TranslateArrayRequest>

Here's the response I got.  Somehow the "From" is "zh-CHT" for both strings. 

<?xml version="1.0" encoding="utf-8"?><ArrayOfTranslateArrayResponse xmlns="http://schemas.datacontract.org/2004/07/Microsoft.MT.Web.Service.V2" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TranslateArrayResponse><From>
   zh-CHT</From><OriginalTextSentenceLengths><int>
    9</int></OriginalTextSentenceLengths><TranslatedText>これは、中国語の例文です。
  </TranslatedText><TranslatedTextSentenceLengths><int>
    13</int></TranslatedTextSentenceLengths></TranslateArrayResponse><TranslateArrayResponse><From>
   zh-CHT</From><OriginalTextSentenceLengths><int>
    26</int></OriginalTextSentenceLengths><TranslatedText>これは、英語の文字列です。
  </TranslatedText><TranslatedTextSentenceLengths><int>
    13</int></TranslatedTextSentenceLengths></TranslateArrayResponse></ArrayOfTranslateArrayResponse>


Viewing all articles
Browse latest Browse all 529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>