KB Article A2770
Visible to All Users

How to translate components via their Localizer objects

Description:
Is there a Localizer class for the XtraNavBar similar to the XtraEditors' Localizer? I do not want to deal with the localized assemblies…

Answer:
Localizer classes exist in all Xtra~ components. Below is a complete list of them. The way you can use the Localizer object is the same for all controls and is described in the help on the XtraEditors example. To make a long story short, you need to create a descendant Localizer class and override its GetLocalizedString property, finally, create an instance of your class and assign it to the Localizer's Active static property. Here is some sample code:

C#
using DevExpress.XtraGrid.Localization; public class MyLocalizer : GridLocalizer { public override string GetLocalizedString(GridStringId id) { switch(id) { case StringId.MenuColumnColumnCustomization: return "Field Chooser"; } return base.GetLocalizedString(id); } } GridLocalizer.Active = new MyLocalizer();

We advise that you read the Using the Localizer Object paragraph in the Localization help topic to learn more.
Here is the list of the localizer objects for each product:
Product / Class Name / Enumerator / Namespace
XtraBars / BarLocalizer / BarString / DevExpress.XtraBars.Localization
XtraEditors / Localizer / StringId / DevExpress.XtraEditors.Controls
XtraGrid / GridLocalizer / GridStringId / DevExpress.XtraGrid.Localization
XtraNavBar / NavBarLocalizer / NavBarStringId / DevExpress.XtraNavBar
XtraPivotGrid / PivotGridLocalizer / PivotGridStringId / DevExpress.XtraPivotGridLocalization
XtraPrinting / PreviewLocalizer / PreviewStringId / DevExpress.XtraPrintingLocalization
XtraReports / ReportLocalizer / ReportStringId / DevExpress.XtraReportsLocalization
XtraScheduler / SchedulerLocalizer / SchedulerStringId / DevExpress.XtraScheduler.Localization
XtraTreeList / TreeListLocalizer / TreeListStringId / DevExpress.XtraTreeList.Localization
XtraVerticalGrid / VGridLocalizer / VGridStringId / DevExpress.XtraVerticalGrid.Localization
XtraWizard / WizardLocalizer / WizardStringId / DevExpress.XtraWizard.Localization
Note Not all strings can be translated via the Localizer classes. Some components contain form resources (e.g. the XtraReports has a Search dialog) and the only way to translate them is to create satellite assemblies. Thus, the localization via resources is a preferable solution.
See Also:
The collection of localized DevExpress assemblies
Localization in the XtraEditors help
Can I translate month and day names displayed in the DateEdit's calendar?
How to make internal strings in my application localizable
How to localize a WinForms application

Comments (2)
M M
Mohammad Amin Mollazadeh 9 years ago

    Is there a ready to use library? i don't have enough time to translate.

    DevExpress Support Team 9 years ago

      Hi Mohammad,

      We do not provide ready-to-use libraries with implemented Localizer objects. At the same time, I want to inform you that we provide Localization Service (see Localizing WinForms Controls via Satellite Resource Assemblies) that allows you to generate satellite assemblies for localizing your applications. You can check if the required localization is available, download and use it in your project.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.