locked
Getting exception while translating data using Microsoft Translator RRS feed

  • General discussion

  • Hi,

    I'm using Microsoft Translator API in my Java application that sends translation request and returns translated text as response.

    "From Language" is set to "Auto Detect" and "To Language" is set to "English"

    Sometimes, it fails to translate the text and gives following error:

    ArgumentOutOfRangeException: 'from' must be a valid language Parameter name: from : ID=5641.V2_Json.Translate.2484E3EC

    Is there a way to fix this issue ?

    Thanks,

    Bhagyesh Jain

    Thursday, February 19, 2015 1:40 PM

All replies

  • Hi Bhagyesh,

    this error happens when using auto-detect for the "from" language, and detection determines a language that is not supported in translation. Microsoft Translator detects languages it cannot translate. Note that language detection is not fail safe, and does make mistakes, especially for short strings and closely related languages.

    Two ways to work around:

    - Simply ignore the error and manually copy source to target string. This implies that this string really was not translatable.

    - If you process a sequence of requests, on encountering this error re-translate with the  language of the previous request as the "from" parameter.

    When using TranslateArray you get the detected language in the response.

    Let us know if this helps,
    Chris Wendt
    Microsoft Translator

    Thursday, February 19, 2015 5:15 PM
  • Oi,

    Estou usando Tradutor API Microsoft na Minha Aplicação Java Que Envia PEDIDO de Tradução e Retorna texto Traduzido Como Votação.

    "A Partir de Língua" E Definido Como "Auto Detect" e "Para Idioma" Está Definido Pará "Inglês"

    Às vezes, ELE NÃO consegue Traduzir o texto e Dá SEGUINTE Erro:

    ArgumentOutOfRangeException: 'de' DEVE Ser hum Nome de parametro idioma válido: A Partir de: ID = 5641.V2_Json.Translate.2484E3EC

    EXISTE Uma Maneira de Corrigir este Problema?

    Obrigado,

    Bhagyesh Jain



    AmigosdaProntotel1652

    Wednesday, April 15, 2015 11:26 PM
  • Wednesday, April 15, 2015 11:35 PM