[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Collapse]eXpressApp Framework
 [Expand]Getting Started
 [Expand]Design-Time Features
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]List Editors
  [Expand]Property Editors
  [Expand]Scheduler and Notifications
    How to: Add a Custom Localization Dictionary to a Mobile Application
    How to: Change a Mobile UI Language at Runtime
    How to: Create a Custom Translation Provider for the Localization Tool
    How to: Localize a WinForms Template
    How to: Localize an XAF Application
    How to: Localize Custom String Constants
    How to: Localize XAF Application Items Using XAF Tools
  [Expand]Miscellaneous UI Customizations
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

How to: Localize a WinForms Template

This topic demonstrates how to localize a WinForms Template using the Model Editor. You can customize custom and built-in WinForms templates. Both of these cases are considered in this topic.

Expanded Localize a Built-In WinForms Template

To do the translation manually, either directly in the Model Editor or using the Localization Tool, the culture-specific resources should be exported to the Application Model.

  • Invoke the Application Designer.
  • In the Properties window, press the ellipsis button of the ResourcesExportedToModel property (see XafApplication.ResourcesExportedToModel). In the invoked dialog, check the templates you want to localize. Submit the selection by pressing the OK button.

  • Invoke the Model Editor for the current application project. In the Localization node, you will find child nodes corresponding to the selected resources. Localize them, as with any other XAF string.

As an alternative, you can add localizable resources in the Module Designer. To do this, use the module's ModuleBase.ResourcesExportedToModel property.

Expanded Localize a Custom WinForms Template

It is assumed that you have created a custom template, as described in the How to: Create a Custom WinForms Ribbon Template topic. However, a similar approach is applicable to any other custom WinForms Template (e.g., created in accordance with the How to: Create a Custom WinForms Standard Template ).

Follow the steps below to make localization items related to your custom template available in the Application Model.

  • Inherit the FrameTemplateLocalizer<T> class. Pass your custom template type (e.g., DetailRibbonForm1) as the generic parameter.

  • In the WinApplication descendant's constructor, add the MyTemplateLocalizer to the XafApplication.ResourcesExportedToModel list.

  • In the code-behind file of your custom template (e.g., DetailRibbonForm1.Designer.cs), find the line where the resources private field is declared and initialized.

    Replace the ComponentResourceManager type with XafComponentResourceManager.

  • Rebuild the solution and run the Model Editor. Expand the Localization | FrameTemplates | DetailRibbonForm1 node. The localization items related to your custom templates are available here.

    You can localize these items using the standard approach described in the Localization Basics topic.

Is this topic helpful?​​​​​​​