public function init() { parent::init(); try { $locale = Zend_Registry::get("Zend_Locale"); } catch (Exception $e) { $locale = new Zend_Locale("en"); } $this->view->language = $locale->getLanguage(); $this->language = $locale->getLanguage(); }
public function init() { parent::init(); if (Zend_Registry::isRegistered("Zend_Locale")) { $locale = Zend_Registry::get("Zend_Locale"); } else { $locale = new Zend_Locale("en"); Zend_Registry::set("Zend_Locale", $locale); } $this->view->language = (string) $locale; $this->language = (string) $locale; }
/** * Init Website Controller */ public function init() { // init parent parent::init(); // workaround... Zend_Registry::set("Zend_Locale", new Zend_Locale("en_GB")); // workaround... // set locale if (Zend_Registry::isRegistered("Zend_Locale")) { $locale = Zend_Registry::get("Zend_Locale"); } else { $locale = new Zend_Locale("en_US"); Zend_Registry::set("Zend_Locale", $locale); } // set global view params $this->view->language = $locale->getLanguage(); $this->language = $locale->getLanguage(); $this->setParam('country', $this->language); $this->view->addHelperPath(PIMCORE_WEBSITE_PATH . "/lib/Website/View/Helper", "Website_View_Helper_"); $this->checkForUser(); }
public function init() { parent::init(); try { $this->_locale = Zend_Registry::get('Zend_Locale'); } catch (Exception $e) { $this->_locale = new Zend_Locale('en'); Zend_Registry::set('Zend_Locale', $this->_locale); } $this->view->locale = $this->_locale; $this->_translate = $this->initTranslation(); $this->view->setScriptPath(array_merge($this->view->getScriptPaths(), array(PIMCORE_WEBSITE_PATH . '/views/scripts/', PIMCORE_WEBSITE_PATH . '/views/layouts/', PIMCORE_WEBSITE_PATH . '/views/scripts/blog/'))); // additional helpers $this->_helper->addPrefix('Modern_Controller_Action_Helper'); $this->view->addHelperPath('Modern/View/Helper', 'Modern_View_Helper_'); $this->_messenger = $this->_helper->getHelper('FlashMessenger'); Modern_View_Helper_FlashMessenger::setPartial('partial/messenger.php'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('partial/paginator-search.php'); // fix main blog list pagination if (!Staticroute::getCurrentRoute() instanceof Staticroute) { Staticroute::setCurrentRoute(Staticroute::getByName('blog')); } }