There's a strange problem with the string resources in the Resources.resx file. There's no obvious way that I ever discovered how to create a new resource table for another language with the IDE. It can be done by hand though. Follow these steps:
- Project + Properties, Resource tab,
add the strings you want to use in
your program
- Start Windows Explorer and navigate
to your project's Properties folder
- Copy and paste the Resources.resx
file
- Rename it to the culture you want to
use. For example:
Resources.fr-FR.resx
- Back to VS, click the Show All Files
icon in the Solution Explorer window
- Expand the Properties node, the new
resource file should be visible
- Right-click it and select "Include
in project"
- Select it, in the Properties window
set Custom Tool =
"ResXFileCodeGenerator"
- Verify that Build Action is set to
"Embedded Resource"
Build your program. You should get a new folder in your project's bin\Debug directory with the satellite assembly, named projectname.resources.dll. This satellite assembly contains both the localized strings and any localized resource from the forms. Test that it works with code like this:
public Form1() {
System.Threading.Thread.CurrentThread.CurrentUICulture =
System.Globalization.CultureInfo.GetCultureInfo("fr-FR");
InitializeComponent();
textBox1.Text = Properties.Resources.String1;
}