[Freeipa-devel] [PATCH] Use pygettext to generate translatable strings from plugin files.

Jakub Hrozek jhrozek at redhat.com
Tue Feb 22 21:34:05 UTC 2011


On Mon, Feb 21, 2011 at 04:12:31PM +0100, Pavel Zůna wrote:
> 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?
> ============
> 
> 1)
> First, apply all of the localization patches found in thread
> "Localization patches" on freeipa-devel. Then apply this patch.
> 
> 2)
> Regenerate your install/po/Makefile:
> - delete install/po/Makefile
> - run `./configure` in install
> 
> 3)
> Regenerate the pot and po files:
> - run `make update-pot` in install/po
> - run `make update-po` in install/po

I noticed that none of the .po files is regenerated when we run make
dist. Is that intentional? I think that all the released tarballs should
contain up-to-date translations.

> 
> 4)
> 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.
> 
> 5)
> 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.
> 

./configure --datadir=/usr/share

My buildscript contains a variation of "rpm -E %configure".




More information about the Freeipa-devel mailing list