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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to localize Windows Forms controls using Satellite Assemblies?

You can localize the WinForms control by following the given steps.

  1. The neutral resources of every WinForms component are present in the localization folder of each component’s source code. For the Tools package, the resources are present in the following path, assuming that C:\Program Files\ is the installation path for the Syncfusion components:

 

Tools.Windows:

C:\Program Files\Syncfusion\Essential Studio<version>\Windows\Tools.Windows\Localization\

              

Shared.Base:

C:\Program Files\Syncfusion\Essential Studio<version>\Base\Shared.Base\Localization

 

  1. In the NeutralResources folder, there are four resource files corresponding to the Tools package. These resources contain the string representations for the English (default and neutral) culture.

 

  1. Microsoft Visual Studio.NET provides a tool, Resource Editor (ResEditor) that can be used to localize the string resources. It provides a graphic interface that allows you to construct resource files containing bitmaps, icons, and strings. The following figure shows how the Resource Editor looks when it is first opened.

 

               

             

  Figure 1: Resource Editor

 

 

  1. By using the Resource Editor, open the resource file named Syncfusion.Windows.Forms.Tools.SR.resources present in the NeutralResources folder. The file is opened in the ResEditor as shown in the following image.

 

              

             Figure 2: Resource file               

  1. After opening the resource file in the Resource Editor, start entering the equivalent strings for the required culture. In this example, German is used. In the following figure, all the English strings are replaced by their German equivalent. For instance, the German equivalent of Close is & Schließen.

 

Figure 3: Strings in German

        

 

  1. In ResEditor, Click File > Save As and save the file. The file is saved as Syncfusion.Windows.Forms.Tools.SR.de-DE. You can save it as per your wish.

 

 

  1. Repeat the process for other resources, and save it. Now, in the Visual Studio.NET Command Prompt, enter the following command and press Enter. Make sure that you have the sf.publicsnk file from the localization folder.

Tools.Windows

al /t:lib /culture:de-DE /out: Syncfusion.Tools.Windows.resources.dll /v:2.0.0.0 /delay+ /keyf: sf.publicsnk /embed:Syncfusion.Windows.Forms.Tools.SR.de-DE.resources

 

 

 

 

Figure 4: Visual studio command prompt

Shared.Base

al /t:lib /culture:de-DE /out: Syncfusion.Shared.Base.resources.dll /v:1.1.0.0 /delay+ /keyf: sf.publicsnk /embed: Syncfusion.Windows.Forms.Localization.SR.de-DE

 

 

  1. The version you specify for these DLLs in the al command should be based on the SatelliteContractVersionAttribute setting in the product AssemblyInfo. This also means that when a new version of the product is released (with a newer assembly version), you have to recreate (adding new resources, when available or necessary), and recompile your resource DLLs with a new version (in case the SatelliteContractVersionAttribute has changed).

 

  1. On successful execution, an assembly file named Syncfusion.Tools.Windows.resources.dll is created.

 

  1. Finally, mark this satellite DLL for verification skipping (since it is not signed with the same strong-name as the product assembly). To do this, enter the following code in the Visual Studio command prompt snVr Syncfusion.Tools.Windows.resources.dll.

Figure 5: Satellite DLL for verification skipping

 

  1. Drop this DLL into an appropriate sub-directory under yours. EXE’s directory (bin\Debug), based on the naming conventions enforced in .NET. You should put it in the de-DE sub-directory in case this DLL contains resources from the German (Germany) culture.

 

  1. Finally, you should make your application fetch the German resources during run time. The following sample code does that. To change the UI culture of the current thread, add this code in the Forms constructor before the InitializeComponent ().

 

           C#

Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE");

 

 

  1. Now, run your application containing the Syncfusion Toolbar and Menu controls. The localization is applied to the Syncfusion controls as shown in the following images.

 

Figure 6: Localization in GroupBar

 

Figure 7: Localization in MainFrameBarManager

 

Figure 8: Localization in Customization dialog box


Figure 9: Localization in DockingManager

 

Sample Links:

C#: How to Localize WinForm controls C#

 

VB: How to Localize WinForm controls VB

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5506 10/23/2015 03/30/2016 WinForms General
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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