Beispiel #1
0
 /**
  * Initializes the translation object using Zend_Translate.
  * This implementation only accepts files as source for the Zend_Translate_Adapter.
  *
  * @param array $translationSources Associative list of translation domains and lists of translation directories.
  * 	Translations from the first file aren't overwritten by the later ones
  * as key and the directory where the translation files are located as value.
  * @param string $adapter Name of the Zend translation adapter
  * @param string $locale ISO language name, like "en" or "en_US"
  * @param string $options Associative array containing additional options for Zend_Translate
  *
  * @link http://framework.zend.com/manual/1.11/en/zend.translate.adapter.html
  */
 public function __construct(array $translationSources, $adapter, $locale, array $options = array())
 {
     parent::__construct($locale);
     $this->_options = $options;
     $this->_options['adapter'] = (string) $adapter;
     $this->_options['locale'] = (string) $locale;
     $this->_translationSources = $translationSources;
 }
 /**
  * Initializes the translation object.
  *
  * The serialized array must contain a list of key => value pairs or the value
  * contains an array also for plural translations:
  *
  * singular => array(
  *     singular translation, [plural translation 1 [, plural translation 2] ...]
  * )
  *
  * Example for russia:
  * a:1:{s:4:"file";a:4:{i:0;s:8:"Файл";i:1;s:8:"Файл";i:2;s:10:"Файла";i:3;s:12:"Файлов";}}
  *
  * @param array $translationSources Associative list of translation domains and lists of translation directories.
  * 	Translations from the first file aren't overwritten by the later ones
  * domain as key and the directory where the translation files are located as value.
  * @param string $locale Locale string, e.g. en or en_GB
  */
 public function __construct(array $translationSources, $locale)
 {
     parent::__construct($locale);
     $this->_translationSources = $translationSources;
 }