ITranslatorService.TranslateAsync Method

Definition

Overloads

TranslateAsync(String, String)

Translates a text string into the specified language.

TranslateAsync(String, String, String)

Translates a text string into the specified language.

TranslateAsync(String, String)

Translates a text string into the specified language.

public System.Threading.Tasks.Task<string> TranslateAsync (string input, string to = default);
abstract member TranslateAsync : string * string -> System.Threading.Tasks.Task<string>
Public Function TranslateAsync (input As String, Optional to As String = Nothing) As Task(Of String)

Parameters

input
String

A string representing the text to translate.

to
String

A string representing the language code to translate the text into. The code must be present in the list of codes returned from the GetLanguagesAsync() method. If the parameter is set to null, the language specified in the property will be used.

Returns

A string representing the translated text.

Exceptions

The input parameter is longer than 1000 characters.

The provided SubscriptionKey isn't valid or has expired.

Remarks

This method perform a non-blocking request for text translation.

For more information, go to https://docs.microsoft.com/azure/cognitive-services/translator/reference/v3-0-translate.

See also

Applies to

TranslateAsync(String, String, String)

Translates a text string into the specified language.

public System.Threading.Tasks.Task<string> TranslateAsync (string input, string from, string to);
abstract member TranslateAsync : string * string * string -> System.Threading.Tasks.Task<string>
Public Function TranslateAsync (input As String, from As String, to As String) As Task(Of String)

Parameters

input
String

A string representing the text to translate.

from
String

A string representing the language code of the original text. The code must be present in the list of codes returned from the GetLanguagesAsync() method. If the parameter is set to null, the language specified in the property will be used.

to
String

A string representing the language code to translate the text into. The code must be present in the list of codes returned from the GetLanguagesAsync() method. If the parameter is set to null, the language specified in the property will be used.

Returns

A string representing the translated text.

Exceptions

The input parameter is longer than 1000 characters.

The provided SubscriptionKey isn't valid or has expired.

Remarks

This method perform a non-blocking request for text translation.

For more information, go to https://docs.microsoft.com/azure/cognitive-services/translator/reference/v3-0-translate.

See also

Applies to