Ejemplo n.º 1
0
 function extract_entries($code, $file_name)
 {
     $translations = new Translations();
     $function_calls = $this->find_function_calls(array_keys($this->rules), $code);
     foreach ($function_calls as $call) {
         $entry = $this->entry_from_call($call, $file_name);
         if (is_array($entry)) {
             foreach ($entry as $single_entry) {
                 $translations->add_entry_or_merge($single_entry);
             }
         } elseif ($entry) {
             $translations->add_entry_or_merge($entry);
         }
     }
     return $translations;
 }