C# 中的全球化
有人可以向我解释一下 C# 中全球化有什么用吗?
它用于转换目的吗?我的意思是我想将任何英语单词转换为选定的语言。
那么这种全球化或文化信息对我有帮助吗?
Can somebody explain to me what is the use of globalization in C#?
Is it used for conversion purposes? I mean I want to convert any English word into a selected language.
So will this globalization or cultureinfo help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
来自 MSDN:
该程序集有助于使您的应用程序具有文化意识,并在 .NET 框架内部大量使用。例如,当从日期转换为字符串时,全球化用于确定使用什么格式,例如“11/28/2009”或“28-11-2009”。通常,此确定是在框架内自动完成的,而无需直接使用程序集。但是,如果需要,您可以直接使用全球化来查找特定于文化的信息供您自己使用。
From MSDN:
This assembly helps in making your application culture-aware, and is used heavily internally within the .NET framework. For example, when converting from Date to String, Globalization is used to determine what format to use, such as "11/28/2009" or "28-11-2009". Generally this determination is done automatically within the framework without you ever using the assembly directly. However, if you need to, you can use Globalization directly to look up culture-specific information for your own use.
为了消除更多混乱,
本地化(或非美国人的本地化),简称 L10n:针对特定位置调整程序的过程。它包括翻译资源、适配 UI(如果需要)等。
国际化,简称 i18n:适配程序以支持本地化、区域字符、格式等的过程,但最重要的是让程序能够支持本地化、区域字符、格式等的过程。无论当前的区域设置和操作系统语言版本如何,都可以正常工作。
全球化,简称g11n:由i18n和L10n两者组成。
To clear even more confusion
Localization (or Localisation for non-US people), L10n for short: process of adapting program for a specific location. It consist of translating resources, adapting UI (if necessary), etc.
Internationalization, i18n for short: process of adapting program to support localization, regional characters, formats and so on and so forth, but most importantly, the process of allowing program to work correctly regardless of current locale settings and OS language version.
Globalization, g11n for short: consist of both i18n and L10n.
为了消除一些混乱:
全球化:允许您的程序在运行时使用从外部资源 DLL 加载的区域设置特定资源。这意味着将所有字符串放入资源文件中,而不是将它们硬编码到源代码中。
本地化:使您的程序适应特定的区域设置。这可能是翻译字符串并使对话框从右到左读取阿拉伯语等语言。
此处是创建 Satellite DLL 的链接。它说的是 C++,但同样的原理也适用于 C#。
To clear some confusion:
Globalisation: Allowing your program to use locale specific resources loaded from an external resource DLL at runtime. This means putting all your strings in resource files rather than hard coding them into the source code.
Localisation: Adapting your program for a specific locale. This could be translating Strings and making dialog boxes read right-to-left for languages such as Arabic.
Here is a link to creating Satellite DLLs. Its says C++ but it the same principle applies to C#.
全球化:-
全球化是为多种文化地区设计和开发应用程序的过程。
本土化:-
本地化是针对给定文化和地区定制应用程序的过程。
Globalization:-
Globalization is the process of designing and developing applications for multiple cultures regions.
Localization:-
Localization is the process of customizing application for a given culture and locale.
全球化是一种针对特定文化格式化文本的方法。例如,数字 1000 的字符串表示形式对于英国可能是 1,000.00,对于法国可能是 1'000,00。这是一个相当深入的主题,但这是基本目标。
它不是翻译服务,但它确实允许您确定应用程序运行的文化,从而允许您选择要显示的语言。但是,您必须自己提供文本翻译,通常是通过资源文件的方式。
Globalization is a means of formatting text for specific cultures. E.g. a string representation of the number 1000 may be 1,000.00 for the UK or 1'000,00 for France. It is quite an in depth subject but that is the essential aim.
It is NOT a translation service, but it does allow you to determine the culture under which your application is running and therefore allow you to choose the language you want to display. You will have to provide text translation yourself, however, usually by means of resource files.
全球化是一种允许用户自定义他或她可能使用的应用程序以适应他们可能所处的标准的方法。定制允许:
适合文化。当前设置的区域由操作系统处理并传递给您的应用程序。全球化/国际化 (I18n) 通常还会促使开发人员将程序的显示文本与其本身的实现分开。
Globalization is a way of allowing the user to customize the application that he or she may be using to fit the standards where they may be. Cusomtization allows for the:
To be culturally appropriate. The region that is currently set is handled by the OS and passed to your application. Globalization/Internationalization(I18n) also typically motivates the developer to separate the displayed text of the program from the implementation its self.