i have seen people localize their form using resource. put text data in resource file and show those text data in windows form apps fetch from resource file. but my requirement is different that when my apps will on any pc and that pc language is set Germany or french then all control caption of my apps will be shown in that language. how could i do this….what code i need to write. i need to write very minimum code to implement it.
static int Main( string[] argv )
{
CultureInfo ci = CultureInfo.InstalledUICulture ;
Console.WriteLine("Default Language Info:" ) ;
Console.WriteLine("* Name: {0}" , ci.Name ) ;
Console.WriteLine("* Display Name: {0}" , ci.DisplayName ) ;
Console.WriteLine("* English Name: {0}" , ci.EnglishName ) ;
Console.WriteLine("* 2-letter ISO Name: {0}" , ci.TwoLetterISOLanguageName ) ;
Console.WriteLine("* 3-letter ISO Name: {0}" , ci.ThreeLetterISOLanguageName ) ;
Console.WriteLine("* 3-letter Win32 API Name: {0}" , ci.ThreeLetterWindowsLanguageName
) ;
return 0 ;
}
the above way i can get current language set of the OS. please discuss this issue in details. thanks
Visual Studio contains a localization feature. You design the form in the default language (for example English) and then, in the form’s properties, you can set the “Localizable” property to
trueand select another language to translate to.After you’ve selected the language, you change the captions to the respective language. Then you select another language, change the captions, etc.
Please note: Only add new controls or remove controls in the default language – otherwise the control will not be shown for other translations!
The selection which language will be shown is then made by the .NET framework.
The same applies to resource files as well – to localize a .resx file, create a copy and rename it to match the locale (for example:
resources.DE.resx) and add it to the project.As Daryal said in his comment, further information can be found here.