Tuesday, January 27, 2009

Developing Websites in Regional Languages

Recently, I had a couple of queries on how to develop sites in Hindi, Marathi and other regional languages so I thought I will actually blog about it. I have also had questions on whether using images for regional text is the way to go but fortunately, .NET and Windows gives you better and slicker ways of doing this so read on. I am using Windows XP and VS 2008 but the steps should be similar for almost all the Operating Systems.

One of the first things that you need to do if you are developing sites in regional language is to set up your webserver to display this text. This is how you can do it.

Step – I

Go to Start -> Control Panel - > Regional and Language Options

Click Languages Tab and then check the two text boxes. If you are developing sites only in Indian Regional languages, checking the second check box should do.

Step – II

The next step is to add the ability to enter Hindi Text on your machine. This can either be your Development Machine or your web server.

In the same screen click on Details under the Text Services and Input Languages. You are taken to the Text Services and Input Languages Screen. This is the screen where you tell your computer that you wish to add the regional language of your choice as an input mechanism.

Step - III

In your installed services click Add and Select the Language you want to be able to input. This is how your screen will look when you do this. You will see that I have added Hindi.

Another small change that you will probably not notice is in your task bar. On the bottom right you should see EN next to the System tray. Click on that EN and you will see the screen below

Click on Hindi to be able to enter text in Hindi. The easiest way to check this is to open a Word document and type there.

Now we have our system enabled to enter text in Hindi. Its time we move on to our application. As I have said before I am going to use VS 2008 to demonstrate this to you. Open VS 2008 and create a new website. In the Default.aspx page add a calendar control. Open the web.config and add the following tag inside the system.web element

<globalization uiCulture="hi-IN" fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"/>

 Now run the website. If you have done everything right you should see the calendar in Hindi, something like below