hasIdentity() ) { $identity = $auth->getIdentity(); $lang = $identity->langtmp; switch($lang) { case 'en': $locale = new Zend_Locale('en'); break; case 'fr': default: $locale = new Zend_Locale('fr'); break; } } else { $locale = new Zend_Locale('fr'); } $translate = new Zend_Translate( array( 'adapter' => 'gettext', 'content' => APPLICATION_PATH . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . 'fr.mo', 'locale' => 'fr', 'scan' => Zend_Translate::LOCALE_DIRECTORY ) ); $translate->addTranslation( array( 'content' => APPLICATION_PATH . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR . 'en.mo', 'locale' => 'en', 'scan' => Zend_Translate::LOCALE_DIRECTORY ) ); $translate->setLocale($locale); $registry = Zend_Registry::getInstance(); $registry->set('Zend_Locale', $locale); $registry->set('Zend_Translate', $translate); } }