Search code examples
c#globalizationcultureinfo

Convert language abbreviation to full name, e.g. en to English?


quick question, what's the best way to convert language a abbreviation to full name? e.g. en to English? Note, it's not en-US, it's just en, fr, de

C# please.


Solution

  • I'm not sure you can get it from just en... You can do this though if you know the rest of the abbrevation:

    System.Globalization.RegionInfo info = new System.Globalization.RegionInfo("en-GB");
    string countryName = info.EnglishName;
    

    Edit: Actually, you can do it:

    CultureInfo info = new CultureInfo("en");
    string englishName = info.EnglishName;