Localizing DevExpress .NET Products

Localization is the process of translating an application's resources into localized versions for a specific culture or locale. This allows you to build translated versions of your applications in order to provide a complete native language interface to end users. This article guides you through the entire process of localizing Developer Express .NET products.


What should be localized?

All Developer Express .NET products have localizable resources that represent various dialog boxes, captions for buttons, menu items, confirmation and error messages, etc. All these resource strings can easily be translated into various languages or replaced by their equivalents. This can be done in one of two ways:


creating satellite resource assemblies;

using a "Localizer" object.

Creating satellite resource assemblies is the standard approach used when creating multi-language applications. Localizing via a "Localizer" is the feature provided by Developer Express which is useful in the following cases:


You are developing an application for a single culture and you want to translate the resources into the appropriate language or you just wish to change the default resources (for English (United States) culture) to their equivalents.

You don't want to use the available satellite assemblies and you don't have the source code to create your own localized assemblies.

The image below shows some editors from the XtraEditors Library localized into English and German.


Creating Satellite Resource Assemblies

This approach to localizing Developer Express .NET products implies creating new satellite assemblies which contain the localized resources translated into the appropriate target languages. This is the more common approach when developing world-ready applications.

Some of our customers have translated our resources into other languages. They've been kind enough to share these translated resources with the community, so you can freely download them here. The download includes resources translated to the following languages:


Chinese, Czech, Danish, Dutch, French, German, Italian, Japanese, Norwegian, Portuguese, Russian, Slovenian, Spanish, Vietnamese.


 

For other languages you can manually translate the resource strings provided that you have purchased the version of the component which ships with its source code. For detailed information on how to manually translate the resources and use satellite assemblies see the Localization document in the XtraEditors help file and the Localizing Applications document in MSDN Library.

Using a Localizer

This is another way of localizing Developer Express .NET products which allows resources to be localized on the fly.

What Is a Localizer?

A Localizer is a class that provides the means to localize the control's interface elements. Each Developer Express .NET control has its own localizer class, they are listed in the table below:

Control
Class
XtraBars
DevExpress.XtraBars.Localization.BarLocalizer
XtraCharts
DevExpress.XtraCharts.Localization.ChartLocalizer
XtraEditors Library
DevExpress.XtraEditors.Controls.Localizer
XtraGrid
DevExpress.XtraGrid.Localization.GridLocalizer
XtraLayout
DevExpress.XtraLayout.Localization.LayoutLocalizer
XtraNavBar
DevExpress.XtraNavBar.NavBarLocalizer
XtraPivotGrid
DevExpress.XtraPivotGrid.Localization.PivotGridLocalizer
XtraPrinting Library
DevExpress.XtraPrinting.Localization.PreviewLocalizer
XtraReports
DevExpress.XtraReports.Localization.ReportLocalizer
XtraScheduler
DevExpress.XtraScheduler.Localization.SchedulerLocalizer
XtraTreeList
DevExpress.XtraTreeList.Localization.TreeListLocalizer
XtraVerticalGrid
DevExpress.XtraVerticalGrid.Localization.VGridLocalizer

The process of localizing is rather simple. First you should create a descendant of the appropriate localizer and override its GetLocalizedString method in order to translate or modify the control's resource strings. After the localizer descendant has been created, you must instantiate it and assign it to the static Active property of the localizer class you derived it from.

Examples

The following example demonstrates how to localize the XtraGrid's and XtraEditors Library's UI into German. To do this, descendants of the DevExpress.XtraGrid.Localization.GridLocalizer and DevExpress.XtraEditors.Controls.Localizer classes with localized resource strings are created.

C#


你可能感兴趣的:(DevExpress)