diff options
author | Pavel Zuna <pzuna@redhat.com> | 2011-02-21 14:54:05 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-03-01 10:31:42 -0500 |
commit | fc842e36504d39221fbfdafbaf8996b63e20de57 (patch) | |
tree | c8e32bca1ea95a27194c571c9e30821f9eb4dbfb /ipalib/plugable.py | |
parent | 18dda28c563770730837e2b771a0acdc2e849158 (diff) | |
download | freeipa-fc842e36504d39221fbfdafbaf8996b63e20de57.tar.gz freeipa-fc842e36504d39221fbfdafbaf8996b63e20de57.tar.xz freeipa-fc842e36504d39221fbfdafbaf8996b63e20de57.zip |
Use pygettext to generate translatable strings from plugin files.
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
systems gets docstrings from modules for this to work.
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r-- | ipalib/plugable.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index da02d87f4..92e6392ae 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -182,9 +182,8 @@ class Plugin(ReadOnly): self.bases = tuple( '%s.%s' % (b.__module__, b.__name__) for b in cls.__bases__ ) - doc = inspect.getdoc(cls) - self.doc = _(doc) - if doc is None: + self.doc = _(cls.__doc__) + if self.doc is None: self.summary = '<%s>' % self.fullname else: self.summary = unicode(self.doc).split('\n\n', 1)[0] |