Rebranding application resources in .NET 2.0

I'm going to start writing a tool in .NET 2.0 (C #), and the tool needs to be renamed in order to be sold for use by other companies. We collect the tool in the house with other company resources so that they do not receive the source, but only the generated output.

Since remarketing will use the same language by default, how do you manage multiple resources for the same set of languages ​​without doing something messy, for example, replacing resx files with scripts during build or something even crazier ( and more error prone), such as using en-US for client A, en-CA for clients B, en-GB for clients C, etc.

+4
source share
3 answers

The route that I decided to go is to have the TextOverrides class. This class provides 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 possible if the number of extra text elements remains small.

+1
source

In our project, we found that the easiest way was to have branding in your own DLL, which is then dynamically loaded through reflection. If necessary, there are two obvious approaches to localizing any branding:

  • Replace DLL branding with another that has been localized
  • Use the satellite assembly method supported by .NET.

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

+3
source
+1
source

All Articles