Package web2py :: Package gluon :: Module languages :: Class translator
[hide private]
[frames] | no frames]

Class translator

source code

object --+
         |
        translator

this class is instantiated once in gluon/main.py as the T object

:

   T.force(None) # turns off translation
   T.force('fr, it') # forces web2py to translate using fr.py or it.py

   T("Hello World") # translates "Hello World" using the selected file

notice 1: there is no need to force since, by default, T uses accept_language to determine a translation file.

notice 2: en and en-en are considered different languages!

Instance Methods [hide private]
 
__init__(self, request)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
set_current_languages(self, *languages) source code
 
force(self, *languages) source code
 
__call__(self, message, symbols={}) source code
 
translate(self, message, symbols) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, request)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)