TranslatorService Class
Definition
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.
The TranslatorService class provides methods to translate text in various supported languages.
public class TranslatorService : Microsoft.Toolkit.Services.MicrosoftTranslator.ITranslatorService
type TranslatorService = class
interface ITranslatorService
Public Class TranslatorService
Implements ITranslatorService
- Inheritance
-
TranslatorService
- Implements
Remarks
To use this library, you must register Microsoft Translator on https://portal.azure.com/#create/Microsoft.CognitiveServices/apitype/TextTranslation to obtain the Subscription key.
Properties
Instance |
Gets public singleton property. |
Language |
Gets or sets the string representing the supported language code to translate the text in. |
Provider |
Gets a reference to an instance of the underlying data provider. |
SubscriptionKey |
Gets or sets the Subscription key that is necessary to use Microsoft Translator Service. |
Methods
DetectLanguageAsync(String) |
Detects the language of a text. |
DetectLanguagesWithResponseAsync(IEnumerable<String>) |
Detects the language of a text. |
DetectLanguageWithResponseAsync(String) |
Detects the language of a text. |
GetLanguageNamesAsync(String) |
Retrieves friendly names for the languages available for text translation. |
GetLanguagesAsync() |
Retrieves the languages available for translation. |
InitializeAsync() |
Initializes the TranslatorService class by getting an access token for the service. |
InitializeAsync(String, String) |
Initializes the TranslatorService class by getting an access token for the service. |
TranslateAsync(String, String) |
Translates a text string into the specified language. |
TranslateAsync(String, String, String) |
Translates a text string into the specified language. |
TranslateWithResponseAsync(IEnumerable<String>, IEnumerable<String>) |
Translates a list of sentences into the specified languages. |
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, IEnumerable<String>) |
Translates a text string into the specified languages. |
TranslateWithResponseAsync(String, String) |
Translates a text string 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. |