We are developing products that will be used in the following way:
I am already aware of products like RCWinTrans and handling multiple languages in VC++/MFC applications. However, the requirements we are faced with here are more extensive and thus require us to make a few up front decisions that could be difficult to change long term, so ideally we want to make the best choice now.
Based on my own knowledge, I have a few questions although I may be missing some tricks with .net that will be happily received. Here are my questions:
Thanks in Advance,
Roger
Have you considered using an Inversion of Control container like StructureMap or Unity ? That may allow you to keep the default resources together with the project (which IMHO makes most sense), while still allowing a customer to locally override resources as necessary.
As an example, assume you have the following interface:
public interface IResourceSupplier
{
// Returns the localized text for a given identifier.
string Localized(string identifier);
// Returns the invariant (English) text for a given identifier.
string Invariant(string identifier);
}
Using IOC, you could create a centralized resource supplier for the solution which would check for user-supplied overrides. If no user override is provided, then you could query each of the project-specific resource suppliers (detected at application startup) until you locate one which returns the desired resource.
Obviously, depending on your needs you may need to tweak for performance, for example by caching frequently used resources. Using IOC does give the advantage that as long as the interface does not change, plugging in an alternate implementation can be a relatively trivial task.
Does this help?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.