由CultureInfo类在.NET 3.5支持什么文化? [英] What cultures are supported by the CultureInfo class in .NET 3.5?

查看:183
本文介绍了由CultureInfo类在.NET 3.5支持什么文化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要的是通过.NET 3.5的支持,无论使用何种操作系统文化的名单。 这似乎是一个相当斗争获得的,虽然我不知道为什么!

I need a list of cultures that are supported by .NET 3.5, regardless of the OS used. This seems to be quite a struggle to obtain, though I am not sure why!

编辑: Arghh,我不知道它是依赖于操作系统,这可以解释缺少文档上。对什么是支持的Mac / Linux操作系统呢?

Arghh, I was not aware that it is dependent on the OS, that would explain the lack of documentation. Any ideas on what is supported by Mac/Linux OS as well?

感谢:)

推荐答案

不幸的是,这取决于操作系统。检查这里每操作系统的默认语言的支持。

Unfortunately, it is OS dependent. Check here for default language support per OS.

请注意,href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx"> CultureInfo的文档警告

Note, the CultureInfo documentation warns:

Windows版本或服务包可以改变现有的文化。

Windows versions or service packs can change the available cultures.

在ASP.NET中,它的浏览器,重要的是与操作系统。它可以告诉你哪些语言通过接受语言(14.4 )请求头。如果您设置的应用程序的全球化配置enableClientBasedCulture =true时,ASP.NET将尝试自动设置的UICulture和文化是由浏览器所提供的价值。另外,您也可以手动检查设置文化的<一个href="http://msdn.microsoft.com/en-us/library/system.web.htt$p$pquest.userlanguages.aspx">Request.UserLanguages属性:

In ASP.NET, it's the browser that's important versus the OS. It can tell you which language the user prefers via the Accept-Language (Section 14.4) request header. If you set your app's globalization configuration to enableClientBasedCulture="true", ASP.NET will try to automatically set the UICulture and Culture to the value provided by the browser. Alternatively, you can set Culture manually by inspecting the Request.UserLanguages property:

  • How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization
  • Rick Strahl shows manual detection and setting

不幸的是,有没有办法来从操作系统或浏览器可能语言的详尽清单。最接近的就是 IANA语言子标签注册表。这是 RFC 4646 描述的语言注册表 - 定义.NET的CultureInfo的标签文档。

Unfortunately, there's no way to generate an exhaustive list of possible languages from an OS or browser. The closest thing is the IANA Language Subtag Registry. This is the language registry described in RFC 4646 - the document that defines .NET's CultureInfo tags.

请记住,语言标记Request.UserLanguages​​不能保证有效。你要检查他们。 HTTP 1.1使用了语言代码较早的建议,并没有什么能阻止别人发送乱码的语言头。

Keep in mind, language tags in Request.UserLanguages are not guaranteed to be valid. You'll want to check them. HTTP 1.1 uses an older recommendation for language tags and there's nothing stopping someone from sending gibberish in the language header.

这篇关于由CultureInfo类在.NET 3.5支持什么文化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆