Localization of Syncfusion® WPF Controls
13 Jul 20262 minutes to read
Localization is the process of translating the application resources into different languages for specific cultures. You can localize the Syncfusion® WPF controls by adding a resource file for each language.
Changing application culture
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()
{
InitializeComponent();
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de");
}
}Partial Public Class MainWindow
Public Sub New()
InitializeComponent()
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de")
End Sub
End ClassCreating .resx files
You can create .resx files for any language by following these steps:
NOTE
You can get the default resource files of all Syncfusion® WPF libraries from GitHub.
1) Right-click your project and add a new folder named as Resources.
2) Add the default resource files to the libraries you are using to the Resources folder and ensure AccessModifier is specified as Public.
NOTE
Consider, you are using
SfDataGridandRibbonin your application. Then, you need to copy and includeSyncfusion.SfGrid.WPF.resx(sinceSfDataGridpresent inSyncfusion.SfGrid.WPFlibrary) andSyncfusion.Tools.Wpf.resx(sinceRibbonpresent inSyncfusion.Tools.WPFlibrary) files in your application underResourcesfolder. So, now you can know the key names and values of default strings used inSyncfusion.Tools.WPF.dllandSyncfusion.SfGrid.WPF.dlllibraries.

3) Now, right-click Resources folder and select Add and then NewItem. In the Add New Item wizard, select the Resource File option and name the filename as Syncfusion.SfGrid.WPF.<culture name>.resx. For example, you have to give name as Syncfusion.SfGrid.WPF.de.resx for German culture. In the same way, add new resource files for other libraries used in your application.

4) Now, select Add and add resource file for German culture in Resources folder and set AccessModifier property to No code generation.

5) Now, you can copy the key names from the default resource files and assign values based on the culture and the resource files’ targets.

NOTE
Download demo from the GitHub.
Editing default culture strings
You can change default strings of any control by adding the default .resx files (from GitHub) to the Resources folder of your application. If added, Syncfusion® WPF controls read the default strings from the .resx files of the application.