Chapter 5. Make the translations for a simple kde project

When your own project is finished, you may like to have one or several translations for the GUI. Here is how you can do that.

First install a gettext patched for kde

Install a patched gettext that you can find on developer.kde.org and install it in your home directory. The patched gettext can be found there : http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/

 $ tar xvzf gettext-0.10.35-kde.tar.gz
 $ cd gettext-0.10.35-kde
 $ ./configure
 $ make
 $ mkdir -p ~/bin
 $ cp src/gettext src/xgettext ~/bin # copy gettext and xgettext into your HOME/bin directory
 $ export PATH=~/bin:$PATH
 

Prepare the translations

Then, go into your project directory :

 $ cd /path/to/myproject
 
Set KDEDIR to match your kde installation - on my Mandrake it is /usr This path can also be found by doing "kde-config --prefix"
 $ export KDEDIR=`kde-config --prefix` # or export KDEDIR=/usr
 
Then create the translations files :
 $ make -f admin/Makefile.common package-messages
 

Make the translations

Translate the .po files using kbabel These files are in the po directory of your project.

Warning

Do not touch the .pot file!

Compile and install the translations files

 $ make package-messages
 $ sudo make install
 

Reference

Please see the original version of this chapter here, thanks to Thomas Nagy.