开发者

How to make Multilingual Website in asp.net MVC?

开发者 https://www.devze.com 2022-12-25 23:57 出处:网络
I don\'t understand where to put the Resources and how can we take the value开发者_开发问答 from that?You put all of your language resources into a resource (.resx) file. You will essentially have one

I don't understand where to put the Resources and how can we take the value开发者_开发问答 from that?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号