开发者

Localizing Static Text asp.net mvc3.What is the approach?

Learning asp.net mvc and I am building a small website that will be initially in 2 languages.

10 or more pages are static pages with bold bits etc...

What is the best approach for localising these pages?

Is there a way to do it without creating a page for language that would be a no in my book.

How do you handle localisation of static pages in asp.net mvc? In asp.net there was some sort o开发者_开发百科f localise control.

Any suggestions?


The way to do this is using resource files. You create an resource file for your default language and then one for each other language your site should run in.

This article describes how to do it. For example if you want english (default) and french you could create two resource files (.resx files) Website.resx and Website.fr-FR.resx. The first file for your default language, which is english and the second file for french. Both files exists from a key-value pair.

EDIT: Another interresting article describing the same idea can be found here.


I think that the best approach is still creating two files for them, cause they are not static pages forever, they may change in future,

Or you can generalize the solution and save the text in database for those two languages and render the correct content base on the selected culture.

They can be saved in the sense that they are pages on newsroom, whenever you add a news you enter the text for both cultures.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜