Mike Ormond's Blog

Musings on mobile development and Windows Phone 7 in particular.

ASP.NET MVC Localisation

ASP.NET MVC Localisation

  • Comments 1

I mentioned in my Developer Day Scotland session that ASP.NET MVC enjoys the benefits of the underlying ASP.NET platform such as caching, membership, profiles and localization. Guy Smith-Ferrier politely questioned the accuracy of that statement wrt localization (and who am I to argue - Guy knows more about ASP.NET localization than I ever will).

We discussed it over email afterwards and Guy has written up his thoughts on ASP.NET MVC localization on his blog. In fact I’m very comfortable with what I said – and I certainly wasn’t trying to mislead anyone. My point was that the underlying services from ASP.NET are inherited by ASP.NET MVC.

Guy explains in his post that there’s more “manual” work to be done as [a] Visual Studio’s Generate Local Resources function targets ASP.NET server controls (which by and large don’t exist in ASP.NET MVC) so it’s not much use and [b] you need to modify any HTML elements to be HTML server controls (ie add runat=”server”) for ASP.NET localization to target them.

Fair comment. The nature of localization means that we’ve done a lot of work in Visual Studio to take some of the drudgery out of it for ASP.NET webforms and that same capability is not there (not yet at least) for ASP.NET MVC. The platform capability is there, you just have to do more work to make use of it.

A search for “ASP.NET MVC localization” turns up a number of useful articles on the subject (in addition to Guy’s post).

Technorati Tags: ,