zaterdag, februari 10, 2007
ASP.NET: Multilingual site
I've been going back and forth on whether I want to build a multilingual site. It is just so much more work. In the end, I decided to make the complete site capable of handling multiple languages. It will make a better, more accessible project on one hand, but take a lot more time on the other hand to complete it.
My reasoning is that especially anything that touches learning should be as close as possible to the learner, and preferably in his or her own language. One of the barriers to e-learning today is still the lack of non-English content for many topics.
DECISION: about2findout.com will be capable of handling multiple languages. During the beta, I will develop for English and Dutch only. Later on other languages might or might not be added, but at least the project will never have to be rewritten to support other languages in the future.
So how did I do it? First, start with a video tutorial here. Then read this article.
Q: What are locales and cultures? What is Culture and UICulture? A: A browser uses a specific notation to identify the language and regional settings to use. For example nl means Dutch, en means English, fr means French. That just identifies the language. That is not enough to localise an application, because some settings such as date format and currency depend also on the specific place. That is called 'locale' and has two extra characters. So nl-BE for example is Dutch in Belgium, en-US is English/United States and fr-FR is French in France. Users can set their language preferences in their browsers (for IE: Internet Options and Languages button). In ASP.NET you can let the application automatically take the language of the browser preference by specifying the globalisation "auto" tab in the web.config file for UICulture and Culture properties. And you can manually overwrite the language settings with the InitialiseCulture method of a page.
The Culture and UICulture settings are stored in the Profile (see one of the previous posts). I also have a language selection menu at the top of the master page, created with a DrowDownExtender control from the Ajax Control Toolkit.
My reasoning is that especially anything that touches learning should be as close as possible to the learner, and preferably in his or her own language. One of the barriers to e-learning today is still the lack of non-English content for many topics.
DECISION: about2findout.com will be capable of handling multiple languages. During the beta, I will develop for English and Dutch only. Later on other languages might or might not be added, but at least the project will never have to be rewritten to support other languages in the future.

So how did I do it? First, start with a video tutorial here. Then read this article.
Q: What are locales and cultures? What is Culture and UICulture? A: A browser uses a specific notation to identify the language and regional settings to use. For example nl means Dutch, en means English, fr means French. That just identifies the language. That is not enough to localise an application, because some settings such as date format and currency depend also on the specific place. That is called 'locale' and has two extra characters. So nl-BE for example is Dutch in Belgium, en-US is English/United States and fr-FR is French in France. Users can set their language preferences in their browsers (for IE: Internet Options and Languages button). In ASP.NET you can let the application automatically take the language of the browser preference by specifying the globalisation "auto" tab in the web.config file for UICulture and Culture properties. And you can manually overwrite the language settings with the InitialiseCulture method of a page.
The Culture and UICulture settings are stored in the Profile (see one of the previous posts). I also have a language selection menu at the top of the master page, created with a DrowDownExtender control from the Ajax Control Toolkit.
Labels: asp.net

