Blazor WASM only relies on the current culture (current UI culture isn't respected) #56824
Open
1 task done
Labels
area-blazor
Includes: Blazor, Razor Components
bug
This issue describes a behavior which is not expected - a bug.
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
feature-localization
Milestone
Is there an existing issue for this?
Describe the bug
This is essentially a dup of the unaddressed, closed issue filed by @SQL-MisterMagoo at Blazor WebAssembly Localization does not behave the same as Server side (dotnet/aspnetcore #25296) and a new issue that just arrived again on the docs repo at Can we have more details for the note, please? (dotnet/AspNetCore.Docs #33077).
cc: @hishamco @voroninp
Expected Behavior
It came to light several years ago via a docs issue from @SQL-MisterMagoo that resource loading is only based on the current culture in the WASM culture provider ...
https://github.com/dotnet/aspnetcore/blob/main/src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyCultureProvider.cs#L65
Why doesn't Blazor WASM load resources for both current culture and current UI culture? I'm going to (at least temporarily) react to this with a doc update that has devs only set the current culture in Blazor WASM apps.
Chatting with @SteveSandersonMS offline, this might be a bug ...
The original issue was backlogged for work but closed without work by @SQL-MisterMagoo.
Steps To Reproduce
From the report of @SQL-MisterMagoo, one can follow our Statically set the client-side culture guidance using a different culture for current culture and current UI culture and with the client-side localization guidance for a culture that matches the current UI culture.
I've placed a repro app at ...
https://github.com/guardrex/Blazor-WASM-Loc-PU-Issue-56824
en-us
). Run the app and see the correct globalization and localization in theCultureExample1
andCultureExample2
components.Program.cs
, change the current UI culture to Spanish (es-es
).CultureExample1
globalizes correctly to English, butCultureExample2
doesn't localize to Spanish.CultureExample1
andCultureExample2
globalize and localize correctly to Spanish, respectfully.Exceptions (if any)
None
.NET Version
AFAIK, this is for all versions.
Anything else?
Looks like it came in here 👉 #20033 ... and I don't see discussion on the point of only setting current culture.
The text was updated successfully, but these errors were encountered: