Localization in WPF Gantt

15 Jul 20261 minute to read

Localization is the process of translating the application resources into different languages for the specific cultures. You can localize the GanttControl by adding a resource file. The application culture can be changed by setting CurrentUICulture and CurrentCulture before the InitializeComponent() method.

In the application below, the culture is configured to French language.

public MainWindow()
{
    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr");

    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr");

    InitializeComponent();
}

To localize the GanttControl based on CurrentUICulture using resource files, follow the steps below.

  1. Create a new folder named Resources in your application.
  2. Add the default resource file of GanttControl into the Resources folder. You can download the Syncfusion.Gantt.WPF.resx here.

ResourceReference

  1. Right-click on the Resources folder, select Add and then NewItem.

  2. In the Add New Item wizard, select the Resource File option and name the file as Syncfusion.Gantt.WPF.<culture name>.resx.

For example, you have to give the name as Syncfusion.Gantt.WPF.fr.resx for the French culture.

  1. The culture name indicates the name of the language and country.

AddResource

  1. Now, select the Add option to add the resource file in the Resources folder.

FrenchResourceReference

  1. Add the Name/Value pair in Resource Designer of the Syncfusion.Gantt.WPF.fr.resx file and change its corresponding value to the corresponding culture.

localization-in-wpf-gantt-control

You can download the sample for localization of the Gantt control from here