HelpBot Assistant

How can I help you?

Localization in .NET MAUI Color Picker (SfColorPicker)

26 Jun 20251 minute to read

Localization is the process of translating the application resources into different languages for specific cultures. The SfColorPicker can be localized by adding resource file.

Setting CurrentUICulture to the application

The application’s culture can be changed by setting CurrentUICulture in the App.xaml.cs file.

using Syncfusion.Maui.Inputs;
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 : //SfColorPickerResources.ResourceManager = new ResourceManager
      // ("ColorPickerLocalization.Resources.SfColorPicker", Application.Current.GetType().Assembly);

		SfColorPickerResources.ResourceManager = new ResourceManager(ResXPath, Application.Current.GetType().Assembly);
	}
}

.NET MAUI Color Picker localization

NOTE

Ensure that the required resx files are included with Build Action set as EmbeddedResource, and the file name contains the culture code, within the Resources folder.

Localize application level

To localize the Color Picker based on CurrentUICulture using resource files, follow the steps below:

First we need to add the default resource file of Color Picker into Resources folder of the application.

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

  2. In the Add New Item wizard, select the Resources File option and name the file as SfColorPicker.<culture name>.resx. For example, name it SfColorPicker.fr-FR.resx for the French culture.

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

resource-file-name

  1. Click the Add option to add the resource file to the Resources folder.

resources-folder

  1. Add the Name/Value pair in the Resource Designer of the SfColorPicker.fr-FR.resx file and change its corresponding value to match the corresponding culture.

resource-file-name-value-pair