简体   繁体   English

根据语言获得文化

[英]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 例如,如果我将语言= CHS传递,它将根据国家语言支持(NLS)API参考检索zh-CN: http : //msdn.microsoft.com/zh-cn/goglobal/bb896001.aspx

I belive .Net framework should provide us with method that support that . 我相信.Net框架应该为我们提供支持该方法的方法。

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 . 您可能要使用CultureTypes.SpecificCultures而不是CultureTypes.AllCultures

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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