Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm using the following lines of code in my project to change the UI languager:

CultureInfo ci = new CultureInfo(""); //invariant culture
ci = new CultureInfo(GetLanguage);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LanguageResource));

 

My language resources are in my main project folder, but I've set up a sub-folder called LanguageResources which I'd like to move them into. First off, when I moved them, the class LanguageResource was preceded by a .LanguageResources namespace above the class declaration, I changed that but I'm still having the problem - on the line to instantiate the ComponentResourceManager, it can't seem to find my base LanguageResouce.resx.

 

How do I tell it to look in a folder for the .resx?

What if the Hokey-Pokey IS what it's all about?
Posted

I think I'm compiling the resources into a DLL,

 

In my project folder I have the LanguageResource.resx and .de.resx, .fr.resx etc.

In the bin/debug folder, I've got de and fr folders containing a .resources.dll

What if the Hokey-Pokey IS what it's all about?
Posted

I started again, this time not renaming the namespace class definition, but instead including it in the line:

System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LanguageResources.LanguageResource));

I then rebuilt and it worked fine.

What if the Hokey-Pokey IS what it's all about?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...