by July 9, 2003 0 comments



A lot of people say that Linux can have a good future in India if it’s translated to various Indian languages. Interestingly, this job is not technical but tedious and cumbersome. Imagine having to translate each line of the interface, of every package in Linux to different Indian languages and you’ll understand the volume of effort required. There are a lot of non-profit organizations on this job. In this article, we talk about the basics of translating Linux to the language you want, Hindi in this case. 

To do this, we used the fonts and keymaps provided by Indlinux and a multilanguage text editor called
yudit. 

Translating the pot file with Yudit

To start, first copy the yudit-2.7.2.tar.gz file from this month’s PCQ Essentials CD to your home directory and run the following commands to install it:

#tar -zxvf yudit-2.7.2.tar.gz 
#cd yudit-2.7.2
#./configure
#make && make install

Next, install the IndLinux Opentype fonts and keymaps by copying the fontsnkmap.tar.gz directory to your machine and then running the following commands:

#tar -zxvf fontsnkmap.tar.gz 
#cd fontsnkmap
#sh install.sh

Now run yudit from Xwindows by starting a terminal and writing the following command on it:

#yudit

Redhat-config-xFree86 in Hindi

A window will pop up. Now open the menu Available Kmap and select KMap Setup from it. After that, add the Devanagari-phonetic KMap. This KMap will be allotted a function key with which you can change the other KMaps while typing. The function key will be written to the left of the
KMap. 

In this case we are going to translate the redhat-config-xfree86 package (used to configure Xserver). For this, first open the .pot file of the package in yudit. Now set your Kmap to devanagari-phoentic and the font to TrueType. The .pot file is a portable object template that’s either found in the source of any package or can be created by using the xgettext command.

This file is used to create a .po (portable object) file, which will contain the original text that appears in the interface of any package along with its translation. The original text will appear under a variable called msgid, while the translated part will appear under msgstr. So in a .po file you will find msgid and msgstr corresponding to a source having a file name and line number. The top of the file contains details about the file, its last modified date and Content Type. After opening the file in yudit, enter “text/plane; charset=UTF-8\n” in front the Content Type variable on top of the file. Now comes the main part.

One by one read the value of msgid and enter the translated value in Hindi in the msgstr variable and finally save it with the .po extension, as shown in the figure. 

This .pot file is a small one containing about 330 lines that need to be translated. There are hundreds of these files that need to be translated, one for each package. So you can realize what a mammoth task this would be. So don’t try doing it alone rather join a group that’s already on the job. We talked about some of these groups in the PCQ Insight booklet in May 2003 (free with PCQuest May 2003 issue). 

Finally comes the checking and deploying part. First, you have to convert the newly created .po file to .mo (machine object) file. This is basically a compiled binary file that can be understood by the system. To do so, run the following command:

#msgfmt

This command will create a file called message.mo. To test the file, first change the global variable LANG by typing the following command:

#export LANG=hi_IN.UTF-8 

Then copy the message.mo file to the folder /usr/share/local/hi/LC_ MESSAGES as redhat-config-xfree86.mo. Restart your XServer and run redhat-config-xfree86. You will see something like the screenshot on the left. 

Anindya Roy

No Comments so far

Jump into a conversation

No Comments Yet!

You can be the one to start a conversation.

<