Exemplo n.º 1
0
 /**
  * Adds a copy of the given component into the staging area
  *
  * @param mlang_component $component
  * @param bool $force replace the previously staged string if there is such if there is already
  * @return void
  */
 public function add(mlang_component $component, $force = false)
 {
     $cid = $component->get_identifier();
     if (!isset($this->components[$cid])) {
         $this->components[$cid] = new mlang_component($component->name, $component->lang, $component->version);
     }
     foreach ($component->get_iterator() as $string) {
         $this->components[$cid]->add_string(clone $string, $force);
     }
 }