2
votes

I am developing a WinForm application which require localization. If I try to set the Localizable property of the form to True and set the text for all the languages then every thing works fine.

What I want is to maintain all languages resource files in a separate folder (one file for each form).

-Project
   -Resources
      -Language
          frmFirstForm.en-US.resx
          frmFirstForm.en-GB.resx
          frmSecondForm.en-US.resx
          frmSecondForm.en-GB.resx
   frmFirst.cs
   frmSecond.cs

In my resource file I have defined all strings as follows:

**Key              Value**
lblName          Name
lblAddress       Address
.....

The key is my control names, I will also keep form specific strings in the resource files. Now the issue is when I compile the solution, it do generate the language files but while running the application it just displays the default values. I don't even know whether the localized resource file is loaded or not. Also, though I have specified two separate form files but while compiling the system is generating only one single resource file per language for a project (means no separate resource file for FirstForm and SecondForm).

Is there any way where the form controls are changed as per the specified localized thread?

I have already added the following line in my main application Program.cs file:

Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB");
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

Please suggest me how to proceed with this..

1
Unless you write words like "colour", you are not going to see an enormous difference between en-GB and en-US. If you want to test it then just use a bogus word in en-GB.Hans Passant
@HansPassant: I am already using different strings for both the resource files..my apologies for not describing this at first stage..Ashish Sharma
You are using non-standard locations for the .resx files, always unwise to try to trip up the build system like that. Check that the satellite assemblies are being generated.Hans Passant
Yes Satellite Assemblies are being generated in the respective folder en-US and en-GB under debug..Ashish Sharma

1 Answers

0
votes

@Ashish : this is what you want exactly!!!!