Logo Search packages:      
Sourcecode: zope-cpsskins version File versions  Download package

def CPSSkins::PortalThemesTool::PortalThemesTool::getTranslationService (   self,
  root = 0,
  cat = '' 
)

Return the translation service

Returns None in CPS3 context, because translations will be done
by i18n:translate tags in PTs.

Definition at line 964 of file PortalThemesTool.py.

00964                                                    :
        """Return the translation service

        Returns None in CPS3 context, because translations will be done
        by i18n:translate tags in PTs.
        """
        # CMF / Plone1 / CPS3
        localizer = getToolByName(self, 'Localizer', None)
        if localizer is not None:
            if root:
                return localizer
            if cat:
                return getattr(localizer, cat, None)

            # Localizer without translation service
            ts = getToolByName(self, 'translation_service', None)
            if ts is None:
                return getattr(localizer, 'default', None)

        # CPS2
        portal_messages = getToolByName(self, 'portal_messages', None)
        if portal_messages is not None:
            return portal_messages

        return None

    #
    # Theme management


Generated by  Doxygen 1.6.0   Back to index