开发者

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?


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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜