/**
  * Load a language, including text domains.
  *
  * @param string $lang Language to load
  *
  * @return array
  */
 protected function loadLanguage($lang)
 {
     $base = $this->loader->load($lang, null);
     foreach ($this->getTextDomains() as $domain) {
         $current = $this->loader->load($lang, $domain);
         foreach ($current as $k => $v) {
             if ($k != '@parent_ini') {
                 $base["{$domain}::{$k}"] = $v;
             }
         }
     }
     if (isset($base['@parent_ini'])) {
         // don't count macros in comparison:
         unset($base['@parent_ini']);
     }
     return $base;
 }
Exemple #2
0
 /**
  * Test missing path stack.
  *
  * @return void
  *
  * @expectedException        Zend\I18n\Exception\InvalidArgumentException
  * @expectedExceptionMessage Ini file 'en.ini' not found
  */
 public function testMissingPathStack()
 {
     $loader = new ExtendedIni();
     $loader->load('en', null);
 }
Exemple #3
0
 /**
  * Constructor
  *
  * @param array  $pathStack      List of directories to search for language
  * files.
  * @param string $fallbackLocale Fallback locale to use for language strings
  * missing from selected file.
  */
 public function __construct($pathStack = array(), $fallbackLocale = null)
 {
     parent::__construct($pathStack, $fallbackLocale);
 }