Add localization support to the application

Added a package reference for `Microsoft.Extensions.Localization`
to enable localization support. Registered localization services
in `Program.cs` using `builder.Services.AddLocalization()`.
Introduced the `Microsoft.Extensions.Localization` and
`EnvelopeGenerator.Application.Resources` namespaces to support
localized resources. These changes allow the application to
provide content in multiple languages or regions.
This commit is contained in:
2026-06-17 16:05:26 +02:00
parent 714cb9555f
commit d61fe79613
2 changed files with 6 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
<PackageReference Include="DevExpress.Drawing.Skia" Version="25.2.8" /> <PackageReference Include="DevExpress.Drawing.Skia" Version="25.2.8" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="8.3.1.2" /> <PackageReference Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="8.3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.28" /> <PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.28" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.11" />
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="3.119.1" /> <PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="3.119.1" />
<PackageReference Include="SkiaSharp.Views.Blazor" Version="3.119.1" /> <PackageReference Include="SkiaSharp.Views.Blazor" Version="3.119.1" />
<NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\2.0.23\*.a" /> <NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\2.0.23\*.a" />

View File

@@ -7,6 +7,8 @@ using EnvelopeGenerator.ReceiverUI.Options;
using DevExpress.XtraReports.Services; using DevExpress.XtraReports.Services;
using DevExpress.Blazor.Reporting; using DevExpress.Blazor.Reporting;
using DevExpress.XtraReports.Web.Extensions; using DevExpress.XtraReports.Web.Extensions;
using EnvelopeGenerator.Application.Resources;
using Microsoft.Extensions.Localization;
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app"); builder.RootComponents.Add<App>("#app");
@@ -25,6 +27,9 @@ builder.Services.AddScoped<SignatureCacheService>();
builder.Services.AddSingleton<AppVersionService>(); builder.Services.AddSingleton<AppVersionService>();
builder.Services.AddScoped<EnvelopeService>(); builder.Services.AddScoped<EnvelopeService>();
// Localization services
builder.Services.AddLocalization();
builder.Services.AddDevExpressWebAssemblyBlazorReportViewer(); builder.Services.AddDevExpressWebAssemblyBlazorReportViewer();
builder.Services.AddDevExpressWebAssemblyBlazorPdfViewer(); builder.Services.AddDevExpressWebAssemblyBlazorPdfViewer();