![]() |
VOOZH | about |
dotnet add package Encamina.Enmarcha.AI.LanguagesDetection.Azure --version 10.0.5
NuGet\Install-Package Encamina.Enmarcha.AI.LanguagesDetection.Azure -Version 10.0.5
<PackageReference Include="Encamina.Enmarcha.AI.LanguagesDetection.Azure" Version="10.0.5" />
<PackageVersion Include="Encamina.Enmarcha.AI.LanguagesDetection.Azure" Version="10.0.5" />Directory.Packages.props
<PackageReference Include="Encamina.Enmarcha.AI.LanguagesDetection.Azure" />Project file
paket add Encamina.Enmarcha.AI.LanguagesDetection.Azure --version 10.0.5
#r "nuget: Encamina.Enmarcha.AI.LanguagesDetection.Azure, 10.0.5"
#:package Encamina.Enmarcha.AI.LanguagesDetection.Azure@10.0.5
#addin nuget:?package=Encamina.Enmarcha.AI.LanguagesDetection.Azure&version=10.0.5Install as a Cake Addin
#tool nuget:?package=Encamina.Enmarcha.AI.LanguagesDetection.Azure&version=10.0.5Install as a Cake Tool
Azure Languages Detection is a wrapper project for Azure Cognitive Services Text Analytic client library and Azure AI Translator API REST. Its main functionality is to simplify and abstract the usage of the library, primarily focused on detect language.
First, install NuGet. Then, install Encamina.Enmarcha.AI.LanguagesDetection.Azure from the package manager console:
PM> Install-Package Encamina.Enmarcha.AI.LanguagesDetection.Azure
First, install .NET CLI. Then, install Encamina.Enmarcha.AI.LanguagesDetection.Azure from the .NET CLI:
dotnet add package Encamina.Enmarcha.AI.LanguagesDetection.Azure
There are two implementations for , one utilizing the Azure Cognitive Services Text Analytic client library, and the other using the Azure AI Translator API REST.
First, you need to add the data to your project configuration. You can achieve this by using any configuration provider. The followng code is an example of how the settings would appear using the appsettings.json file:
{
// ...
"TextAnalyticsLanguageDetectionConfigurations": {
"TextAnalyticsLanguageDetectionServiceOptions": [
{
"Name": "DefaultAnalyticsLanguageDetection", // Name of this configuration
"EndpointUrl": "https://example.cognitiveservices.azure.com/", // Text Analytic endpoint's url
"KeyCredential": "<API-KEY>", // Text Analytic (security) key
"ConfidenceThreshold": 0.65, // Minimum threshold score for text analytic, value ranges from 0 to 1
"IncludeStatistics": true // A flag to indicate whether if the service should return statistics with the results of the operation
/// results of the operation
}
]
},
// ...
}
Next, in Program.cs or a similar entry point file in your project, add the following code.
// Entry point
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
// ...
});
// ...
// Or others configuration providers...
builder.Configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
builder.Services.AddDefaultCognitiveServiceProvider()
.AddAzureTextAnalyticsLanguageDetectionServices(builder.Configuration);
The extension methods AddDefaultCognitiveServiceProvider and AddAzureTextAnalyticsLanguageDetectionServices manage the configuration to create instances of ICognitiveServiceProvider. With this, you can retrieve instances of ILanguageDetectionService (whose implementation is ). As seen in the configuration JSON, TextAnalyticsLanguageDetectionConfigurations is an array, allowing you to generate different Text Analytics Language Detection configurations and retrieve information based on the Name value. Now, you can inject ICognitiveServiceProvider through the constructor for use.
public class MyClass
{
private readonly ILanguageDetectionService languageDetectionService;
public MyClass(ICognitiveServiceProvider cognitiveServiceProvider)
{
// The value "DefaultAnalyticsLanguageDetection" is the name specified in the JSON from the previous code.
// This is just an example code; avoid hardcoding strings :)
languageDetectionService = cognitiveServiceProvider.GetLanguageDetectionService("DefaultAnalyticsLanguageDetection");
}
public async Task<CultureInfo> GetLanguageAsync(string userInput, CancellationToken cancellationToken)
{
var languageDetectionRequest = new LanguageDetectionRequest() { Text = new[] { new Text(value: userInput) } };
var languageDetectionResult = await languageDetectionService.DetectLanguageAsync(languageDetectionRequest, CancellationToken.None);
return languageDetectionResult.DetectedLanguages.MaxBy(d => d.ConfidenceScore).Language;
}
}
First, you need to add the to your project configuration. You can achieve this by using any configuration provider. The followng code is an example of how the settings would appear using the appsettings.json file:
{
// ...
"TranslatorLanguageDetectionConfigurations": {
"TranslatorLanguageDetectionService": [
{
"Name": "DefaultAnalyticsLanguageDetection", // Name of this configuration
"EndpointUrl": "https://example.cognitiveservices.azure.com/", // Translator endpoint's url
"KeyCredential": "<API-KEY>", // Translator Analytic (security) key
"ConfidenceThreshold": 0.65, // Minimum threshold score for language detection, value ranges from 0 to 1
"DetectOnlyTranslatableLanguages": true, // A flag to indicate whether any language detection result should only include languages that can be translated
"RegionName": "westus" // Azure region name of the translator resource.
}
]
},
// ...
}
Next, in Program.cs or a similar entry point file in your project, add the following code.
// Entry point
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
// ...
});
// ...
// Or others configuration providers...
builder.Configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
builder.Services.AddDefaultCognitiveServiceProvider()
.AddAzureTranslatorLanguageDetectionServices(builder.Configuration);
The extension methods AddDefaultCognitiveServiceProvider and AddAzureTranslatorLanguageDetectionServices manage the configuration to create instances of ICognitiveServiceProvider. With this, you can retrieve instances of ILanguageDetectionService (whose implementation is ). As seen in the configuration JSON, TranslatorLanguageDetectionConfigurations is an array, allowing you to generate different Translator Language Detection configurations and retrieve the appropriate one based on the Name. Now, you can inject ICognitiveServiceProvider through the constructor for use.
public class MyClass
{
private readonly ILanguageDetectionService languageDetectionService;
public MyClass(ILanguageDetectionService languageDetectionService)
{
// The value "DefaultAnalyticsLanguageDetection" is the name specified in the JSON from the previous code.
// This is just an example code; avoid hardcoding strings :)
languageDetectionService = cognitiveServiceProvider.GetLanguageDetectionService("DefaultAnalyticsLanguageDetection");
}
public async Task<CultureInfo> GetLanguageAsync(string userInput, CancellationToken cancellationToken)
{
var languageDetectionRequest = new LanguageDetectionRequest() { Text = new[] { new Text(value: userInput) } };
var languageDetectionResult = await languageDetectionService.DetectLanguageAsync(languageDetectionRequest, CancellationToken.None);
return languageDetectionResult.DetectedLanguages.MaxBy(d => d.ConfidenceScore).Language;
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.5 | 101 | 6/1/2026 |
| 10.0.4 | 125 | 4/8/2026 |
| 10.0.3 | 111 | 4/6/2026 |
| 10.0.2 | 328 | 12/17/2025 |
| 10.0.1 | 324 | 12/17/2025 |
| 10.0.0 | 311 | 12/16/2025 |
| 10.0.0-preview-09 | 436 | 11/19/2025 |
| 10.0.0-preview-08 | 432 | 11/18/2025 |
| 10.0.0-preview-07 | 215 | 10/22/2025 |
| 10.0.0-preview-06 | 211 | 10/14/2025 |
| 10.0.0-preview-05 | 213 | 10/8/2025 |
| 10.0.0-preview-04 | 206 | 10/7/2025 |
| 10.0.0-preview-03 | 341 | 9/16/2025 |
| 10.0.0-preview-02 | 352 | 9/16/2025 |
| 8.3.0 | 253 | 9/10/2025 |
| 8.3.0-preview-02 | 213 | 9/10/2025 |
| 8.3.0-preview-01 | 213 | 9/8/2025 |
| 8.2.1-preview-08 | 213 | 8/18/2025 |
| 8.2.1-preview-07 | 211 | 8/12/2025 |