Articles in this section
Category / Section

How to localize the labels in Xamarin.Forms Chart?

1 min read

You can set localization for SfChart in all the platforms by adding a .resx file in a .NET Standard project alone. The following steps describe how to set localization for SfChart in a project and you can download the complete sample here.

  1. Add a new folder in the .NET Standard project named Resources.
  2. Add resource files for the languages you wish to support and set their Build Action to EmbeddedResource. The name of the resource file should be $name of the Syncfusion component$+$language code$+.resx. For example, if you add a resource file for French culture. Then, add the Syncfusion.SfChart.XForms.fr-FR.resx file to Resources folder as illustrated in the following screenshot.

A screenshot describing the addition of resource file to a project in Xamarin.Forms

 

 

 

 

 

 

 

 

 

 

 

 

  1. Provide French values for each key in the respective .resx files. Here, “Close” and “High” are the keys, and “Fermer” and “Haute” are their respective French values.

French translation words given for English words in .resx file

Note:

Here, resources have been already created for some cultures and shared them on the Syncfusion GitHub for your convenience.

  1. Set the resource manager to ‘ChartResourceManager.Manager’ to get the resource manager from the user as illustrated in the following code sample. For more details, please click here.

C#:

ChartResourceManager.Manager = new ResourceManager("GettingStarted.Resources.Syncfusion.SfChart.XForms", Application.Current.GetType().Assembly);

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied