diff options
Diffstat (limited to 'ipalib/text.py')
-rw-r--r-- | ipalib/text.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/ipalib/text.py b/ipalib/text.py index 0c8684025..07f1b21dd 100644 --- a/ipalib/text.py +++ b/ipalib/text.py @@ -26,10 +26,25 @@ placeholders for the rest of the code. class LazyText(object): - def __init__(self, domain, localedir): + def __init__(self, domain=None, localedir=None): self.domain = domain self.localedir = localedir + def __mod__(self, kw): + return self.__unicode__() % kw + + +class FixMe(LazyText): + def __init__(self, msg): + self.msg = msg + super(FixMe, self).__init__() + + def __repr__(self): + return '%s(%r)' % (self.__class__.__name__, self.msg) + + def __unicode__(self): + return u'<%s>' % self.msg + class Gettext(LazyText): def __init__(self, msg, domain, localedir): @@ -39,8 +54,7 @@ class Gettext(LazyText): def __unicode__(self): return self.msg.decode('utf-8') - def __mod__(self, value): - return self.__unicode__() % value + class NGettext(LazyText): |