Skip to content

Translator exception #42

@ReverendThing

Description

@ReverendThing

If I use the example code given in the readme then I get an error that the language code "en" is deprecated and to use "en-GB" instead, however, if I try and change to this then my program hangs indefinitely.

Steps to reproduce the behavior:

  1. Use the following as a translation function:
       static public async Task<TextResult> TranslateText(string originalText)
        {
            return await translator.TranslateTextAsync(originalText, LanguageCode.Norwegian, LanguageCode.English);
        }
  1. Call the translation function as follows:
    TextResult t= TranslateText(speech.OriginalText).Result;

  2. Receive error "One or more errors occurred. (targetLanguageCode="en" is deprecated, please use "en-GB" or "en-US" instead)"

I have tried changing my translation function as follows:
return await translator.TranslateTextAsync(originalText, LanguageCode.Norwegian, "en-GB");
And this causes the program to hang indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions