Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour à tous,
J'utilise Zend_Translate et gettext pour l'internationalisation d'un site et à ma grande surprise tous les textes traduit ne sont pas intégrés. J'ai beau vider le cache, renvoyer mon fichier .mo mais rien n'y fait... Mon fichier est bien compilé par PO EDIT je n'ai aucunes erreurs.
Voilà mon fichier Bootstrap si quelqu'un remarque quelque chose :
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { private $_acl = null; private $_auth = null; private $_role = null; protected function _initView() { error_reporting(E_ERROR | E_WARNING | E_PARSE); $view = new Zend_View(); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper( 'ViewRenderer' ); $viewRenderer->setView($view); return $view; } protected function _initAutoload() { Zend_Controller_Action_HelperBroker::addPrefix('Sheraf_Controller_Action_Helpers'); new Zend_Application_Module_Autoloader(array( 'namespace' => 'Sheraf', 'basePath' => APPLICATION_PATH, )); } protected function _initCache() { $aFrontendConf = array ('lifetime' => 345600, 'automatic_seralization' => true); $aBackendConf = array ('cache_dir' => APPLICATION_PATH . '/cache/'); $oCache = Zend_Cache::factory('Core','File',$aFrontendConf,$aBackendConf); $oCache->setOption('automatic_serialization', true); Zend_Locale::setCache($oCache); Zend_Translate::setCache($oCache); } protected function _initSession() { Zend_Registry::set('langue', $session = new Zend_Session_Namespace('langue')); Zend_Registry::set('session', $session = new Zend_Session_Namespace('session')); Zend_Registry::set('inscription', $session = new Zend_Session_Namespace('inscription')); Zend_Controller_Front::getInstance()->registerPlugin(new Sheraf_Controller_Plugin_Session()); } public function _initTranslate() { $langue = Zend_Registry::get('langue'); if(is_null($langue->data)) { $locale = new Zend_Locale('fr'); } else { $locale = $langue->data; } Zend_Registry::set('Zend_Locale', $locale); $translate = new Zend_Translate('Gettext', APPLICATION_PATH . '/languages/lang_'.$locale.'.mo', $locale, array('disableNotices' => true,'logUntranslated' => false)); Zend_Registry::set('Zend_Translate', $translate); $translateForm = new Zend_Translate('array', APPLICATION_PATH . '/languages/validate.php'); $translateForm->setLocale($locale); Zend_Form::setDefaultTranslator($translate); } protected function _initAcl() { $this->_acl = new Sheraf_Acl(APPLICATION_PATH . '/configs/acl.ini'); Zend_Registry::set('acl', $this->_acl); $this->_auth = Zend_Auth::getInstance(); Zend_Registry::set('auth', $this->_auth); if ($this->_auth->hasIdentity()) $this->_role = $this->_auth->getStorage()->read()->Role; else $this->_role = 'Guest'; Zend_Registry::set('role', $this->_role); Zend_Controller_Front::getInstance()->registerPlugin(new Sheraf_Controller_Plugin_Auth($this->_acl, $this->_auth)); } protected function _initDb () { if ($this->hasPluginResource('db')) { $resource = $this->getPluginResource('db'); $db = $resource->init(); $db->query("SET NAMES 'UTF8'"); return $db; } } }
Hors ligne
Pages: 1