Class AzureTranslatorBroker
- Assembly
- arolariu.Backend.Domain.Invoices.dll
This class represents the Azure translator broker.
public class AzureTranslatorBroker : ITranslatorBroker
- Inheritance
-
AzureTranslatorBroker
- Implements
- Inherited Members
Constructors
AzureTranslatorBroker(IOptionsMonitor<AzureOptions>)
Constructor.
public AzureTranslatorBroker(IOptionsMonitor<AzureOptions> options)
Parameters
options
IOptionsMonitor<AzureOptions>
AzureTranslatorBroker(IOptionsMonitor<AzureOptions>, HttpClient)
Another constructor that allows passing a custom HttpClient. This is useful for testing purposes.
public AzureTranslatorBroker(IOptionsMonitor<AzureOptions> options, HttpClient httpClient)
Parameters
options
IOptionsMonitor<AzureOptions>httpClient
HttpClient
Fields
textTranslationClient
private readonly TextTranslationClient textTranslationClient
Field Value
- TextTranslationClient
Methods
DetectLanguage(string)
Detects the language of the given text.
public Task<string> DetectLanguage(string text)
Parameters
text
string
Returns
Translate(string, string)
Translates the given text to the given language.
public Task<string> Translate(string text, string language = "en")