Find by ID:
Go
[Log in | Register]
Home
Support Center Home
Categories (Beta)
Report Issue
Report a Bug
Make a Suggestion
Ask a Question
Security
Log in
Register
Forgot Password
Support Center Stats

Issue Reports
Total: 43361
Active: 399
Processed: 42962

Suggestions
Total: 17801
Active: 506
Processed: 17295

Questions
Total: 98469
Active: 99
Processed: 98370

1851 Knowledge Base Articles

557 Code Central Examples

Powered by Developer Express AJAX-Enabled ASP.NET components

This website is powered by Developer Express ASP.NET technologies including the ASPxMenu, ASPxNavBar, ASPxTabControl, ASPxSiteMapControl, ASPxPopupControl and the ASPxGridView and Editors Suite.
Database connectivity is via eXpressPersistent Objects.

Knowledge Base Article

How to translate components via their Localizer objects

Article ID: A2770
Product Group: .NET (WinForms)
Product: All .NET WinForms Components
Version(s): 6.x, 7.x, 8.x, 9.x
Updated: 19 Jun 2009
Categories: n/a

Description

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

Solution

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 / BarLocalizer / 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

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:
How to localize .NET Windows Forms components
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




Do you have any comments? We are eager to hear them!

How would you rate the quality of this content?

Average rating: 9 out of 9
1 people have rated this page
 
 
 
1
2
3
4
5
6
7
8
9
 
Post Your Vote (Login Required)
If you need any clarification with regards to the contents of this article, please don't hesitate to contact our Support Team.