From 8c46e09735d076e9689d04936cdeeca6dfd770d3 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 19 Feb 2010 09:08:16 -0700 Subject: Translatable Param.label, Param.doc --- ipalib/text.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'ipalib/text.py') diff --git a/ipalib/text.py b/ipalib/text.py index 07f1b21dd..cabca438e 100644 --- a/ipalib/text.py +++ b/ipalib/text.py @@ -34,28 +34,25 @@ class LazyText(object): 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): + def __init__(self, msg, domain=None, localedir=None): self.msg = msg super(Gettext, self).__init__(domain, localedir) def __unicode__(self): return self.msg.decode('utf-8') + def __repr__(self): + return '%s(%r)' % (self.__class__.__name__, self.msg) + + def __json__(self): + return self.__unicode__() +class FixMe(Gettext): + def __unicode__(self): + return u'<%s>' % self.msg + class NGettext(LazyText): def __init__(self, singular, plural, domain, localedir): -- cgit