开发者

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

开发者 https://www.devze.com 2022-12-11 01:36 出处:网络
quick question, what\'s the best way to convert language a abbreviation to full name? e.g. en to Engli开发者_开发问答sh?

quick question, what's the best way to convert language a abbreviation to full name? e.g. en to Engli开发者_开发问答sh? Note, it's not en-US, it's just en, fr, de

C# please.


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;


        System.Globalization.CultureInfo x = new CultureInfo("en");
        string name = x.EnglishName;
0

精彩评论

暂无评论...
验证码 换一张
取 消