Localization in .NET MAUI Cartesian Chart
10 Jul 20262 minutes to read
Localization is the process of translating the application resources into different languages for the specific cultures. The SfCartesianChart can be localized by adding resource file.
NOTE
Prerequisite: Ensure that the required NuGet package is installed, the necessary namespaces are imported, and the SfCartesianChart control is properly configured in your application. For detailed setup and configuration instructions, refer to the Getting Started guide.
Setting CurrentUICulture to the application
Application culture can be changed by setting CurrentUICulture. in App.xaml.cs file.
using Syncfusion.Maui.Charts;
using System.Resources;
public partial class App : Application
{
public App()
{
InitializeComponent();
CultureInfo.CurrentUICulture = new CultureInfo("fr-FR");
// ResXPath => Full path of the resx file; For example :
//SfCartesianChartResources.ResourceManager = new ResourceManager
// ("CartesianChartSample.Resources.SfCartesianChart", Application.Current.GetType().Assembly);
var ResXPath= "CartesianChartSample.Resources.SfCartesianChart";
SfCartesianChartResources.ResourceManager = new ResourceManager(ResXPath, Application.Current.GetType().Assembly);
MainPage = new MainPage();
}
}NOTE
The required
resxfiles withBuild ActionasEmbeddedResource(File name should contain culture code) into theResourcesfolder.
Localize application level
To localize the Chart based on CurrentUICulture using resource files, follow the below steps.
-
Right-click on the
Resourcesfolder, selectAddand thenNew Item. -
In Add New Item, select the Resource File option and name the filename as
SfCartesianChart.<culture name>.resx. For example, give the name asSfCartesianChart.fr-FR.resxfor French culture. -
The culture name indicates the name of the language and country.

- Now, select
Addoption to add the resource file in Resources folder.

- Add the Name/Value pair in Resource Designer of
SfCartesianChart.fr-FR.resxfile and change its corresponding value to corresponding culture.

Here, you can see how localization was performed for the tooltip.
