Table of Contents

Setting up a website for translation of properties files

The problem

Currently I am running a java project which is localized in five languages: spanish, english, portuguese, portuguese (brazilian version), turkish. The literals are kept in properties files, and it's a nightmare to mantain them. The problem is more or less this:

Well, if you have pass among this, or at least you have read the half of this list probably you had realize that technology should help in this process.

The solution: pootle

I've been looking for a solution for this mess for a long time. I've look for applications that can handle the differences between versions of properties files or at least ease the work of introducing the localized versions of the properties files and leverage the work of packing / unpacking the files into Word –for ease the work for the translators–. I've tried many tools, properties files editors, and the like, and I nearly came to the conclusion that there is no free solution available in the market, or at least at a cheap price.

I were nearly giving up when I bumped with Pootle. Pootle has everything I need to keep my translations under control:

Starting with the installation of pootle

In this project I will try to give specific instructions to install and run a project with pootle. And to handle with a translation of the properties files of a java project into various languages. Those who haven't to deal with a thing like that probably will think that there is no real need for an application for that. Hehe..

Software you will need

You have to have installed in your system:

Download the neccessary packages

Look into the installation manual the neccesary packages for install pootle:

http://translate.readthedocs.org/projects/pootle/en/latest/server/installation.html

Install Python easy install

It eases many tasks of installing. Probably you can delete it afterwards if you want to strenghth your security.

rluna@rluna-VirtualBox:~/Descargas$ sudo apt-get install python-setuptools

Install Django

First install Django, because Pootle requires it. You can download it from the project website, https://www.djangoproject.com/

rluna@rluna-VirtualBox:~/Descargas$ tar -xzf Django-1.3.1.tar.gz 
rluna@rluna-VirtualBox:~/Descargas$ cd Django-1.3.1/
rluna@rluna-VirtualBox:~/Descargas/Django-1.3.1$ sudo python setup.py install 

Install translate-toolkit

rluna@rluna-VirtualBox:~/Descargas$ tar -xjf translate-toolkit-1.9.0.tar.bz2
rluna@rluna-VirtualBox:~/Descargas$ cd translate-toolkit-1.9.0/
rluna@rluna-VirtualBox:~/Descargas/translate-toolkit-1.9.0$ sudo python setup.py install

Install lxml

After some seconds, you are ready to install the second package, lxml. This package is now(11/24/2012) available at http://pypi.python.org/pypi/lxml/

root@rluna-VirtualBox:~# tar -xzf lxml-3.0.1.tar.gz
 
root@rluna-VirtualBox:~# sudo python setup.py install

Install pootle

rluna@rluna-VirtualBox:~/Descargas$ tar -xjf Pootle-2.1.6.tar.bz2
rluna@rluna-VirtualBox:~/Descargas$ cd Pootle-2.1.6/
rluna@rluna-VirtualBox:~/Descargas/Pootle-2.1.6$ sudo python setup.py install

Install south

You can easily install south by issuing the command:

apt-get install python-django-south

At least in Ubuntu it works!

Problem found: No such file or directory ''/usr/share/pootle/mo''

It appears that when you are installing in Ubuntu, pootle doesn't follow the usual path for installing itself; instead of using /usr/share/pootle, it installs under /usr/local/share/pootle, hence it fails when running issuing this error:

OSError: [Errno 2] No such file or directory: '/usr/share/pootle/mo'

The easiest way to fix this is to cheat Pootle, installing a symbolic link to the proper directory:

root@rluna-VirtualBox:/usr/local/share# ln -s /usr/local/share/pootle /usr/share/pootle 

Ah!!! Thanks to http://serverfault.com/questions/247333/how-to-setup-pootle-tranlation-server-on-ubuntu who gave me the solution for this nasty error!!!!

Finishing

And that's it: you only have to point to http://localhost:8080 to reach your own copy of pootle.