Package ldaptor :: Package apps :: Package webui :: Module nevow_i18n :: Class Translator
[show private | hide private]
[frames | no frames]

Type Translator

object --+
         |
        Translator


A gettext-like Translator for Nevow.

The major difference between this and naive gettext is that with Translator, the actual translation is done as part of Nevow's flattening process, allowing per-user settings to be retrieved via the context.
Method Summary
  __init__(self, **kw)
Initialize.
PlaceHolder __call__(self, original, **kw)
Translate a string.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
NoneType args: keyword arguments to pass to translator.
NoneType translator: The actual translation function to use.

Method Details

__init__(self, **kw)
(Constructor)

Initialize.
Parameters:
kw - keyword arguments for the translator function.
Keyword Parameters:
translator - The translator function to use.
Overrides:
__builtin__.object.__init__

__call__(self, original, **kw)
(Call operator)

Translate a string.
Parameters:
original - string to translate
           (type=basestr)
kw - keyword arguments for the translator. Arguments given here will override the ones given at initialization.
Returns:
a placeholder that will be translated when flattened.
           (type=PlaceHolder)

Instance Variable Details

args

keyword arguments to pass to translator.
Type:
NoneType
Value:
None                                                                  

translator

The actual translation function to use.
Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Mon Jul 25 16:22:12 2005 http://epydoc.sf.net