Multiple language resource files inside single assembly

S

scpedicini

Let's say that I've built an assembly called MyApi.dll with two
different language resource files, one called DefaultResource.resx
(which is my english resource file), and a german resource file called
DefaultResource.de.resx. However, I would like both of these files to
live inside MyApi.dll. Inside MyApi.dll, I have a ResourceManager that
is loaded using:

new System.Resources.ResourceManager("MyNamespace.DefaultResource",
Assembly.GetExecutingAssembly());

However, is it possible to make the ResourceManager load the correct
resource file based on the Current UI language ? I was thinking of just
trying to load a resource string called:

string resFile = "MyNamespace.DefaultResource." +
CultureInfo.CurrentUICulture.Name;

If this file does not exist, then the ResourceManager will use the
default DefaultResource. Unfortunately, I cannot make use of satellite
assemblies at this time, so does this seem like a reasonable solution?


Thanks for any assistance,
Shaun
 
N

Nicholas Paldino [.NET/C# MVP]

Shaun,

I don't think it is possible. What I am wondering is, why not use
satellite assemblies?
 

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