From f3de95ce99855cb15e26d8007c8901aaec96c595 Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Wed, 23 Feb 2011 16:47:49 -0500 Subject: Fix translatable strings in ipalib plugins. Needed for xgettext/pygettext processing. --- ipalib/plugable.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 26ce366f3..da02d87f4 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -38,6 +38,7 @@ import errors from config import Env import util import text +from text import _ from base import ReadOnly, NameSpace, lock, islocked, check_name from constants import DEFAULT_CONFIG, FORMAT_STDERR, FORMAT_FILE @@ -181,11 +182,12 @@ class Plugin(ReadOnly): self.bases = tuple( '%s.%s' % (b.__module__, b.__name__) for b in cls.__bases__ ) - self.doc = _(inspect.getdoc(cls)) - if self.doc is None: + doc = inspect.getdoc(cls) + self.doc = _(doc) + if doc is None: self.summary = '<%s>' % self.fullname else: - self.summary = self.doc.split('\n\n', 1)[0] + self.summary = unicode(self.doc).split('\n\n', 1)[0] log = logging.getLogger(self.fullname) for name in ('debug', 'info', 'warning', 'error', 'critical', 'exception'): if hasattr(self, name): -- cgit