Skip to main content
All docs
V24.2

DxBlazorViewerLocalizerLocalizationService Class

Allows you to change localizable text at runtime.

Namespace: DevExpress.Blazor.Localization

Assembly: DevExpress.Blazor.v24.2.Viewer.dll

NuGet Package: DevExpress.Blazor.Viewer

Declaration

public class DxBlazorViewerLocalizerLocalizationService :
    IDxViewerLocalizationService,
    IDxLocalizationService

Remarks

The DxBlazorViewerStringId enumeration lists the Viewer’s localizable strings. You can implement and register a custom service to replace a specific localizable string with custom text at runtime.

Create a custom class CustomLocalizationService that inherits from the IDxViewerLocalizationService class and override the GetString method:

using DevExpress.Blazor.Localization;
// ...
    public class CustomLocalizationService: IDxViewerLocalizationService
    {
        protected override string GetString(string key)
        {
            switch (key)
            {
                case "DxBlazorViewerStringId.TabPanel_Parameters_Title":
                    return "Please specify your report parameters";
                    break;
                default:
                    return base.GetString(key);
                    break;
            }
        }            
    }

Register the CustomLocalizationService at application startup:

using Microsoft.AspNetCore.Hosting;
using DevExpress.Blazor.Localization;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddScoped<IDxReportingLocalizationService, CustomLocalizationService>();

var app = builder.Build();

Inheritance

Object
DxBlazorViewerLocalizerLocalizationService
See Also