Skip to content

Cultureinfo for Norwegian is not working in blazor webassembly .net5 #53239

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
Create a Blazor WebAssembly targeting .net5 and add edit the csproj to include true

Edit the Index.razor file:

@using System.Globalization
@page "/"

Problems with Globalization

@foreach (var language in languageCodes)
{
var culture = CultureInfo.CreateSpecificCulture(language);
var today = DateTime.Now.ToString("dddd, dd MMM yyyy", CultureInfo.GetCultureInfo(language));

}
Culture info fromDisplay NameThreeLetterISOLanguageNamemThreeLetterWindowsLanguageNameToDay with format "dddd, dd MMM yyyy"
@language@culture. DisplayName@culture. ThreeLetterISOLanguageName@culture. ThreeLetterWindowsLanguageName@today

@code{
List languageCodes = new List { "no", "nb", "nb-NO", "nn", "sv-se", "de", "fr", "en-US", "da-DK" };

}

For the values "no", "nb", "nb-NO" and "nn" it does not seem to load the correct CultureInfo, and the days of the week have English names and the name of the months are displayed as the letter "M" followed by the number of the month.

[GlobalizationProblem.zip] (https://aka.ms/dc/file?name=B088da46e4652449ab05cf37260b79151637495230874692982_GlobalizationProblem.zip&tid=088da46e4652449ab05cf37260b79151637495230874692982)


Original Comments

Feedback Bot on 2/21/2021, 11:28 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions