I have a string resource file called "strings.resx" in my VB.NET project, defined as an embedded resource. I have another file called strings.es.resx
, which contains all of the same strings in Spanish. I'm loading the resource at runtime using the following code:
MyStrings = New ResourceManager("myprog.strings", GetType(MainForm).Assembly)
I've set the language locale to Espanol in Windows and logged back in, but I'm still getting the English string resources loading when the above is executed. How can I load the spanish resources if the Windows locale is ES? I was expecting it to be handled automatically.
Take a look at the
System.Threading.Thread.CurrentThread.CurrentUICulture
property - it has a habit of being fixed to en-US.If it is, try setting it to the same as
CurrentCulture
.Update
Since that didn't work, check that the the output folder of your application has an
es
folder, inside which is a dll called strings.resources.dll. If not, then, basically, the resource manager is not finding the culture-specific string resource, because it's not there, in which case copy them in and it should work.