User Tools

Site Tools


projects:mypootleproject

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:

  • The development team made the initial version of the spanish properties file. Up to this point everything were fine.
  • With this file, I (with the help of other coworkers) made the translations into the rest of the languages. Here the problems begun, because we had to pack the properties files into word files –the translators were auditors–, wait to their answer and then move the translation back into the properties files again, being vigilant about the parameters {0} of the texts, the equal signs and things like that. So far, so good.
  • The development team made changes in the spanish properties file. Here started the nightmare, because we had to calculate the difference between the old version and the new version –sending again the whole files were not an option because of the size–, and again packing in and packing back the properties files into word. Don't forget to use UTF-8 files (unicode) when dealing with text files. native2ascii to an fro and things like that.
  • The development team made changes again in the spanish properties file, and then sent it back to us without signaling the slightest difference among versions. This is the time to pry God for more patient or a shotgun. Well, the last the better.

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:

  • It is web based, so there is only one repository for the translations
  • It can run may projects
  • It doesn't require for the translators to install complex applications: with a web browser is enough
  • It can manage the Java properties files

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:

  • Mysql
  • Python
  • Apache

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.

projects/mypootleproject.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1