对 .NET 应用程序进行全球化和本地化Globalizing and localizing .NET applications

开发全球通用的应用程序(包括可本地化为一种或多种语言的应用程序)分为三步:全球化、可本地化性审核和本地化。Developing a world-ready application, including an application that can be localized into one or more languages, involves three steps: globalization, localizability review, and localization.

全球化Globalization

此步骤包括设计和编码非特定区域性和非特定语言的应用程序,以及设计和编码支持所有用户的本地化用户界面和区域数据的应用程序。This step involves designing and coding an application that is culture-neutral and language-neutral, and that supports localized user interfaces and regional data for all users. 它涉及做出不基于区域性特定的假设的设计和编程决策。It involves making design and programming decisions that are not based on culture-specific assumptions. 虽然全球化应用程序未本地化,但它经过设计和编写,因此随后可相对容易地将其本地化为一种或多种语言。While a globalized application is not localized, it nevertheless is designed and written so that it can be subsequently localized into one or more languages with relative ease.

本地化评审Localizability review

此步骤包括评审应用程序的代码和设计,以确保能轻松本地化应用程序和标识本地化的潜在障碍,并验证应用程序的可执行代码是否与其资源分隔开。This step involves reviewing an application's code and design to ensure that it can be localized easily and to identify potential roadblocks for localization, and verifying that the application's executable code is separated from its resources. 如果全球化阶段有效,则本地化检查将确认全球化过程中做出的设计和编码选择。If the globalization stage was effective, the localizability review will confirm the design and coding choices made during globalization. 本地化阶段还可以标识任何遗留问题,以便在本地化阶段不必修改应用程序的源代码。The localizability stage may also identify any remaining issues so that an application's source code doesn't have to be modified during the localization stage.

本地化Localization

此步骤包括为特定区域性或区域自定义应用程序。This step involves customizing an application for specific cultures or regions. 如果已正确执行全球化和本地化分析这两个步骤,则本地化主要包括用户界面的翻译。If the globalization and localizability steps have been performed correctly, localization consists primarily of translating the user interface.

遵循这三个步骤有两大好处:Following these three steps provides two advantages:

  • 让你无需改进为支持单个区域性(如美国英语)而专门设计的应用程序以支持其他区域性。英语,以支持其他区域性。It frees you from having to retrofit an application that is designed to support a single culture, such as U.S. English, to support additional cultures.

  • 这会产生更加稳定并有少量 Bug 的本地化应用程序。It results in localized applications that are more stable and have fewer bugs.

.NET 为开发全球通用和本地化的应用程序提供了广泛支持。.NET provides extensive support for the development of world-ready and localized applications. 特别是,.NET 类库中许多类成员通过返回可反映当前用户区域性或指定区域性约定的值来帮助全球化。In particular, many type members in the .NET class library aid globalization by returning values that reflect the conventions of either the current user's culture or a specified culture. 此外,.NET 支持附属程序集,这可推动本地化应用程序的过程。Also, .NET supports satellite assemblies, which facilitate the process of localizing an application.

有关其他信息,请参见全球化文档For additional information, see the Globalization documentation.

本节内容In this section

全球化Globalization

讨论创建全球通用的应用程序的第一个阶段,该阶段包括设计和编码为非特定区域性和非特定语言的应用程序。Discusses the first stage of creating a world-ready application, which involves designing and coding an application that is culture-neutral and language-neutral.

本地化评审Localizability review

讨论创建本地化应用程序的第二个阶段,该阶段包含标识本地化的潜在路障。Discusses the second stage of creating a localized application, which involves identifying potential roadblocks to localization.

本地化Localization

讨论创建本地化应用程序的最后阶段,该阶段包含自定义应用程序的特定区域或区域性的用户界面。Discusses the final stage of creating a localized application, which involves customizing an application's user interface for specific regions or cultures.

不区分区域性的字符串操作Culture-insensitive string operations

描述默认情况下如何使用区分区域性的 .NET 方法和类来获得不区分区域性的结果。Describes how to use .NET methods and classes that are culture-sensitive by default to obtain culture-insensitive results.

开发全球通用应用程序的最佳做法Best practices for developing world-ready applications

描述在全球化、本地化和开发全球通用的 ASP.NET 应用程序时遵循的最佳做法。Describes the best practices to follow for globalization, localization, and developing world-ready ASP.NET applications.

参考Reference

  • System.Globalization 命名空间System.Globalization namespace

    包含定义区域性相关信息的类,这些信息包括语言、国家/地区、正在使用的日历、日期的格式模式、货币、数字以及字符串的排序顺序。Contains classes that define culture-related information, including the language, the country/region, the calendars in use, the format patterns for dates, currency, and numbers, and the sort order for strings.

  • System.Resources 命名空间System.Resources namespace

    提供用于创建、操作和使用资源的类。Provides classes for creating, manipulating, and using resources.

  • System.Text 命名空间System.Text namespace

    包含表示 ASCII、ANSI、Unicode 以及其他字符编码的类。Contains classes representing ASCII, ANSI, Unicode, and other character encodings.

  • Resgen.exe(资源文件生成器)Resgen.exe (Resource File Generator)

    描述如何使用 Resgen.exe 将 .txt 文件和基于 XML 的资源格式 (.resx) 文件转换为公共语言运行时二进制 .resources 文件。Describes how to use Resgen.exe to convert .txt files and XML-based resource format (.resx) files to common language runtime binary .resources files.

  • Winres.exe(Windows 窗体资源编辑器)Winres.exe (Windows Forms Resource Editor)

    描述如何使用 Winres.exe 本地化 Windows 窗体。Describes how to use Winres.exe to localize Windows Forms forms.