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]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Collapse]Windows 10 App Controls
  Prerequisites
 [Expand]Getting Started
 [Expand]Controls
 [Expand]Themes and Color Schemes
  Localization
  Get More Help
 [Expand]API Reference
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Localization

The following DevExpress Win10 App controls display built-in strings that can be localized into various languages.

Control strings can be localized in code and by using resources.

Expanded Localizing in Code

Use the DevExpress.Core.Localization.Localizer class to localize a control’s built-in text in code. This class provides the AddString static method that allows you to add a control's localized string for a specific language.

The first parameter of the AddString method specifies the name of the target language. A list of supported language names can be found in MSDN at: Choosing your languages.

The second parameter is the identifier of a string to be translated. The following enumerators contain available string identifiers.

  • DevExpress.Core.Localization.GridStringID - Enumerates localizable strings for the GridControl
  • DevExpress.Core.Localization.PdfViewerStringID - Enumerates localizable strings for the PdfViewerControl

The third parameter of the AddString method specifies the translated string.

Tip

There is an AddString method overload that does not require the target language name to be specified. A translated string provided with this method will be used in all cases that require the default string.

The Localizer.AddString method needs to be called before a localizable control is created. The best place to add localized strings is a static constructor of your Application or Page class.

Expanded Localizing by using Project Resources

You can define localized strings in resources as follows.

  1. Add a folder to your project and give it a name matching the target language name.
  2. Add a resource file to this project with the Add->New Item... command, which is available from the folder's context menu.

  3. Add localizable strings to this resource file.

    The resource name should identify the localizable string in the form: EnumName_EnumValue. The enumerators that identify localizable strings are listed in the section above.

  4. Enable the use of this resource file with the DevExpress.Core.Localization.Localizer.EnableResourceStrings static property.

    This property needs to be set before a localizable control is created (for instance, in a static constructor of your Application or Page class).

Expanded Localized Resources Priority

The DevExpress localization mechanism searches for translated strings in the following order.

  1. Strings that were added by the Localizer.AddString method with the target language name specified.
  2. Strings in resource files (if the Localizer.EnableResourceStrings property is enabled).
  3. Default strings that were added by the Localizer.AddString method overload without the parameter identifying the target language name.

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