Localization issue...

C

Christer

Hi all,

I have been searching this group for an answer, but all responses
seems lead to the same conclusion as I would expect. So even if my
small resource-test is made up of code snippets from the
documentation, I'm still not getting the result I expect.

Here's the setup:

In my windows forms project I have the following files:

Application top node
- Resources (folder)
--- Labels.resources (made with resgen from resx, build action is
"Embedded resource")
--- Labes.en.resources (made with resgen from resx, build action is
"Embedded resource")

I try to access these resources in the following manner:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
ResourceManager rm;
rm = new ResourceManager("[toplevel namespace].Resources.Labels",
this.GetType().Assembly);
MessageBox.Show(rm.GetString("gnu"));

But whether I set the CurrentUICulture or not, the result is the same.
I only get the specified string from Labels.resources. I would expect
the code above to give me the string defined in Labels.en.resources. I
have also tried with a more specific UI culture (en-US), but the
result is the same...

Am I missing something?

Thanks in advance!
Christer
 
C

Christer

Correction of typo:

The file that should match the "en" culture is called
Labels.en.resources. That was just a typo by me when writing the
post...

Thanks in advance...
Christer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top