Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes
PlacelessTranslationService.PlacelessTranslationService.PTSWrapper Class Reference
Inheritance diagram for PlacelessTranslationService.PlacelessTranslationService.PTSWrapper:
Inheritance graph
[legend]
Collaboration diagram for PlacelessTranslationService.PlacelessTranslationService.PTSWrapper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def load
def translate
def utranslate
def getLanguageName
def getLanguages
def negotiate_language
def isRTL
def __repr__

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _path

Detailed Description

Wrap the persistent PTS since persistent
objects can't be passed around threads.

Definition at line 59 of file PlacelessTranslationService.py.


Constructor & Destructor Documentation

Definition at line 67 of file PlacelessTranslationService.py.

00067 
00068     def __init__(self, service):
00069         # get path from service
00070         self._path=service.getPhysicalPath()


Member Function Documentation

Return a string representation

Definition at line 130 of file PlacelessTranslationService.py.

00130 
00131     def __repr__(self):
00132         """
00133         Return a string representation
00134         """
00135         return "<PTSWrapper for %s>" % '/'.join(self._path)
00136 
00137 InitializeClass(PTSWrapper)

Definition at line 105 of file PlacelessTranslationService.py.

00105 
00106     def getLanguageName(self, code, context):
00107         service = self.load(context)
00108         return service.getLanguageName(code)

Here is the call graph for this function:

Definition at line 110 of file PlacelessTranslationService.py.

00110 
00111     def getLanguages(self, context, domain=None):
00112         service = self.load(context)
00113         return service.getLanguages(domain)

Here is the call graph for this function:

Definition at line 123 of file PlacelessTranslationService.py.

00123 
00124     def isRTL(self, context, domain):
00125         service = self.load(context)
00126         # Default to LtR
00127         if service is None:
00128             return False
00129         return service.isRTL(context.REQUEST,domain)

Here is the call graph for this function:

Definition at line 72 of file PlacelessTranslationService.py.

00072 
00073     def load(self, context):
00074         # return the real service
00075         try: root = context.getPhysicalRoot()
00076         except: return None
00077         # traverse the service
00078         return root.unrestrictedTraverse(self._path, None)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 115 of file PlacelessTranslationService.py.

00115 
00116     def negotiate_language(self, context, domain):
00117         service = self.load(context)
00118         return service.negotiate_language(context.REQUEST,domain)

Here is the call graph for this function:

Here is the caller graph for this function:

def PlacelessTranslationService.PlacelessTranslationService.PTSWrapper.translate (   self,
  domain,
  msgid,
  mapping = None,
  context = None,
  target_language = None,
  default = None 
)
Translate a message using Unicode.

Definition at line 81 of file PlacelessTranslationService.py.

00081 
00082                   target_language=None, default=None):
00083         """
00084         Translate a message using Unicode.
00085         """
00086         service = self.load(context)
00087         if not service:
00088             return default
00089         return service.translate(domain, msgid, mapping, context, target_language, default)

Here is the call graph for this function:

Here is the caller graph for this function:

def PlacelessTranslationService.PlacelessTranslationService.PTSWrapper.utranslate (   self,
  domain,
  msgid,
  mapping = None,
  context = None,
  target_language = None,
  default = None 
)
Translate a message using Unicode..

Definition at line 95 of file PlacelessTranslationService.py.

00095 
00096                   target_language=None, default=None):
00097         """
00098         Translate a message using Unicode..
00099         """
00100         service = self.load(context)
00101         if not service:
00102             return default
00103         return service.utranslate(domain, msgid, mapping, context, target_language, default)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 69 of file PlacelessTranslationService.py.

Definition at line 65 of file PlacelessTranslationService.py.


The documentation for this class was generated from the following file: