hazjack
hazjack

Reputation: 1715

How to customize .net resource files for different customer?

I have an asp.net mvc application which uses Resx files for different languages. The files are existing in Web project and another one service layer.

I want now to customize some labels for specific customer (they have accounts and login to our web app). Is it possible to to archive with less code change?

Have reached some articles like below but switch to use database seems require much work.

It seems using a custom resource provider to load customer based resx files could help but the difficulty I am thinking of is:

Upvotes: 3

Views: 1192

Answers (1)

hazjack
hazjack

Reputation: 1715

So well I have a solution working ! (based on the post from Afana), code change should be very less (create xml files, run ResourceBuilder.exe).

What I did customize is just little:

  • Modify the ResourceBuilder to generate all keys in a partial class
  • Manually create Resources.provider.cs which instantiates XmlResourceProvider for individual customer or accepts default xml resource

enter image description here

Upvotes: 2

Related Questions