/** * Retrieve locale object * * @return IfwPsn_Vendor_Zend_Locale */ public function getLocale() { if (null === $this->_locale) { $options = $this->getOptions(); if (!isset($options['default'])) { $this->_locale = new IfwPsn_Vendor_Zend_Locale(); } elseif (!isset($options['force']) || (bool) $options['force'] == false) { // Don't force any locale, just go for auto detection IfwPsn_Vendor_Zend_Locale::setDefault($options['default']); $this->_locale = new IfwPsn_Vendor_Zend_Locale(); } else { $this->_locale = new IfwPsn_Vendor_Zend_Locale($options['default']); } $key = isset($options['registry_key']) && !is_numeric($options['registry_key']) ? $options['registry_key'] : self::DEFAULT_REGISTRY_KEY; IfwPsn_Vendor_Zend_Registry::set($key, $this->_locale); } return $this->_locale; }