dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.43k stars 25.33k forks source link

Add line in documentation on how to apply the `RequestLocalizationOptions` #32931

Open lettuceDestroyer opened 4 days ago

lettuceDestroyer commented 4 days ago

Description

In the section Configure Localization middleware it is mentioned how to configure the localization middleware but it isn't mentioned how to apply them. I would suggest adding the line app.UseRequestLocalization(app.Services.GetRequiredService<IOptions<RequestLocalizationOptions>>().Value); to the code block.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/localization/select-language-culture?view=aspnetcore-8.0#configure-localization-middleware

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/localization/select-language-culture.md#configure-localization-middleware

Document ID

b4841fb3-f720-fdc5-851c-80d336abfbe1

Article author

@Rick-Anderson

Rick-Anderson commented 3 days ago

@hishamco please review.

hishamco commented 1 day ago

it is mentioned how to configure the localization middleware but it isn't mentioned how to apply them

Could you please elaborate?