davioooh
davioooh

Reputation: 24706

Internationalization in ASP.NET MVC application

I'm going to develop an ASP.NET MVC web-app and I'm new to this framework. I usually develop web application on Java platform using Spring MVC as web framework.

I need to implement internationalization in my new application but I can't find a standard approach to achieve this using ASP.NET MVC.

In Spring I usually have several properties files for all the languages supported: messages_en.properties, messages_it.properties, etc. and I use a key-value approach to access the right message in the file:

mainPage.title=The title # in messages_en.properties

mainPage.title=Il titolo # in messages_it.properties

Is there something similar in .NET platform? Or is there any other "standard" way to implement i18n?

Upvotes: 1

Views: 1493

Answers (2)

chris
chris

Reputation: 111

ASP.NET uses Resource files to store various strings etc.... and each resource file can contain different language versions accessed using a key, similar to how you work now.

I would advise reading this blog which explains in good detail how to implement this across models, views and controllers:

http://afana.me/post/aspnet-mvc-internationalization.aspx

Upvotes: 1

wheeler
wheeler

Reputation: 687

You can achieve this with Resources. Its the same simple key => value approach as in Spring, where you have a Resource File for each language.

Upvotes: 1

Related Questions