Logo Search packages:      
Sourcecode: zope-i18nlayer version File versions

def zope-i18nlayer-0.5.5::I18NContent::I18NContentBase::getLanguagesFromRequest (   self  )  [inherited]

return a list of languages matching this request 

Definition at line 56 of file I18NContent.py.

00056                                      :
        """ return a list of languages matching this request """

        REQUEST = get_request()
        language=REQUEST.cookies.get('I18N_CONTENT_LANGUAGE', None)
        language_once=REQUEST.get('cl', None)
        if not language_once:
            # we support a property here to make it possible to pre select default languages
            # for certain folders
            language_once=getattr(self.Layer(), 'local_default_language', None)
            if language_once: self.REQUEST.set('cl', language_once)
        accept=self.getLanguagesFromTranslationService()
        try: default_language=self.Layer().portal_properties.site_properties.default_language
        except: default_language=None

        #print "accept", accept, language, language_once, default_language
        languages=accept
        #print "accept", accept
        #print "language", language
        #print "language_once", language_once
        #print "default_language", default_language
        if language: languages=[language,]+languages
        if language_once and language_once != language: languages=[language_once,]+languages
        if default_language: languages=languages+[default_language,]

        #print "languages", languages
        return languages

    def getLanguagesFromTranslationService(self):


Generated by  Doxygen 1.6.0   Back to index