[Kde-i18n-fa] Farsi KDE Translation Mini-HOWTO

Aryan Ameri kde-i18n-fa@mail.kde.org
Tue, 25 Mar 2003 09:34:41 +0200


Hi there:

[Note: This email, as opposed to what I state in the email, doesn't have any 
attachments and any screenshots. That's because The attachments were 700 KB, 
and I couldn't send such a heavy message to the ML. So, if anyone wants these 
screenshots, then please write and email to me, and I will post the 
screenshots directly to him/her. For the time being, I couldn't find a more 
convenient way ]

During the last couple of days, Arash Zeini posted a couple of messages, in 
which, he described the process of how to join the project, and how to start 
translating KDE. His posts where complete, and one could certainly start 
doing his/her job by following Arash's instructions. But as these guidelines 
where scattered among a couple of emails, I guess they made some difficulties 
for a couple of individuals. Therefore I decided to gather them all in one 
place, add some hints and notes to it, and make a mini Howto on the process 
of joining the project and initializing translation. I hope that this mini 
Howto can also be used in the future for other interested enthusiasts. 

A : General Information

First, you should know that in the process of translating the GUI of KDE, we 
use an especial method involving PO ( Portable Object ) files. This method, 
allows easy maintenance, and managability of the translations and the 
project.

B : KDE Requirements

In order to translate, you should first be able to type farsi in KDE. To do 
so, you should atleast have KDE 3.0 with Qt 3.0 installed on your computer. 
Older versions of KDE like 2.2 do not support the farsi language. 
Furthermore, it is highly advised that you use KDE 3.1  instead of 3.0, but 
it is not necessary. RedHat 7.3 and 8.0, Mandrake 9.0 and SuSE 8.1 ( among 
others ) come with KDE 3.0 At the time of this writing, SuSE 8.2 and Manrdake 
9.1 come with KDE 3.1 and RedHat 8.1 hasn't been released yet. If you use 
Debian or Gentoo, then you shall have no problem upgrading to KDE 3.1 with 
advanced tools that Gentoo and Debian offer. You can also compile your own 
KDE on any GNU/Linux - Unix environment.

C: Getting a Font

The next step is to get a Unicode font, capable of showing farsi characters.
A couple of Unicode fonts capable of showing farsi characters are currently 
available, some like clearlyu and newspaper are shipped with all major 
GNU/Linux distros, but are of low quality. The best general purpose Unicode 
font, appears to be Arial Unicode MS. You can get a copy of this font, from 

http://corefonts.sourceforge.net/

( If you get a ttf version of the font, the KDE installer will be able to 
install it. If you get a exe version, then wine is able to easily produce a 
ttf version out of it. You might also try other methods like cabexract to 
install the font)


D : Installing The Font

After making sure that you have the necessary KDE enviroment and Unicode font, 
you shall install the UTF-8 (Unicode ) font. The preferred method for doing 
this, is via KDE's font installer, available in KDE Control Center.  Although 
alternative methods are also available. Here under, are instructions on how 
to install a font in a typical KDE 3.1 If you use KDE 3.0, or your distro has 
changed KDE so much, that many parts are missing ( Like in the case of RedHat 
8.0 ), then you shall modify these steps and adapt them to your own 
situation.  

1. Open KDE Control Center
2. Click on System Administration
3. Click on Font Installer
4. Click on the Administrator mode, to have root previlages
5. Select the font ( e.g Arial Unicode MS ) and the click on install
6. Click on apply and exit from Control Center.

E : Setting Font Globally

After this, you shall be able to select this font, in the font section of any 
KDE application. But in order to globally set your font to this Unicode font, 
follow these steps ( again these are for a typical KDE 3.1 )

1. Go to KDE Control Center
2. Select Apearence and Themes
3. Select Fonts
4. Here, select Arial Unicode MS (or any other Unicode font you have 
installed), as your font for everything, don't be afraid, it's pretty a nice 
font. You may also want to enable anti-alising for nicer viewing ( Caution: 
on some rare situations, anti-alising might cause problems, do this at your 
own risk).

F : Changing/Getting The Farsi Keyboard Layout

The next step is to setup the Farsi keyboard layout. If you have XFree86 
version 4.2 or any later version, a Farsi keyboard layout will come with your 
X windows system. However, the Farsi keyboard which comes with XFree86 is not 
fully functional, e.g it doesn't have Farsi numbers. Therefore, YOU MUST 
CHANGE this keyboard layout. You can get a functional farsi keyboard layout 
from 

http://www.farsikde.org/downloads/ir

save this file as 'ir' without any extension to the file name. Then place this 
file in  /etc/X11/xkb/symbols/ There should already be a file in this 
directory with the name 'ir'. You shall replace that file, with this new one 
which you downloaded from the internet. If you don't currently have a file 
named 'ir' in that directory, then you shall either recompile XFree86 to add 
farsi support to it, or you shall upgrade your XFree86. After doing the 
neccessary steps, and placing the new 'ir' file in the specified directory, 
restart your X Windows System.

G : Enableing Farsi Keyboard Layout

At this point you will have the Farsi keyboard. To enable Farsi Keyboard 
Layout, do the following: (again, These are for a typical KDE 3.1 system)

1. Go to KDE Control Center
2. select Accessibility and Regional
3. Select Keyboard Layout
4. In the top of the screen, enable keyboard layouts
5. Then either as your primary layout, or as a secondary layout, select Farsi 
(Iranian in KDE 3.0 )
6. Select the Options Tab
7. In the last drop down menu, choose:
Alt-Shift Changes Group ( You may also try other combinations, but my 
experience shows that this is convenient ) 

You can change your primary keyboard layout with your secondary layout using 
the Ctrl-Alt-K combination. 
when Farsi is your keyboard, you can use Alt-Shift to change between Farsi and 
English keyboard. Currently, you shall be able to write in KEdit, KMail, 
KBabel and KOffice (1.2.1) 


H : Setting up Farsi Interface (Optional)

This step is not necessary for translation, but if you have KDE 3.1, then 
you might also be interested in having the Farsi interface, to get a feeling 
of what the end product looks like (This is not available in KDE 3.0). In 
order to get the Farsi interface in KDE 3.1, you shall first, get the Farsi 
translation package. You can get this package from

ftp.kde.org/pub/kde/stable/3.1/src/kde-i18n/kde-i18n-fa-3.1.tar.bzip2

Debian Woody i386 binary package can be found at
ftp.kde.org/pub/kde/stable/3.1/Debian/dists/woody/main/binary-i386/kde/kde-i18n/kde-i18n-fa_3.1.1-0woody1_all.deb

and Debian Woody Power PC binary package can be found at 
ftp.kde.org/pub/kde/stable/3.1/Debian/dists/woody/main/binary-powerpc/kde/kde-i18n/kde-i18n-fa_3.1.1-0woody1_all.deb

Note: At the time of this writing, RPM based GNU/Linux vendors like SuSE and 
RedHat haven't provided RPM for the Farsi KDE package. But installing the 
source bzip2 package shouldn't be a hassle for anyone.

After installing this package, follow these steps

1. Go to KDE Control Center
2. Select Accessibility and Regional
3. Select Country/Languageand Region
4. Click on "Add language"
5. If you have installed the farsi package, you should have farsi in your list
6. Select Farsi, and move it to the top of your list.
7. Click Apply, and then logout of  KDE and restart it.

I : Setting up CVS

Now, you have a fully functional farsi environment at your command. You can 
start the translation job. First, you shall, get the KDE files, and the 
already translated farsi files. in order to do so, the KDE project and it's 
subprojects like Farsi KDE use the CVS scheme. You should already have CVS 
installed as most major GNU/Linux distros come with CVS. However, if you 
don't have it then shame on you :-) first install it and then using any text 
editor like emacs or vi, create a file named .cvsrc in your home directory. 
This file should contain the following lines:

	cvs -z4 -q
	diff -u3 -p
	update -dP
	checkout -P 

J : Getting files via CVS

1. Now that you have CVS installed, you shall get the files using it. For the 
first time ( and only for the first time ) Follow these steps: 

1. make a directory in your home directory. Let's call this KDE. In my case, 
this directory's full path will be /home/aryan/KDE

2. Now issue this command

export CVSROOT=:pserver:anonymous@anoncvs.kde.org:/home/kde

3. Now issue this command

cvs login

and if there is a question about password, just hit enter in it's response. 
4. Now change your directory to the one you just created (cd /home/aryan/KDE) 

5. and issue the following commands one after another, to get files:

cvs co kde-i18n/templates/cupsdconf.pot
cvs co kde-i18n/templates/desktop_kde-i18n.pot
cvs co kde-i18n/templates/desktop_kdelibs.pot
cvs co kde-i18n/templates/kabc_dir.pot
cvs co kde-i18n/templates/kabc_ldap.pot
cvs co kde-i18n/templates/kabc_net.pot
cvs co kde-i18n/templates/kabc_sql.pot
cvs co kde-i18n/templates/kabcformat_binary.pot
cvs co kde-i18n/templates/katepart.pot
cvs co kde-i18n/templates/kdelibs.pot
cvs co kde-i18n/templates/kmcop.pot
cvs co kde-i18n/templates/knotify.pot
cvs co kde-i18n/templates/ktexteditor_insertfile.pot
cvs co kde-i18n/templates/ktexteditor_isearch.pot
cvs co kde-i18n/templates/ktexteditor_kdatatool.pot
cvs co kde-i18n/templates/libkscreensaver.pot
cvs co kde-i18n/templates/ppdtranslations.pot
cvs co kde-i18n/templates/timezones.pot
cvs co kde-i18n/templates/kdebase/
cvs co kde-i18n/templates/koffice/
cvs co kde-i18n/templates/kdenetwork/
cvs co kde-i18n/templates/kdemultimedia/
cvs co kde-i18n/fa/messages/


K : Updating CVS Repository

Now that you have the files, you shouldn't repeat the above process anymore. 
But it would be wise to update your CVS database from time to time. in order 
to update the cvs, you shall just go to your KDE directory (cd 
/home/aryan/KDE) and then issue the following commands:

export CVSROOT=:pserver:anonymous@anoncvs.kde.org:/home/kde
cvs login
cvs up
 
you are advised to atleast update your cvs repository, once a day.

HINT: If you do not work with any other project which uses CVS, then using a 
text editor like emacs or vi, you can open your .bashrc file, which is in 
your home directory ( in my case /home/aryan/.bashrc) and put this line, 
somewhere in that file

export CVSROOT=:pserver:anonymous@anoncvs.kde.org:/home/kde

After that, whenever you want to update your repository, you shouldn't need to 
enter this command anymore, and just 
cd /home/aryan/KDE
cvs login
cvs up
will take care of the updating job.

L : Setting up KBabel

Now, You have the files, and you should start translating. In order to 
translate, the KDE project has developed the KBabel application, which is an 
advance PO editor. KBabel has tree main components, the catalog manager, 
which offers an overview of the translation process, the translation tool, 
which is the main component, and translation is done via this component, and 
the dictionary, which is a component, that enables translators to search 
already translated strings, and thus, use consistent translations. With the 
help of screenshots, I will here provide enough guideline on howto configure 
KBabel. I will also briefly describe using KBabel, and conventions used in 
the Farsi translation. 

The latest version of KBabel, is Version 1.0, but version 0.96 has also been 
tested and it works. To configure KBabel, I will provide some screenshots, 
and these screenshots show version 1.0, but if you are too timid to upgrade, 
you may opt for version 9.96

1. Open KBabel Catalog Manager
2. Click on Settings and then "configure KBabel Catalog Manager"
3. configure it, according to the attached file, 
"Kbabel-Catalog-Manager-1.jpeg"

Now, in order to configure KBabel Translation tool:
1. Open KBabel Translation Tool
2. Click on Settings, and then on "Configure KBabel"
3. You shall configure KBabel according 
to screenshots "KBabel-Translation-Tool-?.jpeg

After this, You shall configure KBabel Dictionary. KBabel Dictionary is a very 
helpfull tool for translators to check each other's translations, and make 
their translations consistent. It has two general modes, the translation 
database mode, and the PO Compendium Mode. My experience shows that 
translation database is far more efficient and much more faster, in 
searching. However, some distros, (Like RedHat) have changed KBabel and 
removed the translation database tool. In my screenshot and examples, I will 
document howto setup the translation database. If you don't have Translation 
database available, and only have PO Compendium, then you either have to 
upgrade your KBabel, or learn how to use the internet based PO Compendium. 

To setup KBabel Dictionary

1. Open Kbabel Dictionary
2. In main section (left side), in the search in Module, select "Translation 
Database"
2. In The settings section (right side), in the Generic tab, choose Search in 
Whole database.
3. In the settings section, in the Database tab, enter your database directory 
( for example in my case it is /home/aryan/KDE/kde-i18n/fa/messages/ ) and 
then click on "Scan directories and Subdirectories" 

After that, you may search for a string, either in English or in Farsi in the 
left section, and you will get the result. You can also use the search 
feature, directly from inside KBabel Translation Tool. Screen shots 
"KBabel-Dictionary-?.jpeg" will guide you trough this process.


M : Final Notes and Conventions

Everything should now be in place. You can start viewing Catalog Manager, and 
when you double click on a file name, that file will be opened in the 
translation tool, then you can translate your files, and send them to 
a.zeini@farsikde.org It is advised that you send your files at the end of 
each day to him, so that he can commit them to the CVS.

It is important to spend some time to find the right word and get a feeling
for the translation rather than just translating. We have to make sure that
we all use the same word for "File" and other entries that we encounter in
different places.

With regard to punctuation, please note that we use the following scheme:

 word, next word. That means always make sure you have a word"comma" "space"
 "next word""period"
 Never use: word , next word .

It is really important to Build a database of the already translated strings, 
and use it as frequently as possible. If you face a string, and you are not 
sure how to translate it, and you can't find it in the database, then you can 
always ask from the list, about the translation of that string. And also 
please take a look at some already translated files, to have a feeling of how 
the translation is done. 

Please also NEVER use Parentheses (). They cause some real problems, and we 
are currently in the process of removing them. So please don't use '()' in 
your translations.

KBabel has many nice features, that will help you in the translation process. 
e.g if you face a string, which you have problem translating, you can mark it 
as fuzzy, and later review fuzzy messages, and also you might send the file 
to others, and they will try to solve those fuzzy messages. Also remember, 
that KBabel determines strings which have syntax problems, so always try and 
check wether your translation has syntax problems or not. In general, every 
translator should review his/her file, before sending it to Arash Zeini.

Last but not least, If anything is unclear, and if you face any problems, 
please don't hesitate asking questions from the list.

Cheers

-- 


/* Those who do not understand Unix 
 *are condemned to reinvent it, poorly */
                                         -UNDEAD Evil GNU/Linux
Aryan Ameri