I have a case that I have to get the language defined by admin. I know how to do language supported web sites such as http://www.codeproject.com/Articles/163215/Dynamic-definition-of-the-list-of-available-langua
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(language);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);
}
but the consumer wants to define the language so he doesnt need me to change the source code everytime he wants to add a new language. I have been searching but reached to nothing. Could anyone give me any idea how to do that?
You can build your own ResourceExpressionBuilder that stores key/value/language information in a database table. You can then provide interface in the administration to add languages and update values based on this database table. The expression builder will allow you to use the same syntax for localization as with the built in resource files. It is not a fast and easy solution though. It takes time to implement this.
Alternatively you can teach the customer to create resource files and deploy them on the server. This should not require compilation.
Here is an example on how to override the resource manager. You can also create your own expression http://msdn.microsoft.com/en-us/library/aa905797.aspx
http://msdn.microsoft.com/en-us/library/system.web.compilation.resourceexpressionbuilder.aspx