Description
Is there an existing issue for this?
- I have searched the existing issues
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).
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 ...
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 ...
I think we should be loading the localization resources for CurrentUICulture (and possibly also CurrentCulture if that’s needed to make formatting/parsing work correctly). Whereas like you point out, we only load for CurrentCulture.
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
- The app configures the current culture and current UI culture to US English (
en-us
). Run the app and see the correct globalization and localization in theCultureExample1
andCultureExample2
components. - In
Program.cs
, change the current UI culture to Spanish (es-es
).CultureExample1
globalizes correctly to English, butCultureExample2
doesn't localize to Spanish. - Change the current culture to Spanish. Now, both
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.
Activity