Back to Devexpress

AIReportingConfigurationBuilder.AddLocalization() Method

xtrareports-devexpress-dot-aspnetcore-dot-reporting-dot-aireportingconfigurationbuilder.md

latest3.1 KB
Original Source

AIReportingConfigurationBuilder.AddLocalization() Method

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

Declaration

csharp
public AIReportingConfigurationBuilder AddLocalization()
vb
Public Function AddLocalization As AIReportingConfigurationBuilder

Returns

TypeDescription
AIReportingConfigurationBuilder

An AIReportingConfigurationBuilder object that can be used to further configure AI-powered functionality in Web Report Designer and Web Document Viewer.

|

Remarks

Call the AddLocalization() method to activate the AI-powered Localization functionality in the Web Report Designer:

cs
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

AIReportingConfigurationBuilder Members

DevExpress.AspNetCore.Reporting Namespace