locked
MS Translator API Error - not working for Serbian/Croatian RRS feed

  • Question

  • Hi guys,

    I have a question regarding MS Translator API. I  followed "Walkthrough: Microsoft Translator in a C# Console Application" tutorial so I could use MS translate API from my app. When I try translating from "English" to "French" or some other language, everything works perfectly fine. But when translating from/to Serbian/Croatian, I get following error message: "Parameter: From has an invalid pattern of characters".

    Since I am using automatic language detection, I didn't hard code any of the language acronyms:

    string input = "Petar voli da ide u skolu"; // serbian
    var sourceLanguage = Translator.DetectSourceLanguage(tc, input); // gets Croatian

    var targetLanguage = PickRandomLanguage(tc); // select random language by using

    // Handle the error condition
    if (sourceLanguage != null)
    {
     var translationResult = Translator.TranslateString(tc, input, sourceLanguage, targetLanguage); // exception "Parameter: From has an invalid pattern of characters".
     if (translationResult != null)
     {

     }
    }

    Is there a problem with the API, or Serbian/Croatian are not supported?

    • Edited by dovlab Tuesday, June 9, 2015 11:01 AM
    Tuesday, June 9, 2015 10:47 AM

All replies

  • Hi,

    Serbian/Croatian are supported.

    There are two Serbian languages, Serbian (Cyrillic) and Serbian (Latin) check if the right one is selected.

    Regards,
    Azam Khan

    Tuesday, June 9, 2015 12:51 PM
  • Hi Azam,

    I tried using both (Cyrillic and Latin), as well as Bosnian and Croatian (all similar if not the same), and result is the same, it keeps returning: "Parameter: From has an invalid pattern of characters" or "Parameter: To has an invalid pattern of characters"...

    Tuesday, June 9, 2015 1:03 PM