Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
Zend_Translate_Adapter_Array Class Reference
Inheritance diagram for Zend_Translate_Adapter_Array:
Zend_Translate_Adapter

Public Member Functions

 toString ()
 
- Public Member Functions inherited from Zend_Translate_Adapter
 __construct ($options=array())
 
 addTranslation ($options=array())
 
 setOptions (array $options=array())
 
 getOptions ($optionKey=null)
 
 getLocale ()
 
 setLocale ($locale)
 
 getList ()
 
 getMessageId ($message, $locale=null)
 
 getMessageIds ($locale=null)
 
 getMessages ($locale=null)
 
 isAvailable ($locale)
 
 translate ($messageId, $locale=null)
 
 plural ($singular, $plural, $number, $locale=null)
 
 _ ($messageId, $locale=null)
 
 isTranslated ($messageId, $original=false, $locale=null)
 
 toString ()
 

Protected Member Functions

 _loadTranslationData ($data, $locale, array $options=array())
 
- Protected Member Functions inherited from Zend_Translate_Adapter
 _loadTranslationData ($data, $locale, array $options=array())
 
 _log ($message, $locale)
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Translate_Adapter
static getCache ()
 
static setCache (Zend_Cache_Core $cache)
 
static hasCache ()
 
static removeCache ()
 
static clearCache ($tag=null)
 
- Data Fields inherited from Zend_Translate_Adapter
const LOCALE_DIRECTORY = 'directory'
 
const LOCALE_FILENAME = 'filename'
 
- Protected Attributes inherited from Zend_Translate_Adapter
 $_options
 
 $_translate = array()
 
- Static Protected Attributes inherited from Zend_Translate_Adapter
static $_cache = null
 

Detailed Description

Definition at line 36 of file Array.php.

Member Function Documentation

◆ _loadTranslationData()

_loadTranslationData (   $data,
  $locale,
array  $options = array() 
)
protected

Load translation data

Parameters
string | array$data
string$localeLocale/Language to add data for, identical with locale identifier, see Zend_Locale for more information
array$optionsOPTIONAL Options to use
Returns
array

Definition at line 49 of file Array.php.

50  {
51  $this->_data = array();
52  if (!is_array($data)) {
53  if (file_exists($data)) {
54  ob_start();
55  $data = include($data);
56  ob_end_clean();
57  }
58  }
59  if (!is_array($data)) {
60  #require_once 'Zend/Translate/Exception.php';
61  throw new Zend_Translate_Exception("Error including array or file '".$data."'");
62  }
63 
64  if (!isset($this->_data[$locale])) {
65  $this->_data[$locale] = array();
66  }
67 
68  $this->_data[$locale] = $data + $this->_data[$locale];
69  return $this->_data;
70  }

◆ toString()

toString ( )

returns the adapters name

Returns
string

Definition at line 77 of file Array.php.

78  {
79  return "Array";
80  }

The documentation for this class was generated from the following file: