Starting with the internationalization bla bla (Part Two)

27. December 2006 10:50 by Mrojas in General  //  Tags:   //   Comments (0)
Ok enough theory. To start using the internationalization stuff lets start with a simple Form.

Open  the Visual Studio IDE. And Start a Windows Forms project. And then create a simple Form. Add some labels and buttons and set their captions. Once you do that and finish the initial creation of the form, go to the properties pane and change the Localizable property to true and assign the desired value in the Language property. The Visual Studio designer will save the changes in additional resource files whose names will look like <FormName>.<culture>.resx

Once you finish the texts, sizes, positions for the first culture and save it. The IDE creates the resource file for that culture. If you want to create a resource file for another language just change the Form property and assign the text for this new language.

 

You can not only assign personalized translations for each region but also the position and size of components. This is useful because in some languages the buttons might need to be bigger because the labels could be bigger.

 

All this work is supported by the .NET resource managers. System.Resources.ResourceManager class.

 

I recommend you also using String Resource Tools like the ones at: http://www.codeplex.com/ResourceRefactoring

 

These tools makes it even easier the task of moving all your strings to resource files: