import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -33,7 +33,10 @@ require_once 'Zend/Translate/Adapter.php';
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter {
|
||||
class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter
|
||||
{
|
||||
private $_data = array();
|
||||
|
||||
/**
|
||||
* Generates the adapter
|
||||
*
|
||||
@ -54,9 +57,11 @@ class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter {
|
||||
* @param string $locale Locale/Language to add data for, identical with locale identifier,
|
||||
* see Zend_Locale for more information
|
||||
* @param array $options OPTIONAL Options to use
|
||||
* @return array
|
||||
*/
|
||||
protected function _loadTranslationData($data, $locale, array $options = array())
|
||||
{
|
||||
$this->_data = array();
|
||||
if (!is_array($data)) {
|
||||
if (file_exists($data)) {
|
||||
ob_start();
|
||||
@ -69,12 +74,12 @@ class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter {
|
||||
throw new Zend_Translate_Exception("Error including array or file '".$data."'");
|
||||
}
|
||||
|
||||
$options = $options + $this->_options;
|
||||
if (($options['clear'] == true) || !isset($this->_translate[$locale])) {
|
||||
$this->_translate[$locale] = array();
|
||||
if (!isset($this->_data[$locale])) {
|
||||
$this->_data[$locale] = array();
|
||||
}
|
||||
|
||||
$this->_translate[$locale] = $data + $this->_translate[$locale];
|
||||
$this->_data[$locale] = $data + $this->_data[$locale];
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user