The standard XAF modules and DevExpress controls supply most of the English texts an XAF application's interface uses. The DevExpress .NET Localization Service provides the ready-to-use translations of these texts into different languages - ASP.NET resources (required for an ASP.NET application) and satellite assemblies (required for WinForms, ASP.NET, and Mobile platforms). This topic describes how to use these translations in your application and how to manually localize standard XAF Modules and DevExpress controls when there are no ready-to-use translations for your language.
You can install pre-built satellite assemblies in the Global Assembly Cache (GAC) to avoid translating texts supplied with DevExpress controls and XAF Modules. Satellite assemblies for de, es, ja and ru languages are installed in %PROGRAMFILES(x86)%\DevExpress 18.1\Components\Bin folder and GAC. You can download satellite assemblies for other cultures from the DevExpress Localization Service. Refer to the How to register an assembly in the GAC KB article for more information on how to manually register satellite assemblies in the GAC.
Ensure that the Languages key from the configuration file's appSettings section contains all the languages your application supports:
<configuration> <appSettings> <!-- ... --> <add key="Languages" value="en;de;fr" /> <!-- ... --> </appSettings> <!-- ... --> <configuration>
You can handle the XafApplication.CustomizeLanguagesList event as an alternative to the configuration setting above.
The Localization Service allows you to download and modify satellite assemblies. Set the .NET Platform to XAF to translate only XAF-specific values. Follow the steps from the Localization Service topic to localize XAF Modules. Note the following restrictions:
Calculated values are translated automatically based on the non-calculated values' translation. Input "non-calculated" in the search panel to show only the non-calculated values.
Values containing properties' names (ObjectCaptionFormat, DisplayFormat, etc.) should not be localized. ObjectFormatter processes these values and replace properties' names with the corresponding values.
If you received the FormatException or MemberNotFoundException, ensure that you have not replaced a property name with a localized value.
If the approach described in the section above does not apply you, follow the instructions from the How to: Localize XAF Application Items Using XAF Tools topic.
Culture-specific resources should be exported to the Application Model when you localize DevExpress Controls.
In the Properties window, click the XafApplication.ResourcesExportedToModel property's ellipsis button. In the invoked dialog, check the resources you want to localize. Click OK to submit the selection.
Invoke the Model Editor for the current application project and localize the Localization node's child nodes.
You can also use the module's ModuleBase.ResourcesExportedToModel property to add localizable resources in the Module Designer. The resources added in a module cannot be removed from the localizable resources list in another module or application. For example, if you added the resources in the base Module, these resources are used in a platform-specific Modules, but you cannot delete these resources from the platform-specific Module.
Certain components added to a Model require a reference. For instance, after adding the XtraGrid Control to the Model, you get the following error: "The type 'DevExpress.XtraGrid.Localization.GridResLocalizer' is defined in an assembly that is not referenced. You should add a reference to assembly 'DevExpress.XtraGrid.v18.1...". Add a reference to the required assembly to resolve this issue.
You can use one of the following approaches to reuse translations in different XAF applications: