Skip to content

Commit 07304c6

Browse files
ES-975464 - Addressed the concerns
1 parent e8da480 commit 07304c6

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

AddedCustomResourceFile.png

24.2 KB
Loading

AddingCustomResourceFile.png

56 KB
Loading

CustomResourceFileWithValue.png

62.4 KB
Loading

DefaultResourceFile.png

20.9 KB
Loading

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# WinForms DataGrid Localization
1+
# How to Apply Localization for WinForms DataGrid?
22

33
This repository contains sample which shows localization of Syncfusion [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid).
44

5-
6-
You can [localize](https://help.syncfusion.com/windowsforms/localization#localize-syncfusion-windows-forms-control-using-resx-file) the `WinForms DataGrid` by adding resource file for each language.
5+
You can [localize](https://help.syncfusion.com/windowsforms/localization#localize-syncfusion-windows-forms-control-using-resx-file) the `DataGrid` by adding resource file for each language.
76

87
### Changing application culture
98

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

11+
#### C#
12+
1213
``` csharp
1314
public partial class Form1 : Form
1415
{
@@ -21,6 +22,19 @@ public partial class Form1 : Form
2122
}
2223
```
2324

25+
#### VB
26+
27+
``` vb
28+
Partial Public Class Form1
29+
Inherits Form
30+
Public Sub New()
31+
Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("de-DE")
32+
Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("de-DE")
33+
InitializeComponent()
34+
End Sub
35+
End Class
36+
```
37+
2438
### Creating .resx files
2539

2640
You can create .resx files for any languages by following steps,
@@ -29,8 +43,16 @@ You can create .resx files for any languages by following steps,
2943

3044
2. Add [Windows Forms Control Localization default resource files](https://github.com/syncfusion/winforms-controls-localization-resx-files) of libraries you are using into `Resources` folder.
3145

46+
![Included default resource file in the application](DefaultResourceFile.png)
47+
3248
3. Now, right click on `Resources` folder and select `Add` and then `New Item`. In the `Add New Item wizard`, select Resources File option and name the file name as `Syncfusion.SfDataGrid.WinForms.<culture name>.resx` for German culture. For example, you have to give name as `Syncfusion.SfDataGrid.WinForms.de-DE.resx` for `German` culture. In the same way, add new resource files for other libraries used in your application.
3349

50+
![Adding custom resource file in the application](AddingCustomResourceFile.png)
51+
3452
4. Now, select Add and add resource file for `German` culture in `Resources` folder.
3553

36-
5. Now, you can copy the key names from default resource files and change its corresponding value based on the culture.
54+
![Included custom resource file in the application](AddedCustomResourceFile.png)
55+
56+
5. Now, you can copy the key names from default resource files and change its corresponding value based on the culture.
57+
58+
![Key Values updated based on the culture](CustomResourceFileWithValue.png)

0 commit comments

Comments
 (0)