|
|
|
NavigationPersonal tools |
Translating Enlightenment
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.
[edit] Creating the .pot filesIn 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.
[edit] Enlightenment's .potFrom 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
[edit] Module's .potFrom 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 [edit] Merging translationsIf 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. [edit] Beginning the TranslationOnce 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.
[edit] Test your TranslationWhen 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. [edit] Share your TranslationIf 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. |