Localization
- 2 minutes to read
Localization is the process of translating an application's UI into another language by translating that application's resources. This process allows you to build translated versions of your applications in order to provide a complete native language interface to end-users. This article guides you through the entire process of localizing a DevExpress Silverlight DXGrid control.
#Localizing DXGrid via Localizer
Each Developer Express component or library has a specific Localizer class that provides localized strings for that component/library. For DXGrid, this is the GridControlLocalizer class. The localization process is straightforward.
- Create a descendant of the GridControlLocalizer class and override its GetLocalizedString or PopulateStringTable method. The first method should return strings for specific string resource identifiers. The PopulateStringTable method adds strings for specified resource identifiers.
- Use this localizer. Assign an instance of your localizer class to the static Active property of the localizer class you derived from.
For an example, please see How to: Translate the Grid's UI via Localizer.
#Dynamic Localization of Individual Resource Strings
Default resource strings can also be replaced with custom strings at runtime (when required). To do this, follow the steps below.
Create a new instance of the RuntimeStringIdInfo object with the specified Id and Value properties.
Id - identifies the grid's resource string;
Value - a string value that replaces the default resource string specified by Id.
- Add the RuntimeStringIdInfo object to the DataViewBase.RuntimeLocalizationStrings collection.
For an example, please see How to: Dynamically Localize Individual Resource Strings.