C# 中的 Culture 相当于 Java 中的 Locale 吗?
C# 使用文化的概念。这在操作上与 Java 中的 Locale 类似吗?或者底层概念是否存在显着差异?
C# uses the concept of Culture. Is this operationally similar to Locale in Java or are there significant differences in the underlying concepts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从文化而不是语言环境的角度进行工作是一种寻找正确抽象层次的尝试——从以类似方式做事的人群的角度来考虑事物,而不是谈论地理区域和语言,并有点疯狂地认为这些区域和语言可靠地对应于成套的文化习俗。
它们的意图相似,只是“文化”试图找到“语言环境”严重错过的抽象最佳点。
Working in terms of Culture rather than Locale is an attempt at finding the correct level of abstraction — considering things in terms of groups of people who do things in similar ways, rather than talking about geographic areas and languages and somewhat derangedly thinking those correspond reliably to sets of cultural conventions.
They're similar in intent, just "Culture" is trying to find the abstraction sweet spot that "Locale" dramatically missed.
我对 Java 不是特别熟悉,但据我所知,CultureInfo 大致相当于 Java 中的 Locale。
简而言之,它提供了根据区域规则、区域含义、语言或语言与地理区域(在某些情况下还包括语言、地理区域和字母表)的组合来格式化数字和日期、书写系统、字符串排序和日历功能的功能。
I am not particularly familiar with Java, but from what I can tell CultureInfo is roughly equivalent Locale in Java.
In short, it provides functionalty for formatting of numbers and dates, writing systems, string sorting and calendar functionality according to regional rules, regional meaning a combination of language or language and geographical region (and in some cases language, geographical region and alphabet).