)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to localize the WinForms MessageBoxAdv control?

Platform: WinForms |
Control: MessageBoxAdv |
Published Date: February 14, 2017 |
Last Revised Date: January 6, 2020

localization

Localization is the process of making application multilingual by formatting the content according to the cultures. MessageBoxAdv control can be localized in any Languages, based on application requirement by following below steps.

Step 1: Need to initialize the LocalizationProvider class, inherited from ILocalizationProvider Interface, before the InitializeComponent call in the constructor of the application.

Step 2: It will add the GetLocalizedString function in the LocalizationProvider class. In that it is needed to provide the Localization content, for the required components used in MessageBoxAdv control.

 

For example,

Here, MessageBoxAdv control is localized in German Language.

 

C#

LocalizationProvider.Provider = new Localizer();
 
// localizer inherits the interface ILocationProvider
public class Localizer : ILocalizationProvider
{
     #region ILocalizationProvider Members
     public string GetLocalizedString(System.Globalization.CultureInfo culture, string name,object obj)
     {
            switch (name)
            {
                #region MessageBoxAdv
                ///<summary> 
                ///Retry Button in German Language
                ///</summary>
                case ResourceIdentifiers.Retry:
                    return "Wiederholen";
 
                ///<summary>
                ///Abort Button in German Language
               ///</summary>                    
                case ResourceIdentifiers.Abort:
                    return "Abbrechen";
 
                ///<summary>
                ///Ignore Button in German Language 
               ///</summary>                    
                case ResourceIdentifiers.Ignore:
                    return "ignorieren";
                 ///<summary>
          /// default
          ///</summary>
                default:
                    return string.Empty;
                    #endregion
            }
        }
        #endregion
}
//MessageBox show
MessageBoxAdv.Show("Metro Theme Anpassung", "Das ist Syncfusion MessageBoxAdv Control", MessageBoxButtons.AbortRetryIgnore);

VB

LocalizationProvider.Provider = New Localizer()
 
' localizer inherits the interface ILocationProvider
Public Class Localizer Implements ILocalizationProvider
 
#Region "ILocalizationProvider Members"
Public Function GetLocalizedString(ByVal culture As System.Globalization.CultureInfo, ByVal name As String, ByVal obj As Object) As String Implements ILocalizationProvider.GetLocalizedString 
        Select Case name
 '''<summary> 
 '''Retry Button in German Language
 '''</summary>
 Case ResourceIdentifiers.Retry
          Return "Wiederholen"
 
             '''<summary>
 '''Abort Button in German Language
        '''</summary>                    
 Case ResourceIdentifiers.Abort
          Return "Abbrechen"
 '''<summary>
 '''Ignore Button in German Language
 '''</summary>                    
 Case ResourceIdentifiers.Ignore
          Return "ignorieren"
             
             '''<summary>
 ''' default
 '''</summary>
 Case Else
          Return String.Empty
 End Select       
End Function
#End Region
 
'MessageBox show
MessageBoxAdv.Show("Metro Theme Anpassung", "Das ist Syncfusion MessageBoxAdv Control", MessageBoxButtons.AbortRetryIgnore)

 

Screenshot

Localize the MessageBoxAdv control

Figure 1: localization.

 

Samples:

C#: MessageBoxAdvLocalization

VB: MessageBoxAdvLocalization

Reference link: https://help.syncfusion.com/windowsforms/messagebox/localization

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon