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
 End-User Documentation

How to: Localize an XAF Application

In this topic, you will learn how to localize a typical XAF application. We recommend that you review the Application Model Basics and Localization Basics topics before proceeding. You can localize an XAF application in two ways.

  • Directly in the Model Editor by translating each localizable value.
  • Using the Localization Tool, which can be invoked from the Model Editor Toolbar. This tool gathers all the localizable values in one grid, and provides the import/export functionality as well as the ability to use the Microsoft Translator service.

These two approaches are described below. We recommend using the Localization Tool, because it makes the localization process quicker and more convenient.

Expanded Add the New Language Aspect and Localizable Resources to the Application Model

These are the initial steps that should be performed independent of the chosen localization approach.

  • Localization of the XAF modules and DevExpress controls used in your XAF application is required. If the localized resources are available for the target language, you can use them. Otherwise, you should export the culture-specific resources to the Application Model, to enable the capability to localize them together with your custom text. Follow the recommendations described in the Localize Standard XAF Modules and DevExpress Controls Used in an Application topic.
  • Localizable resources of Windows Forms Templates are not available in the Application Model by default. Refer to the How to: Localize a WinForms Template to learn how you can localize it.
    Note

    Template resources include strings such as "File", "View", "Home" and "Tools", used in the application's main menus as well as the ribbon. If you see that the menu items in the standard form, or page and group captions in the ribbon form, are not translated, ensure that you have added and translated the template resources.

  • If there are "hardcoded" strings visible in the application UI, it is recommended that you make them localizable. Refer to the How to: Localize Custom String Constants topic for details.
  • Invoke the Model Editor for the module project. Add a new language via the Languages Manager, as described in the Localization Basics topic. Repeat this step for the platform-specific modules. Note that a Visual Studio restart is required to see localized text provided with satellite assemblies in the Model Editor.

Expanded Use the Localization Tool

We recommend that you begin the translation from the platform-agnostic module, and then proceed to the platform-specific modules. Follow the steps below to localize each of your XAF application modules with the Localization Tool.

  • Click the Localization button in the XAF Model Editor Toolbar. The expressApp Framework Localization window will be invoked.

    This window provides the grid editor with all localizable property names, paths, descriptions and values. The toolbar with the set of commands is also provided. The grid columns and actions available in this window are described in the Localization Tool topic.

  • In the Localization window toolbar, select the target language via the Translation Language drop-down.

    Note

    If you have successfully installed satellite assemblies for the target language, you will see that text supplied with the standard XAF modules have already been translated.

  • Apply the Untranslated non-calculated filter via the Filters action.

    This filter selects the properties that have non-empty default language values with Is Translated unchecked and Is Calculated checked. For instance, the OwnMembers node’s Caption properties will be displayed and the Columns node’s Caption properties will be hidden.

  • Translate all the values in the Translated Value column. Pressing the ENTER key moves focus to the next row. If there are several properties with the same Default Language value, the Multiple Values Translation dialog will be invoked. Click Yes, and all these values will be translated at once, and the next value to be translated will be focused.

    Note

    • You can use the Translate... button to automate the translation. Select one, several or all rows, and click Translate... or press CTRL+T. In the invoked dialog, select the original language (English by default), click Translate and the Microsoft Translator service will translate for you. Of course, an Internet connection is required for this feature. Note that automatic translation is not perfect, and requires review.

    • If you are not fluent in the target language, you can hire a professional translator. Export the selected rows to a CSV file via the Export | Selected records command, and pass this file to the translator. The translator will edit the values in the Translated Value column using a spreadsheet or a plaintext editor of his/her choice. The Description column content will help him/her see the context. The translated values can be loaded back from the CSV file via the Import Action. If non-latin characters are used in the CSV file, the file encoding should be UTF-8.

  • When you have finished the translation, click Save or press CTRL+S to save changes to the Application Model. The translated properties will be hidden due to the Untranslated... filter, and the Is Translated checkbox is checked after saving.

  • Next, apply the Calculated filter to review the calculated values.

  • After closing the Localization window, you can see the localized values in the Model Editor. Save the changes in the Model Editor.

A typical XAF application has platform-specific versions of the authentication, security strategy and modules. For instance, Windows Forms and ASP.NET applications can have SchedulerWindowsFormsModule and SchedulerAspNetModule modules included respectively. These modules extend the Application Model with localizable properties that are not available at the module level. You can have platform-specific Controllers provide strings that need to be localized (action captions, tooltips, exceptions, etc.). So, you should repeat these steps for each platform-specific module.

Expanded Localize an XAF Application Directly in the Model Editor

Localizing an XAF application directly in the Model Editor is an alternate approach.

  • Select the target language via the XAF Model Editor Toolbar.
  • Set the localized values to the properties of the Application root node.
  • Expand the ActionDesign | Actions node. Set the localized values to the Caption properties of all its child nodes. The ShortCaption and the Tooltip properties will be localized automatically, as they expose values from the Caption properties by default. Localize the ConfirmationMessage properties if required.
  • Note

    If you do not use the Active Directory authentication, take special note of the Log On window (web page) UI elements' localization. The Log On and Cancel buttons are Actions. These Actions have Logon and DialogCancel IDs, and are localizable under the ActionDesign | Actions node.

  • Expand the ActionDesign | DisableReasons node. Set localized values to the Caption properties of its child nodes.
  • Expand the BOModel node. Set localized values to the Caption properties of its child nodes. You can skip nodes of classes that are not represented in the application UI (e.g., the XPBaseObject node). Note that the localization of ObjectCaptionFormat properties may also be required. The Caption properties of CreatableItems, NavigationItems and Views child nodes will be localized automatically as they expose values from class captions by default.
  • Expand the Localization node. Set localized values to the Value properties of its child nodes. Take special note of the Exceptions | UserVisibleExceptions child node. You can skip the Exceptions | SystemExceptions node, as it contains exceptions addressed to developers and administrators, and is invisible to end-users in normal application operation.
  • Expand the NavigationItems node. Check to see if there are any child nodes with captions not localized automatically. The Default node caption should be localized.
  • If the ValidationModule module is used in the application, expand the Validation node. Set localized values to the child node properties denoted by the globe glyph ().
  • A typical XAF application has platform-specific versions of the authentication, security strategy and modules. For instance, Windows Forms and ASP.NET applications can have SchedulerWindowsFormsModule and SchedulerAspNetModule modules included, respectively. These modules extend the Application Model with localizable properties that are not available at the module level. You can have platform-specific Controllers that provide strings that need to be localized (action captions, tooltips, exceptions, etc.), so repeat these steps for each platform-specific module.
  • If you do not use the Active Directory authentication type, localization of the Log On window (web page) requires special attention. This window (web page) content is represented by the AuthenticationStandardLogonParameters Detail View, so navigate to the Views | AuthenticationStandardLogonParameters_DetailView node and set the localized value to its Caption property. Expand the Items child node and localize the Text property of the LogonText node. Localize the UserName and Passwords node captions.
  • Note

    This step should be performed separately for Windows Forms and ASP.NET applications. Use the Model Editor invoked for each application project to localize the Log On window (web page) UI elements. However, the "Log On" and "Cancel" Actions captions can be localized in the module project Model. See the step 5 note for details. The message displayed when the logon fails is also localized in the module project Model under the Localization | Exceptions | UserVisibleExceptions | Security node.

  • There are additional Localization child nodes in the Model Editor, invoked for the application project (Windows Forms or ASP.NET). For instance, in the Windows Forms application Model, you should set localized values to Confirmations, DialogButtons and FrameTemplates child nodes.

Expanded Miscellaneous Localizations that Cannot be Performed at Design Time

  • The splash screen form displayed on the Windows Forms application startup contains the "Loading" text label. This default text is hardcoded in XAF sources, as the Application Model is not yet initialized when the splash is displayed (see Windows Forms Application Creation and Initialization). You can set a different text using the ISplash.SetDisplayText method.
    Note

    You can implement a custom splash screen instead. Refer to the How to: Use a Custom Splash Screen topic for details.

Expanded See Also

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