开发者

Where can we see the whole list of named language values?

开发者 https://www.devze.com 2023-01-26 01:58 出处:网络
I notice that we can set the language for a form by using Xml:lang=\"en-US\". I want to see the named of other languages but not sure where those can be accessed from C#.

I notice that we can set the language for a form by using Xml:lang="en-US". I want to see the named of other languages but not sure where those can be accessed from C#.

Please help.

Edit 开发者_开发技巧I prefer to know an enum type which list the value set. Is there one available? Or we have to create that ourselves?

Since it seems to be no available enum type for this, here is my own-created one.


For .NET cultures belonging to a specific country and region:

CultureInfo.GetCultures(CultureTypes.SpecificCultures);

To access all the .NET cultures (standard or not), use:

CultureInfo.GetCultures(CultureTypes.AllCultures);


To get all valid culture infos:

CultureInfo[] cultureInfos = CultureInfo.GetCultures(CultureTypes.AllCultures);

Maybe you need this:

string xmlCulture = "en-US";
bool isSupported = CultureInfo.GetCultures(CultureTypes.AllCultures).Any(c => c.Name.Equals(xmlCulture));


If you want to see a list of the other culture you can find it here.

0

精彩评论

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

关注公众号