Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request localization settings to the configured one #14866

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/OrchardCore.Modules/OrchardCore.Localization/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public override async ValueTask ConfigureAsync(IApplicationBuilder app, IEndpoin
var supportedCultures = await localizationService.GetSupportedCulturesAsync();

var cultureOptions = serviceProvider.GetService<IOptions<CultureOptions>>().Value;
var localizationOptions = serviceProvider.GetService<IOptions<RequestLocalizationOptions>>().Value;

app.UseRequestLocalization(options =>
{
options.CultureInfoUseUserOverride = !cultureOptions.IgnoreSystemSettings;
options.SetDefaultCulture(defaultCulture);
options.AddSupportedCultures(supportedCultures);
options.AddSupportedUICultures(supportedCultures);
});
localizationOptions.CultureInfoUseUserOverride = !cultureOptions.IgnoreSystemSettings;

app.UseRequestLocalization(localizationOptions
.SetDefaultCulture(defaultCulture)
.AddSupportedCultures(supportedCultures)
.AddSupportedUICultures(supportedCultures));
hishamco marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down