diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2010-02-19 09:08:16 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2010-02-24 02:47:39 -0700 |
commit | 8c46e09735d076e9689d04936cdeeca6dfd770d3 (patch) | |
tree | 6d4c04028c21ae068f5dfde2357308035693c50c /ipalib/text.py | |
parent | edf243d83a9c22a19d6dece035865f88d86cacb2 (diff) | |
download | freeipa-8c46e09735d076e9689d04936cdeeca6dfd770d3.tar.gz freeipa-8c46e09735d076e9689d04936cdeeca6dfd770d3.tar.xz freeipa-8c46e09735d076e9689d04936cdeeca6dfd770d3.zip |
Translatable Param.label, Param.doc
Diffstat (limited to 'ipalib/text.py')
-rw-r--r-- | ipalib/text.py | 23 |
1 files changed, 10 insertions, 13 deletions
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): |