Localization of Syncfusion UWP controls

18 Oct 20192 minutes to read

Localization is the process of translating the application resources into different language for the specific cultures. You can localize the syncfusion UWP controls by adding resource file for each language.

Changing application culture

When you are changing the application culture, then you can localize the application based on application culture by creating .resw file.

public sealed partial class MainPage
{
    public MainPage()
    {
        CultureInfo.CurrentUICulture = new CultureInfo("de");
        this.InitializeComponent();
    }
}
Public NotInheritable Partial Class MainPage
	Public Sub New()
		CultureInfo.CurrentUICulture = New CultureInfo("de")
		Me.InitializeComponent()
	End Sub
End Class

Creating .resw files

You can create .resw files for any language by following steps,

NOTE

You can get the default resource files of all Syncfusion UWP libraries from GitHub.

1) Right click your project and add new folder named Resources.

2) Add default resource files of libraries you are using into Resources folder.

NOTE

Consider you are using SfDataGrid control in your application. Then you need to copy and include Syncfusion.SfGrid.UWP.Resources.resw (since SfDataGrid present in Syncfusion.SfGrid.UWP library) file in your application under Resources folder. So, now you can know the key names and values of default strings used in Syncfusion.SfGrid.UWP.dll library.

UWP datagrid Localization

3) Now, right click Resources folder and select Add and then New Item. In Add New Item wizard, select the Resources File option and name the file name as Syncfusion.SfGrid.UWP.Resources.<culture name>.resw. For example, you have to give name as Syncfusion.SfDataGrid.UWP.Resources.de.resw for German culture. In the same way, add new resource files for other libraries used in your application.

adding resource file in UWP control

4) Now, select Add and add resource file for German culture in Resources folder.

UWP control localization using .resw file

5) Now, you can copy the key names and from default resource files and assign value based on the culture, the resource file targets.

UWP datagrid localized .resw file

NOTE

Download demo link from GitHub.

Editing default culture strings

You can change the default string of any control by adding the default .resw files (from GitHub) to Resources folder of your application. Syncfusion UWP controls reads the default string from the .resw files of application if its added.