This repository contains sample which shows localization of Syncfusion WPF DataGrid (SfDataGrid).
Localization is the process of translating the application resources into different language for the specific cultures. You can localize the WPF DataGrid by adding a resource file for each language.
When you change the application culture, you can localize the application based on application culture by creating .resx file.
public partial class MainWindow
{
public MainWindow()
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de");
InitializeComponent();
}
}Partial Public Class MainWindow
Public Sub New()
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de")
InitializeComponent()
End Sub
End ClassYou can create .resx files for any language by following these steps:
-
Right-click your project and add a new folder named as
Resources. -
Add the default resource files to the libraries you are using to the
Resourcesfolder and ensureAccessModifieris specified as Public.
Note:
Consider, you are using SfDataGrid and Ribbon in your application. Then, you need to copy and include Syncfusion.SfGrid.WPF.resx (since SfDataGrid present in Syncfusion.SfGrid.WPF library) and Syncfusion.Tools.Wpf.resx (since Ribbon present in Syncfusion.Tools.WPF library) files in your application under Resources folder. So, now you can know the key names and values of default stings used in Syncfusion.Tools.WPF.dll and Syncfusion.SfGrid.WPF.dll libraries.
- Now, right-click
Resourcesfolder and select Add and thenNewItem. In theAdd New Itemwizard, select the Resource File option and name the filename asSyncfusion.SfGrid.WPF.<culture name>.resx. For example, you have to give name asSyncfusion.SfGrid.WPF.de.resxforGermanculture. In the same way, add new resource files for other libraries used in your application.
- Now, select Add and add resource file for German culture in
Resourcesfolder and setAccessModifierproperty to No code generation.
- Now, you can copy the key names from the default resource files and assign values based on the culture and the resource files’ targets.



