This goes on top of my other localization patches!

This patch replaces xgettext with a custom pygettext to generate translatable strings from plugin files in ipalib/plugins. pygettext was modified to handle plural forms (credit goes to Jan Hendrik Goellner) and had some bugs fixed by myself. We only use it for plugins, because it's the only place where we need to extract docstrings for the built-in help system.

I also had to make some changes to the way the built-in documentation system gets docstrings from modules for this to work.

How to test?

First, apply all of the localization patches found in thread "Localization patches" on freeipa-devel. Then apply this patch.

Regenerate your install/po/Makefile:
- delete install/po/Makefile
- run `./configure` in install

Regenerate the pot and po files:
- run `make update-pot` in install/po
- run `make update-po` in install/po

Make a change to one of the translations:
- example: add translation to the ACI docstring
  * find docstring for ACI in install/po/es.po
  * change the corresponding msgstr "" to
    msgstr "\nBuenos dias, amigos!\n"

Note: if the translatable string begins with \n, the translation also needs to begin with \n. Same goes for ending.

Install the modified translations:
- run `make install` in install/po

Note: I had some problems with this and had to make rpms and install IPA from beginning for it to work. Looks like doing `make install` manually updates /usr/local/share/locale instead of /usr/share/locale, but maybe I just did something wrong.

Set language to Spanish or whatever translation you modified:
- example:
  * # LANG="es_ES.utf8"
    # export LANG

Display the translated documentation:
- example:
  * # ipa help aci
    Buenos dias, amigos!


Attachment: freeipa-pzuna-83-pygettext.patch
Description: application/mbox

Freeipa-devel mailing list

Reply via email to