CodeManiac
CodeManiac

Reputation: 1014

store localized string in resx file?

I am using visual studio 2010 and I create the two resx file and input the localized string in resx file by opening it in visual studio. Here, I want to dynamically input the localized string name and it's value from Html form so that I don't have frequently re-publish the application if I have to add new localized string. Can we store the localized string to resx file like we do in database by inputing it's name and value from form user input?

Upvotes: 0

Views: 242

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039578

No, you can't. The resx files are compiled into the resulting assembly and cannot be modified at runtime. Older ASP.NET models where the application was not precompiled allowed this by publishing the resx files. ASP.NET MVC uses a web application model which is precompiled. You will have to consider using a different storage for that. For example you could write a custom resource provider that will read the values from a database. The process is described in details in the following article on MSDN.

Upvotes: 1

Related Questions