views:

1387

answers:

1

We would like to employ satellite assemblies to contain various locale dependent resource files.

Question is ... do we need to link the default culture?

We have a separate project which will contain all of our different culture resource files. As is shown below, we have the project with two resource files inside of it.

ProjRES

  • Resource.resx
  • Resource.it-IT.resx

I am assuming that the "Resource.resx" will act as the default culture and if the Italian culture is selected, the application will adopt the it-IT resource file.

What do we need to do in order to get the rest of the application and projects to access the resource files. How do we set the namespaces for the resource files in order to be able to reference them.

Any help is greatly appreciated.

+1  A: 

Basically,

if the current culture that the OS is using matches a certain culture that you've shipped, it will be used, if the current culture matches none of the cultures you've shipped, it will use the neutral culture.

In the most symplistic cases, you'll just need to include any of the localized dlls with the deployment and all will be fine..

When you're using resource managers, I think you can also pass in which culture you want to use explicitly, and the runtime will search for resources that match - this is better when a user of an ASP.Net site might have a certain culture preference that is different from that of the machine that the site is running on.

http://msdn.microsoft.com/en-us/magazine/cc163609.aspx seems to be a good starting point.

Andrew Theken
thx Andrew .. thats a start. But can the resources be placed into a separate project (assembly) and any project in the solution allowed to access the resources? This was we can separate resources into a single DLL which will manage all projects in the application?
Helios
no need to worry Andrew .. I managed to work it out.basically we can use reflection to load the assembly and then access the appropriate resources in the DLL. So now we can create one DLL to manage locales settings for the entire solution.
Helios