Module pytson :: Class Translatable
[hide private]
[frames] | no frames]

Class Translatable

source code

object --+
         |
        Translatable

Baseclass for a class using translatable string literals.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_tr(cls, sourcetext, disambiguation="", n=-1, context=None)
Returns the current translation for a string.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_tr(cls, sourcetext, disambiguation="", n=-1, context=None)
Class Method

source code 

Returns the current translation for a string. This method calls can be extracted by pyTSon's pylupdate.py.

Parameters:
  • sourcetext (str) - translatable string, must be a raw string, not the return value of another function, an attribute or such
  • disambiguation (str) - used to distinguish between two equal sourcetexts int the same context, or as comment, optional, defaults to an empty string, must be a raw string, not the return value of another function, an attribute or such
  • n (int) - used for strings containing plurals, optional, defaults to -1
  • context (str) - context to use for the string, optional, if set to None, the classname is used as context, defaults to None