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

Blazor WASM CultureInfo names returns locale #84016

Closed
1 task done
Cedervall opened this issue Mar 28, 2023 · 4 comments
Closed
1 task done

Blazor WASM CultureInfo names returns locale #84016

Cedervall opened this issue Mar 28, 2023 · 4 comments
Labels

Comments

@Cedervall
Copy link

Cedervall commented Mar 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using CultureInfo.NativeName, CultureInfo.DisplayName or CultureInfo.EnglishName I always get a two letter combination as output. Ex sv (SE), en (US), pt (BR).

Actual output for the code below:
Native: sv (SE)
Name: sv-SE
Display: sv (SE)
English: sv (SE)

Expected Behavior

The correct beheavior for would be for sv-SE is to give the output:

Native: svenska (Sverige)
Name: sv-SE
Display: Swedish (Sweden)
English: Swedish (Sweden)

or for pt-BR

Native: português (Brasil)
Name: pt-BR
Display: Portuguese (Brazil)
English: Portuguese (Brazil)

Steps To Reproduce

New Blazor WASM project. In the Index.razor add:

@code {
    protected override void OnInitialized()
    {
        var test = new System.Globalization.CultureInfo("sv-SE");

        Console.WriteLine("Native: " + test.NativeName);
        Console.WriteLine("Name: " + test.Name);
        Console.WriteLine("Display: " + test.DisplayName);
        Console.WriteLine("English: " + test.EnglishName);
    }
}

Needs to be a WASM project. Works as it should in server app, console app etc.

Get the same issue when running dotnet 6

Exceptions (if any)

No response

.NET Version

7.0.100

Anything else?

Get the same result in both Chrome and Edge, has language set to English (US) for the browsers.

@javiercn javiercn transferred this issue from dotnet/aspnetcore Mar 28, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 28, 2023
@ghost
Copy link

ghost commented Mar 28, 2023

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

Issue Details

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using CultureInfo.NativeName, CultureInfo.DisplayName or CultureInfo.EnglishName I always get a two letter combination as output. Ex sv (SE), en (US), pt (BR).

Actual output for the code below:
Native: sv (SE)
Name: sv-SE
Display: sv (SE)
English: sv (SE)

Expected Behavior

The correct beheavior for would be for sv-SE is to give the output:

Native: svenska (Sverige)
Name: sv-SE
Display: Swedish (Sweden)
English: Swedish (Sweden)

or for pt-BR

Native: português (Brasil)
Name: pt-BR
Display: Portuguese (Brazil)
English: Portuguese (Brazil)

Steps To Reproduce

New Blazor WASM project. In the Index.razor add:

@code {
    protected override void OnInitialized()
    {
        var test = new System.Globalization.CultureInfo("sv-SE");

        Console.WriteLine("Native: " + test.NativeName);
        Console.WriteLine("Name: " + test.Name);
        Console.WriteLine("Display: " + test.DisplayName);
        Console.WriteLine("English: " + test.EnglishName);
    }
}

Needs to be a WASM project. Works as it should in server app, console app etc.

Get the same issue when running dotnet 6

Exceptions (if any)

No response

.NET Version

7.0.100

Anything else?

Get the same result in both Chrome and Edge, has language set to English (US) for the browsers.

Author: Cedervall
Assignees: -
Labels:

area-System.Globalization

Milestone: -

@tarekgh tarekgh added the arch-wasm WebAssembly architecture label Mar 28, 2023
@ghost
Copy link

ghost commented Mar 28, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using CultureInfo.NativeName, CultureInfo.DisplayName or CultureInfo.EnglishName I always get a two letter combination as output. Ex sv (SE), en (US), pt (BR).

Actual output for the code below:
Native: sv (SE)
Name: sv-SE
Display: sv (SE)
English: sv (SE)

Expected Behavior

The correct beheavior for would be for sv-SE is to give the output:

Native: svenska (Sverige)
Name: sv-SE
Display: Swedish (Sweden)
English: Swedish (Sweden)

or for pt-BR

Native: português (Brasil)
Name: pt-BR
Display: Portuguese (Brazil)
English: Portuguese (Brazil)

Steps To Reproduce

New Blazor WASM project. In the Index.razor add:

@code {
    protected override void OnInitialized()
    {
        var test = new System.Globalization.CultureInfo("sv-SE");

        Console.WriteLine("Native: " + test.NativeName);
        Console.WriteLine("Name: " + test.Name);
        Console.WriteLine("Display: " + test.DisplayName);
        Console.WriteLine("English: " + test.EnglishName);
    }
}

Needs to be a WASM project. Works as it should in server app, console app etc.

Get the same issue when running dotnet 6

Exceptions (if any)

No response

.NET Version

7.0.100

Anything else?

Get the same result in both Chrome and Edge, has language set to English (US) for the browsers.

Author: Cedervall
Assignees: -
Labels:

arch-wasm, area-System.Globalization, untriaged

Milestone: -

@pavelsavara
Copy link
Member

cc @ilonatommy

@ilonatommy
Copy link
Member

Thank you for the report, this is intentional to save space. I am closing as a duplicate of #44739.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Apr 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants