开发者

ASP.NET MVC+ multilingual page

开发者 https://www.devze.com 2022-12-14 15:04 出处:网络
I\'m developing a website using ASP.NET MVC. The website should handle multiple languages. I would like to ask what are the best practices of hand开发者_如何转开发ling multiple languagues - both for

I'm developing a website using ASP.NET MVC. The website should handle multiple languages. I would like to ask what are the best practices of hand开发者_如何转开发ling multiple languagues - both for "static" texts and taken from DB. I read some threads about this on stackoverflow but i'm not sure how can I implement in when data from DB are received. I also read this article


Well, if you need to localize your web application then you can't really use any "static" text. The article link you included talks about using resource files. While this does work in ASP.Net MVC it means that everything in your view pages will have to be an ASP.Net Literal control and you have to push ALL of your textual content into the .RES file and not put any of it in your view pages.

If you have a lot of users from different cultures then using the .RES files will be the way to go. If you have the majority of your users all in one language and just a small percentage in a different language then you may be able to take advantage of Microsoft’s translation engine. You just embed some JavaScript in your page and Microsoft will translate the page’s text for you.

0

精彩评论

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

关注公众号