internationalization website
I am use this example to internationalize my website.
The admin can create new topics in English, and I want to show the same topic in Spanish.
How can this be done?
it isn't s开发者_运维百科tandars works like Register or other to do that
Html.ActionLink(Resources.Register, "Register")
The admin can create topics - this means that content is dynamic, therefore you can't use resources files any longer. You should structure your database to support localization. Then you would have to read language locale from thread that's currently being executed.
Additionally, you may let user to select his language. In this scenario you will store selected language in a session and retrieve localized data from the database based on language locale in the session.
Finally you can write code to read first default language in a web browser. For example, change your language to hungarian in a web browser and go to google, see what happens.
You should use Localization and Globalization, take a look at http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx
精彩评论