ITranslatorService.TranslateWithResponseAsync Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
TranslateWithResponseAsync(IEnumerable<String>, IEnumerable<String>) |
Translates a list of sentences into the specified languages. |
TranslateWithResponseAsync(String, IEnumerable<String>) |
Translates a text string into the specified languages. |
TranslateWithResponseAsync(String, String) |
Translates a text string into the specified language. |
TranslateWithResponseAsync(IEnumerable<String>, String, IEnumerable<String>) |
Translates a list of sentences into the specified languages. |
TranslateWithResponseAsync(IEnumerable<String>, String, String) |
Translates a list of sentences into the specified language. |
TranslateWithResponseAsync(String, String, IEnumerable<String>) |
Translates a text into the specified languages. |
TranslateWithResponseAsync(String, String, String) |
Translates a text string into the specified languages. |
Translates a list of sentences into the specified languages.
public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>> TranslateWithResponseAsync (System.Collections.Generic.IEnumerable<string> input, System.Collections.Generic.IEnumerable<string> to = default);
abstract member TranslateWithResponseAsync : seq<string> * seq<string> -> System.Threading.Tasks.Task<seq<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>>
Public Function TranslateWithResponseAsync (input As IEnumerable(Of String), Optional to As IEnumerable(Of String) = Nothing) As Task(Of IEnumerable(Of TranslationResponse))
Parameters
- input
- IEnumerable<String>
A string array containing the sentences to translate.
- to
- IEnumerable<String>
A string array representing the language codes 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 TranslationResponse array with one result for each language code in the to
array. Each object contains translated text and information.
Exceptions
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |
Translates a text string into the specified languages.
public System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse> TranslateWithResponseAsync (string input, System.Collections.Generic.IEnumerable<string> to);
abstract member TranslateWithResponseAsync : string * seq<string> -> System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>
Public Function TranslateWithResponseAsync (input As String, to As IEnumerable(Of String)) As Task(Of TranslationResponse)
Parameters
- input
- String
A string representing the text to translate.
- to
- IEnumerable<String>
A string array representing the language codes 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 TranslationResponse object containing translated text and information.
Exceptions
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |
Translates a text string into the specified language.
public System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse> TranslateWithResponseAsync (string input, string to = default);
abstract member TranslateWithResponseAsync : string * string -> System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>
Public Function TranslateWithResponseAsync (input As String, Optional to As String = Nothing) As Task(Of TranslationResponse)
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 TranslationResponse object containing translated text and information.
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |
Translates a list of sentences into the specified languages.
public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>> TranslateWithResponseAsync (System.Collections.Generic.IEnumerable<string> input, string from, System.Collections.Generic.IEnumerable<string> to);
abstract member TranslateWithResponseAsync : seq<string> * string * seq<string> -> System.Threading.Tasks.Task<seq<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>>
Public Function TranslateWithResponseAsync (input As IEnumerable(Of String), from As String, to As IEnumerable(Of String)) As Task(Of IEnumerable(Of TranslationResponse))
Parameters
- input
- IEnumerable<String>
A string array containing the sentences 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
- IEnumerable<String>
A string array representing the language codes 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 TranslationResponse array with one result for each language code in the to
array. Each object contains translated text and information.
Exceptions
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |
Translates a list of sentences into the specified language.
public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>> TranslateWithResponseAsync (System.Collections.Generic.IEnumerable<string> input, string from, string to);
abstract member TranslateWithResponseAsync : seq<string> * string * string -> System.Threading.Tasks.Task<seq<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>>
Public Function TranslateWithResponseAsync (input As IEnumerable(Of String), from As String, to As String) As Task(Of IEnumerable(Of TranslationResponse))
Parameters
- input
- IEnumerable<String>
A string array containing the sentences 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 TranslationResponse array with one result for each language code in the to
array. Each object contains translated text and information.
Exceptions
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |
Translates a text into the specified languages.
public System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse> TranslateWithResponseAsync (string input, string from, System.Collections.Generic.IEnumerable<string> to);
abstract member TranslateWithResponseAsync : string * string * seq<string> -> System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>
Public Function TranslateWithResponseAsync (input As String, from As String, to As IEnumerable(Of String)) As Task(Of TranslationResponse)
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
- IEnumerable<String>
A string array representing the language codes 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 TranslationResponse object containing translated text and information.
Exceptions
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |
Translates a text string into the specified languages.
public System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse> TranslateWithResponseAsync (string input, string from, string to);
abstract member TranslateWithResponseAsync : string * string * string -> System.Threading.Tasks.Task<Microsoft.Toolkit.Services.MicrosoftTranslator.TranslationResponse>
Public Function TranslateWithResponseAsync (input As String, from As String, to As String) As Task(Of TranslationResponse)
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 TranslationResponse object containing translated text and information.
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
Windows Community Toolkit 6.1.1
Producto | Versiones |
---|---|
Windows Community Toolkit | 6.1.1 |