TL;DR
Are resource files just for language translations, or can they be used for other variables?
I have an application which will be deployed onto multiple servers with different configuration settings for each.
For example my configuration has:
<add key="AppMode" value="CompanyA"/>
At the moment I do something like:
@{
string companyName;
switch(AppMode){
case: "CompanyA":
companyName= "Company A";
break;
case: "CompanyB":
companyName= "Company B";
break;
case: "CompanyC":
companyName= "Company C";
break;
}
}
<h1>@companyName</h1>
This sort of logic is littered across the application for various things. Site Logo path etc..
In the past I've used Localization .resx
files to store different translations.
Can/Should I use .resx
files for different application modes?
For example I could have:
- Resources.companya.resx
- Resources.companyb.resx
- Resources.companyc.resx
Is this an acceptable, best practice, use of .resx
files, or are they purely for languages?