[ACCEPTED]-C# - How can I get the language name from the language code?-internationalization
Accepted answer
Console.WriteLine(new CultureInfo("en").DisplayName);
Note that DisplayName will format the name 2 for the currently set language. If you want 1 it to always be in English, use EnglishName.
Something like this will work:
var allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
var en = allCultures.FirstOrDefault (c => c.Name == "en").DisplayName;
var de = allCultures.FirstOrDefault (c => c.Name == "de").DisplayName;
CultureInfo.DisplayName will contain 1 what you are looking for.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.