Refactor culture initialization logic

Moved culture initialization from App.razor to Program.cs to ensure culture settings are applied before the app starts. Removed CultureService injection and OnInitializedAsync method from App.razor. Updated LanguageSelector.razor to change language without page reload, enhancing user experience. Added System.Globalization to Program.cs for culture support.
This commit is contained in:
2026-06-18 12:43:56 +02:00
parent b5af3e61ed
commit 45018d04b1
3 changed files with 16 additions and 12 deletions

View File

@@ -1,6 +1,4 @@
@using System.Globalization
@using EnvelopeGenerator.ReceiverUI.Services
@inject CultureService CultureService
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
@@ -12,12 +10,3 @@
</LayoutView>
</NotFound>
</Router>
@code {
protected override async Task OnInitializedAsync()
{
var culture = await CultureService.InitializeCultureAsync();
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}
}