I have a Windows Forms application project, and on the main form I have a menu strip. Some place in this menu strip it is possible to select various languages. For example if the user selects "English", everything on this main form (and others in the future) should be turned into English language.
I took this tutorial: click
This works fine with labels and such, but it does not work at all with the tool strip menu items. They just stay with their default text.
I tried to add two more lines to the ChangeLanguage
method:
private void ChangeLanguage(string lang)
{
foreach (Control c in this.Controls)
{
ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
resources.ApplyResources(c, c.Name, new CultureInfo(lang));
ComponentResourceManager res2 = new ComponentResourceManager(typeof(ToolStripMenuItem));
res2.ApplyResources(c, c.Name, new CultureInfo(lang));
}
}
But it fails and says:
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "System.Windows.Forms.ToolStripMenuItem.resources" was correctly embedded or linked into assembly "System.Windows.Forms" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Not sure how to proceed - any help appreciated.