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

def CPSSkins::PortalThemesTool::PortalThemesTool::getCurrentLang (   self  ) 

Get the current language

Definition at line 837 of file PortalThemesTool.py.

00837                             :
        """Get the current language

        # Localizer (CMF, Plone1, CPS3)
        localizer = getattr(self, 'Localizer', None)
        if localizer is not None:
            return localizer.get_selected_language()

        # PloneLanguageTool (Plone2)
        ptool = getToolByName(self, 'portal_languages', None)
        if ptool is not None:
            boundLanguages = ptool.getLanguageBindings()
            if boundLanguages:
                return boundLanguages[0]

        # Portal messages (CPS2)
        mcat = getToolByName(self, 'portal_messages', None)
        if mcat is not None:
            return mcat.get_selected_language()

        # PlacelessTranslation service
        REQUEST = self.REQUEST
        if REQUEST is not None:
            accept_language = REQUEST.get('HTTP_ACCEPT_LANGUAGE')
            if accept_language:
                accept_language = accept_language.split(',')
                if len(accept_language) > 0:
                    return accept_language[0]

        return 'en'

    def getIconFor(self, category, id):

Generated by  Doxygen 1.6.0   Back to index