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

def zope-i18nfolder-2.02::I18NFolder::I18NFolder::getLanguageObject (   self,
  lang_code = None 
)

getLanguageObject(self)

Definition at line 153 of file I18NFolder.py.

00153                                                :
        """
        getLanguageObject(self)
        """
        
        # Get current language object
        lang = lang_code
  
        use_fallback = 1
        
        if not lang:
            lang = self.getCurrentLanguage()
        else:
            use_fallback = 0
        
        langs = self.folder_languages.keys()
        
        # Fallback
        if use_fallback and lang not in langs:
            # 1 - Use default language
            lang = self.getDefaultLanguage()
            
            # 2 - Use first defined languages if exists
            if lang not in langs and len(langs) > 0:
               lang = langs[0]
            
        language_object = self.folder_languages.get(lang, None)
        
        if language_object is None:
            # Get en empty object
            language_object = {'title' : '',
                               'description' : ''}
        
        return language_object
    
    # Set title method
    def setTitle(self, title='', lang_code=None):


Generated by  Doxygen 1.6.0   Back to index