'pl_PL', 'fr' => 'fr_FR', 'en' => 'en_GB', ); protected $_currencyLangs = array( 'pl' => 'pl_PL', 'fr' => 'fr_FR', 'en' => 'en_GB', ); protected $_domainsLangs = array( 'pl' => 'fryderykdanielczyk.com', 'fr' => 'fr.fryderykdanielczyk.com', 'en' => 'en.fryderykdanielczyk.com', ); public function preDispatch(Zend_Controller_Request_Abstract $request) { $lang = APP_LANG; if(in_array(strtolower($lang), $this->_avbLangs) ) { $request->setParam('lang', strtolower($lang)); } else { $request->setParam('lang', $this->_defaultLang); } $lang = $request->getParam('lang'); $request->setParam('cmsLang', $lang); $storage = new Application_Model_Storage(); $storage->setLang($lang); $zl = new Zend_Locale(); $zl->setLocale($this->_localeLangs[$lang]); Zend_Registry::set('Zend_Locale', $zl); $currency = new Zend_Currency($this->_currencyLangs[$lang]); Zend_Registry::set('Zend_Currency', $currency); $translate = New Zend_Translate('csv', APPLICATION_PATH . '/configs/lang/'.$lang.'.csv', $lang); Zend_Registry::set('Zend_Translate', $translate); $form = New Zend_Form; $form->setDefaultTranslator($translate); Zend_Registry::set('Zend_Form', $form); $validate = New Zend_Validate; $validate->setDefaultTranslator($translate); Zend_Registry::set('Zend_Validate', $validate); if(in_array($request->getParam('cmsLang'), $this->_avbLangs)) { if(isset($this->_domainsLangs[$lang])) { if($_SERVER['HTTP_HOST'] != ''.$this->_domainsLangs[$lang]) { $this->getResponse()->setRedirect('http://'.$this->_domainsLangs[$lang].''.$_SERVER['REQUEST_URI']); } } else { if($_SERVER['HTTP_HOST'] != ''.$this->_defaultDomain) { $this->getResponse()->setRedirect('http://'.$this->_defaultDomain.''.$_SERVER['REQUEST_URI']); } } } $this->getResponse()->setRawHeader('Content-language: '.$lang); } } ?>
Fatal error: Uncaught Error: Class 'Cms_Module_Controller_Plugin_LangSelector' not found in /usr/share/php/Zend/Application/Resource/Frontcontroller.php:117 Stack trace: #0 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(695): Zend_Application_Resource_Frontcontroller->init() #1 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(641): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('frontController') #2 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(598): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap('frontController') #3 /var/www/application/Bootstrap.php(7): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap('frontController') #4 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(681): Bootstrap->_initAppCmsModules() #5 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.php(634): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('appcmsmodules') #6 /usr/share/php/Zend/Application/Bootstrap/BootstrapAbstract.ph in /usr/share/php/Zend/Application/Resource/Frontcontroller.php on line 117