How to: Localize an XAF Application
- 3 minutes to read
Choose a language you want to use in your XAF applications.
One of the pre-installed languages: German (de), Spanish (es), Japanese (ja) and Russian (ru).
- Download satellite assemblies using the Localization Service. See the Localize Standard XAF Modules and DevExpress Controls Used in an Application topic for more details on how to localize XAF modules in this service.
- Register the downloaded assemblies in the GAC or place them in your application bin folder. Note that the first approach allows you to see the localized values both at runtime and design time, but the second approach – only at runtime.
Satellite assemblies are reusable in any other project.
In the module project, double-click the Model.DesignedDiffs.xafml file to invoke the Model Editor. Focus the root node and click Languages Manager... in the Language combo box on the Model Editor Toolbar. Add the target language in the invoked dialog and click OK. Restart Visual Studio to load localized values from the satellite assemblies and specify the application's target language in the Language combo box.
Refer to the Localization Basics topic for more information.
- To add a new or modify an existing translation value, use one of the tools described in the How to: Localize XAF Application Items Using XAF Tools topic.
- To specify an application's language, invoke the Model Editor for an application project, navigate to the Application node and set the IModelApplication.PreferredLanguage property to the required language. Refer to the Localization Basics topic for more details. If you want your application's language to match the language on the user's device (or browser language for Mobile applications), set the PreferredLanguage property to (User language).
- Windows Forms Templates' localizable resources 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.
- The splash screen form displayed on the Windows Forms application startup contains a "Loading" text label. You can specify a different text as described in the Localize a Splash Form topic.
- Start the application to ensure that all the text values are localized.