Are resx files the right way to configure for different clients?

I am considering setting up different pieces of text in the application for different clients. It seems that .resx resources would be a smart way to do this. However, all the literature for resx that I come across seems to be related to the localization of language differences (like in English, French, Spanish, etc.), so I just want to check that this is the best, which is just for differences between customers in the text.

And, presumably, he could also deal with different languages ​​for different clients, for example:

CustomerA.resx CustomerA.en-US.resx CustomerA.de-DE.resx CustomerB.resx CustomerB.en-US.resx CustomerB.de-DE.resx ... etc 

Is resx a way to make a difference in customers?

+4
source share
3 answers

You can use them to store different lines for each client - it will work. I assume that you do not have a large number of clients for service, and they do not require that the rows be changed very often. Otherwise, managing multiple files can be a real pain.

Storing rows for each client in the database (with caching) may be the best option, especially if you want clients to change their rows.

+2
source

I would not configure this option for each client, as you indicate if you need to load CustomerCA or CustomerB resources? Resx are suitable for localizing languages, but if you want to have different texts for different clients, I would probably read the rows from the database table that will initially contain default values, and then you adjust the values ​​in the client-specific database.

+2
source

Yes, with resx files you can do what you need. You can use custom cultures to achieve this. Please see How to download various RESX files based on some parameter .

+1
source

Source: https://habr.com/ru/post/1342794/


All Articles