How to make a multilingual website in asp.net MVC?

I donโ€™t understand where to put the resources and how can we extract value from this?

+3
source share
1 answer

You put all your language resources in a resource file (.resx). You will essentially have one resource file for each language, but you will still have the same "Name" elements with their corresponding "Signs" - for example ...

MyResource.resx (this will be the default)
Name: Welcome
Value: Welcome

MyResource.de-de.resx  (this will be used for German text)
Name: Welcome
Value: Wilkommen

Then you can use these resources throughout your application.

In the views:

<%= MyResource.Welcome %>

For more information about localization in general, see below:

http://www.eworldui.net/blog/post/2008/05/ASPNET-MVC---Localization.aspx

+6
source

Source: https://habr.com/ru/post/1740418/


All Articles