Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]Actions
  [Expand]Navigation
  [Expand]Views
  [Expand]List Editors
  [Expand]Property Editors
  [Expand]Templates
  [Expand]Filtering
  [Expand]Reporting
  [Expand]Dashboards
  [Expand]Scheduler and Notifications
  [Expand]Maps
  [Expand]Security
  [Expand]Workflow
  [Collapse]Localization
    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
  [Expand]Testing
  [Expand]Miscellaneous UI Customizations
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

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.

How would you rate this topic?​​​​​​​