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

NativeName on CurrentCulture is shorten on Blazor WebAssembly .NET 5.0 #44739

Closed
christianzingg opened this issue Nov 16, 2020 · 12 comments · Fixed by #99956
Closed

NativeName on CurrentCulture is shorten on Blazor WebAssembly .NET 5.0 #44739

christianzingg opened this issue Nov 16, 2020 · 12 comments · Fixed by #99956
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Globalization in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@christianzingg
Copy link

The following Code produces different output comparing Blazor WebAssembly 3.2.0 and 5.0.0:

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
var native = Thread.CurrentThread.CurrentCulture.NativeName;
Console.WriteLine(native);

Blazor WebAssembly 5.0.0 --> "en (US)"
Blazor WebAssembly 3.2.0 --> "English (United States)"

PS: On normal ASP-Web application running with .NET 5.0 the output is "English (United States)"

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Nov 16, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Globalization untriaged New issue has not been triaged by the area owner labels Nov 16, 2020
@ghost
Copy link

ghost commented Nov 16, 2020

Tagging subscribers to this area: @tarekgh, @safern, @krwq
See info in area-owners.md if you want to be subscribed.

Issue Details
Description:

The following Code produces different output comparing Blazor WebAssembly 3.2.0 and 5.0.0:

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
var native = Thread.CurrentThread.CurrentCulture.NativeName;
Console.WriteLine(native);

Blazor WebAssembly 5.0.0 --> "en (US)"
Blazor WebAssembly 3.2.0 --> "English (United States)"

PS: On normal ASP-Web application running with .NET 5.0 the output is "English (United States)"

Author: christianzingg
Assignees: -
Labels:

area-System.Globalization, untriaged

Milestone: -

@tarekgh tarekgh added the arch-wasm WebAssembly architecture label Nov 16, 2020
@safern
Copy link
Member

safern commented Nov 16, 2020

cc: @lewing @EgorBo

@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Nov 18, 2020
@marek-safar marek-safar added this to the 6.0.0 milestone Nov 19, 2020
@csharpfritz
Copy link

csharpfritz commented Mar 16, 2021

This is a regression in .NET 5 compared to all of the other .NET frameworks. Please reconsider a patch to address this for our developers and users that don't speak English

Also: EnglishName property is misconfigured similarly

@tarekgh
Copy link
Member

tarekgh commented Mar 16, 2021

CC @tqiu8

@lewing
Copy link
Member

lewing commented Jul 31, 2021

This is intensional to save space, we might possibly be able to get some of this data from the browser Intl api. Moving to .NET 7

@csharpfritz
Copy link

csharpfritz commented Jul 31, 2021 via email

@lewing
Copy link
Member

lewing commented Jul 31, 2021

@csharpfritz I'm disappointed too but we've run out of time to solve this more generally for .NET6.

@csharpfritz
Copy link

csharpfritz commented Jul 31, 2021 via email

@Jinjinov
Copy link

Jinjinov commented Jan 16, 2023

So, the .NET 7 ship has sailed on this issue.

Can we expect this anytime soon? :)

I thought trimming was used to save space by removing unused code?

@csharpfritz
Copy link

csharpfritz commented Jan 18, 2023

Can we just move this feature to an external library that is optionally included in WebAssembly deployments?

At this point, I've written my own Dictionary object to host this content

@thomasgalliker
Copy link

I'm struggling with this issue on .NET MAUI (net8.0). Where can I find the native names of languages?

@ilonatommy
Copy link
Member

It was not backported to 8.0 and it's available in HybridGlobalization mode that has its side-effects - doc.
@lewing, should we backport it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Globalization in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.