Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC Globalization of Views

I am looking at globalizing an application that I have developed in asp.net mvc.

I am currently using resource files to store messages that I present to the user (i.e., when I save something to the database, and the user is shown the message "The whatever was correctly saved", that text is stored in a resource file so that I can easily localize the message for another language.

The question I have is how to do this in a view as a whole? Right now, I've got some views that are mostly HTML with some small amount of presentation logic.

What is the best practice for localizing a view? I've taken a look here:

  • http://damieng.com/blog/2008/04/27/localizing-mvc-for-aspnet-views-and-master-pages

The approach in that post seems like an interesting way to go, but I wonder how easy it will be to maintain separate views for every language.

NOTE: I have not done much globalization or localization in asp.net generally, so there may be some best practices from the non-mvc world that I am missing.

like image 835
dp. Avatar asked Jan 05 '09 20:01

dp.


1 Answers

We ran into the same problem with our new MVC application and our solution is here. Maintaining separate views could be hard work, but maintaining the same view with different languages appears to be just as difficult, we decided that maintaining the whole view would give us more power, which would be required to make a release for Asian countries.

Hopefully it helps you.

like image 84
Odd Avatar answered Oct 05 '22 06:10

Odd