Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PlacelessTranslationService.utility.PTSTranslationDomain Class Reference

List of all members.

Public Member Functions

def __init__
def translate

Public Attributes


Detailed Description

Makes translation domains that are still kept in PTS available as
ITranslationDomain utilities. That way they are usable from Zope 3 code
such as Zope 3 PageTemplates.

Definition at line 10 of file

Constructor & Destructor Documentation

Definition at line 17 of file

00018     def __init__(self, domain):
00019         self.domain = domain

Member Function Documentation

def PlacelessTranslationService.utility.PTSTranslationDomain.translate (   self,
  mapping = None,
  context = None,
  target_language = None,
  default = None 

Definition at line 21 of file

00022                   target_language=None, default=None):
00024         pts  = getTranslationService()
00025         if pts is None or context is None:
00026             # If we don't have enough context use interpolate
00027             return interpolate(default, mapping)
00029         # Don't accept anything which isn't a real request
00030         if not IBrowserRequest.providedBy(context) or 'PARENTS' not in context:
00031             raise ValueError, "You didn't pass in a request as the context."
00033         parent = context['PARENTS'][-1]
00034         return pts.translate(self.domain, msgid, mapping, parent,
00035                              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 18 of file

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