Localization in .NET MAUI ListView (SfListView)
18 Jun 20262 minutes to read
Localization is the process of translating the application resources into different languages for specific cultures. The SfListView can be localized by adding a resource file.
Setting CurrentUICulture to the application
Application culture can be changed by setting the CurrentUICulture in the App.xaml.cs file.
using Syncfusion.Maui.ListView;
using System.Globalization;
using System.Resources;
namespace MauiListView
{
public partial class App : Application
{
public App()
{
InitializeComponent();
CultureInfo.CurrentUICulture = new CultureInfo("fr-FR");
SfListViewResources.ResourceManager = new ResourceManager("MauiListView.Resources.SfListView", 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 ListView based on the CurrentUICulture using the resource files, follow these steps.
-
Create a new folder named
Resourcesin the application. -
Right-click on the
Resourcesfolder, selectAdd, then click onNewItem. -
In the Add New Item wizard, select the Resource File option and name the filename as
SfListView.<culture name>.resx. For example, give the name asSfListView.fr-FR.resxfor French culture. -
The culture name indicates the name of the language and country.
!Syncfusion .NET MAUI ListView Shows the name of resource file to be added
- Now, select
Addoption to add the resource file in the Resources folder.

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

