Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

best way to multi-language asp.net mvc 3

I'm trying to create a asp.net mvc3 project for a academic project, and one of the requirements is it has to be able to change between different languages. Currently what i have is the following:

I have a external project that works as a repository for languages and for each view i have an interface for each view that defines all the "placeholders" do define all the changeable text. At the beginning of any action i obtain the language that is in the uri (something like /{lng}/{command}/{action}) and pass it to the view using the ViewBag, once inside the view i user the repository to obtain the current implementation of the interface for that view in the chosen language.

I can't find any good topic on this mater. I'm just curios if there is a better way to do this and more efficient. And how is it normally done in a professional level. I'm not very experienced with asp.net just started learning it about a month ago.

Also if it's important i am using the razor engine for the views, and we can't use any JavaScript in this phase of the project.

like image 230
Hugo Alves Avatar asked Feb 03 '23 11:02

Hugo Alves


1 Answers

You may go through the following guide.

like image 136
Darin Dimitrov Avatar answered Feb 14 '23 15:02

Darin Dimitrov