How to Localize Labels in WPF Chart Control?
Localization of the WPF Chart can be customized by using the CurrentUICulture property in the WPF Chart. You can change the language by assigning the culture name of the desired language to this property.
Set Current UI Culture to the Application
public MainWindow()
{
InitializeComponent();
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR");
}
Steps to localize based on CurrentUICulture using Resource files
- Create new folder, named as Resources in the application.
- Right-click on the Resources folder, select Add, and then click New Item. In the Add New Item dialog, select the Resource File option and name the file as
Syncfusion.SfChart.WPF.<culture name>.resx
. For example, name it asSyncfusion.SfChart.WPF.fr-FR.resx
to add localization support for the French language.
- The culture name that indicates the name of language and country.
- Now, add the Name/Value pair in Resource Designer of Syncfusion.SfChart.WPF.fr-FR.resx file and change its corresponding value to the corresponding culture.
The following image illustrates the WPF Chart successfully localized in French culture, showing the changes made according to the provided localization steps.
For more details, please refer to the project on GitHub.
Conclusion
I hope you enjoyed learning how to localize labels in WPF Chart control.
You can refer to our WPF Chart Feature Tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Chart Examples to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!