public function extractTranslationsFromFolders($folders, $trans_methods, $php_file_extension = 'php')
    {
        $lemmas = [];

        foreach ($folders as $path) {
            foreach ($this->getFilesWithExtension($path, $php_file_extension) as $php_file_path => $dumb) {
                $lemma = [];

                foreach ($this->extractTranslationFromPhpFile($php_file_path, $trans_methods) as $k => $v) {
                    $a = $this->evalString($k);
                    if (is_string($a)) {
                        $real_value         = $a;
                        $lemma[$real_value] = $php_file_path;
                    } else {
                        $this->messageBag->writeError("Unable to understand string $k");
                    }
                }

                $lemmas = array_merge($lemmas, $lemma);
            }
        }

        return $lemmas;
    }
public function extractTranslationsFromFolders($folders, $trans_methods, $php_file_extension = 'php')
    {
        $lemmas = [];

        foreach ($folders as $path) {
            foreach ($this->getFilesWithExtension($path, $php_file_extension) as $php_file_path => $dumb) {
                $lemma = [];

                foreach ($this->extractTranslationFromPhpFile($php_file_path, $trans_methods) as $k => $v) {
                    $a = $this->evalString($k);
                    if (is_string($a)) {
                        $real_value         = $a;
                        $lemma[$real_value] = $php_file_path;
                    } else {
                        $this->messageBag->writeError("Unable to understand string $k");
                    }
                }

                $lemmas = array_merge($lemmas, $lemma);
            }
        }

        return $lemmas;
    }
public function extractTranslationsFromFolders ( $ folders , $ trans_methods , $ php_file_extension = 'php' ) { $ lemmas = [ ] ; foreach ( $ folders as $ path ) { foreach ( $ this -> getFilesWithExtension ( $ path , $ php_file_extension ) as $ php_file_path => $ dumb ) { $ lemma = [ ] ; foreach ( $ this -> extractTranslationFromPhpFile ( $ php_file_path , $ trans_methods ) as $ k => $ v ) { $ a = $ this -> evalString ( $ k ) ; if ( is_string ( $ a ) ) { $ real_value = $ a ; $ lemma [ $ real_value ] = $ php_file_path ; } else { $ this -> messageBag -> writeError ( "Unable to understand string $k" ) ; } } $ lemmas = array_merge ( $ lemmas , $ lemma ) ; } } return $ lemmas ; }
Extract all translations from the provided folders

@param array $folders             a list of folder to search in
@param array $trans_methods       an array of regex to catch
@param string $php_file_extension default is php

@return array
Extract all translations from the provided folders