예제 #1
0
 /**
  * Parses an array of key/value structured strings, flattens it with the glue and adds it to the a language storage
  *
  * @param array $language
  *            The array with language strings
  * @param string $storage_name
  *            The name of the language storage to place the srings in
  * @param string $glue
  *            Optional glue which should be used in flattening process
  */
 public function parseLanguageArray(array $language, string $storage_name, string $glue = '.')
 {
     $toolbox = new Flatten($language);
     $toolbox->setPreserveFlaggedArraysFlag(true);
     $toolbox->setGlue($glue);
     $language = $toolbox->flatten();
     if (!empty($language) && !isset($this->storage->{$storage_name})) {
         $this->storage->{$storage_name} = new LanguageStorage();
     }
     foreach ($language as $key => $val) {
         $this->storage->{$storage_name}->{$key} = $val;
     }
 }