Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

BlazorWebAssembly - CultureInfo.DefaultThreadCurrentCulture changes in Chrome but not in Edge or Firefox

$
0
0

I have a BlazorWebAssembly application where I'd like to implement multilinguality. I created the .resx files. In my Program.cs I added

builder.Services.AddLocalization();

When the user is loaded or the user changes the language in his profile, I call

context.SetCulture(user.PreferredLanguage ?? "en-US");

This method is

public void SetCulture(string cultureName){    var culture = CultureInfo.CreateSpecificCulture(cultureName);    CultureInfo.DefaultThreadCurrentCulture = culture;    CultureInfo.DefaultThreadCurrentUICulture = culture;}

This works fine in Google Chrome, I can switch between german and english without any problems. However, it does not work in Edge.

The application is hosted on Azure as an App Service.

My Edge version is 133.0.3065.59.My Chrome version is 133.0.6943.99.My Firefox version is 135.0.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>