简单的英语CultureInfo.InvariantCulture [英] CultureInfo.InvariantCulture in plain english

查看:90
本文介绍了简单的英语CultureInfo.InvariantCulture的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道日期/数字的文化规则对于整本书来说就足够了,尽管我认为我有一个简单的问题。

I know that culture rules for dates/numbers is enough for an entire book, I think I have a simple question though..

使用InvariantCulture基本上意味着您明确定义了将输入/显示为什么的值(日期/数字/任何内容)的区域性?

Does using InvariantCulture basically mean that you explicitly define what culture the value (date/number/whatever) will be inputted/displayed as? And it overrides any other culture setting (such as the user agent's setting)?

如果应用程序是为仅一种文化的受众而构建的,那么它是否有意义?使用InvariantCulture并定义每次输入/显示值的方式?

If an app is built for an audience of one and only one culture, would it make sense to use InvariantCulture and define how you want values inputted/displayed each time?

推荐答案


是否使用InvariantCulture基本上意味着您明确定义了将输入/显示为什么文化(日期/数字/什么)的值?

Does using InvariantCulture basically mean that you explicitly define what culture the value (date/number/whatever) will be inputted/displayed as?

否。它只是一种文化,有点像美国英语,除了一些诸如货币符号之类的东西。它通常用于设置格式/使用要理解的文本或由其他计算机而不是人类生成的文本。

No. It's just a culture which is a bit like US English, except for a few things like currency sign. It's usually used to format/consume text which is to be understood or was produced by another computer rather than a human.


专为一种和一种文化的受众而建,是否有必要使用InvariantCulture并定义每次输入/显示值的方式?

If an app is built for an audience of one and only one culture, would it make sense to use InvariantCulture and define how you want values inputted/displayed each time?

否,您将使用相关的 CultureInfo 来适应该文化。您还可以明确定义日期等的格式,但这是一个正交的问题。最好是针对该文化使用一种预定义的标准格式,但是如果这些格式都不满足您的需求,那么您总是可以明确的。

No, you would use the relevant CultureInfo for that culture. You could also explicitly define the format for dates etc, but that's an orthogonal concern. It may well be best to use one of the predefined standard formats for that culture, but if none of those meet your needs you can always be explicit.

这篇关于简单的英语CultureInfo.InvariantCulture的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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