Support
Contribute
Contact
Tracker
Navigation
Personal tools
 

Translating Enlightenment


The Enlightenment translation system uses a collection of ".po" files created using the gettext standard and located in SVN e/po.

Gettext works by extracting a series of crafted strings form the source code files into a ".pot" (translation template file) that will be used later to create the ".po" files for each language.


Contents

Creating the .pot files

In order for your translation to be up to date, you will need updated ".pot" files. Pot files are created automatically when you run autogen.sh, still, if you have the urge of running the command manually just follow the instructions.


Enlightenment's .pot

From the root enlightenment source dir (e) run the following command.

xgettext -C --foreign-user -k -k_ -kd_ -o enlightenment.pot `find . -name "*.[ch]" -print`

Don't forget to add the option -p /path/to/output if you want to change the output directory.


Module's .pot

From the root of the module you want to translate run the following command.

xgettext -C --foreign-user -kD_ -o module_name.pot `find . -name "*.[ch]" -print`

Don't forget to add the option -p /path/to/output if you want to change the output directory, and change -o module_name.pot for a unique name to avoid overwriting other translatins.

Merging translations

If there is a ".po" file for your language that you wish to update, or if you just want to regionalize a general ".po" file (like es_LA.po), you should run the following command to avoid work duplication:

msgmerge -o updated.pot e/po/es.po /path/to/enlightenment.pot

Don't forget to change e/po/es.po to the ".po" file you wish to update, "enlightenment.pot" should be the ".pot" file create previously.

The output file will be "updated.pot" and it will be saved in your current working directory.

Beginning the Translation

Once you have the updated ".po" file, you can begin making the changes you wish by using a plain text editor or one of the following alternatives.

  • poEdit is a cross-platform gettext catalogs editor built with the wxWidgets toolkit.
  • KBabel is a set of tools for editing and managing gettext PO files built around the Qt/Kde toolkits.
  • gtranslator an enhanced gettext po file editor for GNOME.

Test your Translation

When your translation is (almost) complete, you may want to test it. First you have to build the ".mo"-file. This file contents the translation in a binary form, which is actually used by the application (here enlightenment). To build the binary file use the programm msgfmt.

msgfmt es.po -o enlightenment.mo

And the copy this file in the path $(PREFIX)/share/locale/YOUR_LANGUAGE/LC_MESSAGES/enlightenment.mo

Here an example for a spanish translation:

sudo cp enlightenment.mo /e17/opt/share/locale/es/LC_MESSAGES/enlightenment.mo

Be sure that you have your environment set to use your language and restart enlightenment. Now enlightenment should use your new translation.

Share your Translation

If you are satisfied with your translation, you can share it with other e-users. Just send the ".po"-file to the intl mailing list and your translation will hopefully be added to enlightenment.