Skip to content

Commit a54a57a

Browse files
ES-975464 - Resolve the ReadMe issue in this sample repository
1 parent 099bfda commit a54a57a

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
1-
# Localization in winUI DataGrid (SfDataGrid)
1+
# Localization in WinUI DataGrid (SfDataGrid)
22

3-
This repository contains sample which shows localization of Syncfusion WinUI DataGrid.
4-
https://help.syncfusion.com/winui/localization
3+
This repository contains sample which shows [localization](https://help.syncfusion.com/winui/localization) of Syncfusion WinUI DataGrid (SfDataGrid).
54

6-
![Localized WinUI DataGrid](Localization_Image.png)
5+
Localization is the process of making an application multilingual by formatting the content according to the languages. This involves configuring the application for a specific language.
6+
7+
### Changing application language
8+
9+
The application language can be changed by setting the desired language to the `ApplicationLanguages.PrimaryLanguageOverride` property in the constructor of the main window. Localization can be done while changing the application language by creating a .resw file.
10+
11+
``` csharp
12+
public sealed partial class MainWindow : Window
13+
{
14+
public MainWindow()
15+
{
16+
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "de";
17+
this.InitializeComponent();
18+
}
19+
}
20+
```
21+
22+
The following screenshot illustrates how the localization is applied to the datagrid based on the defined language to the `ApplicationLanguages.PrimaryLanguageOverride` property.
23+
24+
### Creating .resw files
25+
26+
The following steps can be used to generate .resw files for any language:
27+
28+
1. Right-click the project and add a New folder named as “Resources”.
29+
30+
2. Add another folder and name the folder with “language name”. For example, “de” for German language. Find the supported culture codes from [here](https://docs.microsoft.com/en-us/windows/uwp/app-resources/how-rms-matches-lang-tags).
31+
32+
3. Add [default resource files](https://github.com/syncfusion/winui-controls-localization-resource-files) in the following structure.
33+
34+
4. Now, the key names from default resource files can be defined and assigned values based on language.
35+
36+
![Localized WinUI DataGrid](Localization_Image.png)

0 commit comments

Comments
 (0)