0

I am currently working on an mvc4 application. It needs to be multi lingual so therefore each of my views requires a resource file associated to it.

In the web forms world, I would be creating App_LocalResouces and have the resource files within this for my pages/user controls.

Being new to MVC I am not sure how this works - is it similar. For example for my razor views, where the resource file for the particular view reside. Same with my models and controllers, where does the resource file for such reside?

Robert H
  • 11,520
  • 18
  • 68
  • 110
amateur
  • 43,371
  • 65
  • 192
  • 320

1 Answers1

0

I've seen it done a lot of ways. It's really based on preference. My preference is to create a Resource folder and store the translated strings in one file with the name of the culture. I then set the language in the web.config file and leave it up to the page to pull the correct strings.

Middas
  • 1,862
  • 1
  • 29
  • 44
  • Thanks for this information, could you outline what other ways you have seen it done also. Thanks – amateur Oct 12 '12 at 08:19
  • http://odetocode.com/Blogs/scott/archive/2009/07/16/resource-files-and-asp-net-mvc-projects.aspx explains a great way. – Middas Oct 12 '12 at 16:11
  • You might take a glance at http://stackoverflow.com/questions/1875368/best-practice-for-asp-net-mvc-resource-files as well. – Middas Oct 12 '12 at 16:12