Blazor server, UICulture set on first instantiation is remembered after user sets new culture #37705
Labels
area-blazor
Includes: Blazor, Razor Components
feature-blazor-server
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Bug description
Pages (or components) are rendered in the wrong language.
In an app with several languages, after the user changes the language, pages that trigger
new rendering based on external events can cause the page to be rendered with the previous language setting that was current
when the external events were first set up.
This can make the page language flicker between two languages if page is also rendered based on user interaction.
If it is not, the page will appear stuck in the wrong language.
The first rendering is made in the correct language, but following a new rendering triggered by an external event the language is set based on the event. Changing the
CurrentUICulture
just before invokingStateHasChanged
will correct this, but that has to be done every time.To Reproduce
(https://github.com/SandvikTeeness/Blazor.UICulture.Bug)
The bug is demonstrated on the Counter page by using a timer placed on the
WeatherForecastService
.I expect you to see the language flicker between the first you had when starting the app, and the language you have chosen as current.
Further technical details
dotnet --info
:dotnet --info Output
Visual Studio -> Copy Info
The text was updated successfully, but these errors were encountered: