Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions MAUI/ListView/localization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
layout: post
title: Localization in .NET MAUI SfListView control | Syncfusion
description: Learn here all about Localization feature of Syncfusion .NET MAUI ListView (SfListView) control and its elements, and more.
platform: MAUI
control: SfListView
documentation: ug
---

# Localization in .NET MAUI ListView (SfListView)

`Localization` is the process of translating the application resources into different languages for specific cultures. The [SfListView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Listview.SfListView.html) 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.

{% tabs %}
{% highlight c# tabtitle="App.xaml.cs" hl_lines="1 3 12 13" %}

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();
}
}
}

{% endhighlight %}
{% endtabs %}

N> The required `resx` files with `Build Action` as `EmbeddedResource` (File name should contain culture code) into the `Resources` folder.

## Localize application level

To localize the `ListView` based on the `CurrentUICulture` using the `resource` files, follow these steps.

1. Create a new folder named `Resources` in the application.

2. Right-click on the `Resources` folder, select `Add`, then click on `NewItem`.

3. 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 as `SfListView.fr-FR.resx` for French culture.

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

![Shows the name of resource file to be added for .NET MAUI ListView](images/localization/maui-listview-shows-the-name-of-resource-file-to-be-added.png)

5. Now, select `Add` option to add the resource file in the **Resources** folder.

![Shows the added resource file for french language in .NET MAUI ListView](images/localization/maui-listview-shows-the-added-resource-file-for-french-language.png)

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

![Shows the added resource file name value pair in the resource designer in.NET MAUI ListView](images/localization/maui-listview-shows-the-added-resource-file-name-value-pair-in-the-resource-designer.png)

![Localized content in .NET MAUI ListView](images/localization/maui-listview-with-localized-content.png)

1 change: 1 addition & 0 deletions maui-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@
<li><a href="/maui/ListView/item-border">Item Border</a></li>
<li><a href="/maui/ListView/right-to-left">Right To Left</a></li>
<li><a href="/maui/ListView/mvvm">Working with MVVM</a></li>
<li><a href="/maui/ListView/localization">Localization</a></li>
</ul>
</li>
<li>
Expand Down