views:

79

answers:

3

I'm about to start writing a tool in .NET 2.0 (C#), and the tool needs to be re-brandable to be sold for use by other companies. We'll compile the tool in house, with other company's resources, so they don't get the source, just the generated output.

Since the re-branding will use the same default language, how do you manage multiple resources for the same language set without doing something sleazy like swapping out resx files with scripts at build time, or something even sleazier (and more error prone) like using en-US for customer A, en-CA for customer B, en-GB for customer C, etc.

+1  A: 

You can try using Satellite Assemblies.

http://msdn.microsoft.com/en-us/library/21a15yht(VS.80).aspx

Robert Harvey
+3  A: 

We found on our project that the simplest route was to have the branding in its own DLL which is then loaded dynamically through reflection. If required, there are two obvious approaches to localizing any branding:

  1. Replace the branding DLL with another that has been localized
  2. Use the satellite assembly technique supported by .NET

Option 1 is much easier, in my opinion but both are feasible. Of course, there are other approaches to localization.

Jeff Yates
A: 

The route I've decided to go is to have an TextOverrides class. This class exposes a bunch of properties such as:

public static string ProductName
{
  get
  {
    #if <companyNameA>
      return Properties.Resources.ProductName_CompanyNameA;
    #elif <companyNameB>
      return Properties.Resources.ProductName_CompanyNameB;
    #else
      return Properties.Resources.ProductName;
    #endif
  }
}

This is only feasible if the number of overriden text items remains small.

BrianH