Category / Section
How to localize the context menu items in WinForms TabbedMDIManager?
1 min read
Localize the context menu
You can localize the Context menu items in TabbedMDIManager by using the ILocalizationProvider interface.
C#
// Invoking Localizer class provide localization LocalizationProvider.Provider = new Localizer(); //Localization class class Localizer:ILocalizationProvider { public string GetLocalizedString(System.Globalization.CultureInfo culture, string name, object obj) { switch (name) { case ToolsResourceIdentifiers.NewHorzGroupMenuItemText: return "Customized HorizontalGroup"; case ToolsResourceIdentifiers.NewVertGroupMenuItemText: return "Customized VerticalGroup"; case ToolsResourceIdentifiers.CloseMenuItemText: return "Customizd Closemenu"; case ToolsResourceIdentifiers.MoveNextMenuItemText: return "Customized Next"; case ToolsResourceIdentifiers.MovePrevMenuItemText: return "Customized Previous"; case ToolsResourceIdentifiers.CancelMenuItemText: return "Customized Cancel"; default: return string.Empty; } } }
VB
'Invoking Localizer class provide localization LocalizationProvider.Provider = New Localizer() 'Localization class Class Localizer Implements ILocalizationProvider Public Function GetLocalizedString(ByVal culture As System.Globalization.CultureInfo, ByVal name As String, ByVal obj As Object) As String Implements Syncfusion.Windows.Forms.ILocalizationProvider.GetLocalizedString Select Case name Case ToolsResourceIdentifiers.NewHorzGroupMenuItemText Return "Customized HorizontalGroup" Case ToolsResourceIdentifiers.NewVertGroupMenuItemText Return "Customized VerticalGroup" Case ToolsResourceIdentifiers.CloseMenuItemText Return "Customizd Closemenu" Case ToolsResourceIdentifiers.MoveNextMenuItemText Return "Customized Next" Case ToolsResourceIdentifiers.MovePrevMenuItemText Return "Customized Previous" Case ToolsResourceIdentifiers.CancelMenuItemText Return "Customized Cancel" Case Else Return String.Empty End Select End Function End Class
The following screenshots illustrate the output.
Figure 1: Context menu when creating to new group
Figure 2: Context menu when moves to next group
Figure 3: Context menu when moves to previous group
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/Localization-1860417411.zip