Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Multilingual Website in asp.net MVC?

I don't understand where to put the Resources and how can we take the value from that?

like image 245
SAHIL SINGLA Avatar asked Dec 06 '25 06:12

SAHIL SINGLA


1 Answers

You put all of your language resources into a resource (.resx) file. You will essentially have one resource file per language, but will all the same "Name" items, with their respective "Values" - 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

You can then use these resources all over your application.

In views:

<%= MyResource.Welcome %>

For more detail on localisation in general, visit these:

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

like image 56
Fenton Avatar answered Dec 08 '25 22:12

Fenton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!