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.
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.
This is another way of localizing Developer Express .NET products which allows resources to be localized on the fly.
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.
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.
Then these localizers are instantiated and assigned to their ancestors' Active property.
The result of localizing the runtime grid interface is shown below:
As mentioned above the technique described in this section can also be used when it is necessary to replace the default resources (for English (Unites States) culture) with their equivalents. For example, you can change such strings as "equals", "less then", etc. which are used in the grid's Custom Filter Dialog to their numerical equivalents "=", "<" as shown below:
The result is shown below: