Set default culture

Kuler Master 406 Reputation points
2025-02-07T10:08:15.3666667+00:00

Hello guys,

I am using Microsoft.Extensions.Localization (8.0.11) but for some reason the following code does not work as expected. As you see, I expect the German to be default language but it's always English. Am I missing something?

var supportedCultures = new[] { "de-DE", "en-US" }; 
var localizationOptions = new RequestLocalizationOptions()     
.SetDefaultCulture("de-DE")     
.AddSupportedCultures(supportedCultures)     
.AddSupportedUICultures(supportedCultures); 

Thank you

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,778 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,664 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.