xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-aireportingconfigurationbuilder.md
Activates AI-powered report localization functionality in the Web Report Designer.
Namespace : DevExpress.AspNetCore.Reporting
Assembly : DevExpress.AIIntegration.AspNetCore.Reporting.v25.2.dll
NuGet Package : DevExpress.AIIntegration.AspNetCore.Reporting
public AIReportingConfigurationBuilder AddLocalization()
Public Function AddLocalization As AIReportingConfigurationBuilder
| Type | Description |
|---|---|
| AIReportingConfigurationBuilder |
An AIReportingConfigurationBuilder object that can be used to further configure AI-powered functionality in Web Report Designer and Web Document Viewer.
|
Call the AddLocalization() method to activate the AI-powered Localization functionality in the Web Report Designer:
using Azure.AI.OpenAI;
using Microsoft.Extensions.AI;
using System;
// ...
string azureOpenAIEndpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
string azureOpenAIKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY");
string deploymentName = "MODEL_NAME"
IChatClient chatClient = new AzureOpenAIClient(new Uri(azureOpenAIEndpoint),
new System.ClientModel.ApiKeyCredential(azureOpenAIKey))
.GetChatClient(deploymentName).AsIChatClient();
builder.Services.AddSingleton(chatClient);
builder.Services.AddDevExpressAI((config) => {
config.AddWebReportingAIIntegration(options =>
options.AddLocalization());
});
The Localize with AI button appears. Select a language from the Language drop-down and click the button to translate all localizable property values to the selected language:
You can adjust AI-translated strings in the Localization Editor.
See Also
Localize Reports in the Web Report Designer
AIReportingConfigurationBuilder Class