开发者

Multiple languages in an ASP.NET MVC 3 (Razor) application

In my current project, on the main page I can switch language (FR|NL|UK).

All开发者_JS百科 the texts are in ressources (.resx) files. The language code (FR, NL, UK) I need to use is in myMode.

How can I do to set all the : @HTML.Label( ....)

Thanks,


When you change language you need to change the current UI culture. You also need to track the user language preferences somewhere (route, cookie, session, ...). Here's a nice guide that I would recommend you reading.


I agree with the previous answer, that you have to change the current UI culture. On drop down change, you can store the language in cookie. And then using this cookie you can set the current UI culture. Depending on the culture, the application will pick up text from resource files depending on language selection.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜