This is my first time trying to localize, so bear with me. I've read up on it, but am still dealing with limited experience in the subject.
I've gone through a demo and have it working fine and I feel like I understand what happens behind the scenes. I moved the same concepts into my actual application, and it will not work. I've set the Localizable property to true and created an English and French resource file.
I've confirmed that my application is still pulling from the regular .resx file instead of en-US.resx or the French one.
I've tried setting these before the InitializeComponent call:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
I've even tried to call a few particular ones explicitly:
resources.ApplyResources(this, "$this", new CultureInfo("en-US"));
resources gets declared as:
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(myForm));
It all still pulls from the .resx file. One difference in this over my test project is that this form inherits from another, but I have made sure to set that form's Localizable property and resource files as well. Any ideas would be appreciated.
EDIT: I've still been working on this. I have a test project that works and my main application that does not. If I copy over the form that works in the the test over to the main, it does not work. If I add a reference to the main app in my test, the form from the main app also does not work even though it is straight copied from the test that works. Any ideas?
EDIT: It seems like the main difference/issue is that the basic project that is working is an executable by itself while my main application is calling an assembly with this localized form in it. Still no idea what is wrong. A lot of the tutorials I am seeing use System.Resources.ResourceManager, but when I change the form to localizable it auto-uses System.ComponentModel.ComponentResourceManager.
EDIT: I can literally say
resources.ApplyResources(this, "$this", new CultureInfo("fr-CA"));
and it will ignore the $this.Text in the .fr-CA.resx file and use the default .resx file instead. I Don't Understand. And that is just me trying to FORCE it to work. I still need to just set the culture like normal. Does anyone have any ideas?