简体   繁体   中英

Get culture based on language

How can I get culture based on language ? For example if I will pass language = CHS it will retrieve zh-CN based on National Language Support (NLS) API Reference: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx

I belive .Net framework should provide us with method that support that .

your responce will be highly appreciated !

This will give you a list of matching cultures:

CultureInfo.GetCultures(CultureTypes.AllCultures)
.Where(c => c.ThreeLetterWindowsLanguageName == "CHS")

You may want to use CultureTypes.SpecificCultures instead of CultureTypes.AllCultures .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM