<s> from xierpa3 . components import Column <EOL> class GoogleTranslate ( Column ) : <EOL> u"""<STR_LIT>""" <EOL> def initializeLanguage ( self ) : <EOL> u"""<STR_LIT>""" <EOL> self . language = self . getSessionValue ( self . SESSION_LANGUAGE ) or self . LANGUAGE_DEFAULT <EOL> def getLanguages ( self ) : <EOL> u"""<STR_LIT>""" <EOL> return self . APP_LANGUAGES <EOL> def buildJS ( self , b ) : <EOL> u"""<STR_LIT>""" <EOL> for component in self . components : <EOL> component . buildJS ( b ) <EOL> if self . isGoogleTranslate ( ) : <EOL> self . script ( ) <EOL> self . text ( """<STR_LIT>""" % ( self . getdefaultlanguage ( ) , self . TARGETID_GOOGLETRANSLATE ) ) <EOL> self . _script ( ) <EOL> self . script ( src = '<STR_LIT>' ) <EOL> def buildBlock ( self , b ) : <EOL> u"""<STR_LIT>""" <EOL> self . div ( class_ = self . CLASS_GOOGLETRANSLATE ) <EOL> self . div ( id = self . TARGETID_GOOGLETRANSLATE ) <EOL> self . _div ( ) <EOL> if self . e . form [ self . PARAM_GOOGLETRANSLATE ] : <EOL> self . textLabel ( self . LABEL_GOOGLETRANSLATECAPTION ) <EOL> self . _div ( ) <EOL> def isGoogleTranslate ( self , b ) : <EOL> u"""<STR_LIT>""" <EOL> s = self . style <EOL> return s . useGoogleTranslate and '<STR_LIT>' in b . e . form . keys ( ) </s>
