views:

4574

answers:

3

I need help with the best practice to localize asp mvc apps, I saw Oxite having a base method named Localize in the BaseController, but is the Localization a task for the view or the Controller? Or should I use resx files / or use db tables?

+5  A: 

Create your own Html helper and use it like <%= Html.Resource("Name") %>

Details are in blog post.

Ihar Voitka
Just so everyone is aware, the post Ihar links to now has an update. See: http://blog.eworldui.net/post/2008/10/ASPNET-MVC-Simplified-Localization-via-ViewEngines.aspx
Robert Claypool
The updated link doesn't work either. :(
bradjive
A: 

If the string to be localized is generated by the view (eg a label in front of a text field), then its localization should be in the View.

If the string is generated by the Controller, its localization should be there as well.

Paul Lalonde
+2  A: 

There is good solution for this available here

this article covers all aspects of localization asp.net mvc app

Michael Vald