diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Localization/Startup.cs index 1f06f6573a7..99326bc1d16 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Localization/Startup.cs @@ -50,14 +50,15 @@ public override async ValueTask ConfigureAsync(IApplicationBuilder app, IEndpoin var supportedCultures = await localizationService.GetSupportedCulturesAsync(); var cultureOptions = serviceProvider.GetService>().Value; + var localizationOptions = serviceProvider.GetService>().Value; - app.UseRequestLocalization(options => - { - options.CultureInfoUseUserOverride = !cultureOptions.IgnoreSystemSettings; - options.SetDefaultCulture(defaultCulture); - options.AddSupportedCultures(supportedCultures); - options.AddSupportedUICultures(supportedCultures); - }); + localizationOptions.CultureInfoUseUserOverride = !cultureOptions.IgnoreSystemSettings; + localizationOptions + .SetDefaultCulture(defaultCulture) + .AddSupportedCultures(supportedCultures) + .AddSupportedUICultures(supportedCultures); + + app.UseRequestLocalization(localizationOptions); } }