src/i18n/TextCollection/i18nTextCollector.php
public function collect($restrictToModules = array(), $mergeWithExisting = false)
    {
        $entitiesByModule = $this->getEntitiesByModule();

        // Resolve conflicts between duplicate keys across modules
        $entitiesByModule = $this->resolveDuplicateConflicts($entitiesByModule);

        // Optionally merge with existing master strings
        if ($mergeWithExisting) {
            $entitiesByModule = $this->mergeWithExisting($entitiesByModule);
        }

        // Restrict modules we update to just the specified ones (if any passed)
        if (!empty($restrictToModules)) {
            // Normalise module names
            $modules = array_filter(array_map(function ($name) {
                $module = ModuleLoader::inst()->getManifest()->getModule($name);
                return $module ? $module->getName() : null;
            }, $restrictToModules));
            // Remove modules
            foreach (array_diff(array_keys($entitiesByModule), $modules) as $module) {
                unset($entitiesByModule[$module]);
            }
        }
        return $entitiesByModule;
    }
public function collect($restrictToModules = array(), $mergeWithExisting = false)
    {
        $entitiesByModule = $this->getEntitiesByModule();

        // Resolve conflicts between duplicate keys across modules
        $entitiesByModule = $this->resolveDuplicateConflicts($entitiesByModule);

        // Optionally merge with existing master strings
        if ($mergeWithExisting) {
            $entitiesByModule = $this->mergeWithExisting($entitiesByModule);
        }

        // Restrict modules we update to just the specified ones (if any passed)
        if (!empty($restrictToModules)) {
            // Normalise module names
            $modules = array_filter(array_map(function ($name) {
                $module = ModuleLoader::inst()->getManifest()->getModule($name);
                return $module ? $module->getName() : null;
            }, $restrictToModules));
            // Remove modules
            foreach (array_diff(array_keys($entitiesByModule), $modules) as $module) {
                unset($entitiesByModule[$module]);
            }
        }
        return $entitiesByModule;
    }
public function collect ( $ restrictToModules = array ( ) , $ mergeWithExisting = false ) { $ entitiesByModule = $ this -> getEntitiesByModule ( ) ; // Resolve conflicts between duplicate keys across modules $ entitiesByModule = $ this -> resolveDuplicateConflicts ( $ entitiesByModule ) ; // Optionally merge with existing master strings if ( $ mergeWithExisting ) { $ entitiesByModule = $ this -> mergeWithExisting ( $ entitiesByModule ) ; } // Restrict modules we update to just the specified ones (if any passed) if ( ! empty ( $ restrictToModules ) ) { // Normalise module names $ modules = array_filter ( array_map ( function ( $ name ) { $ module = ModuleLoader :: inst ( ) -> getManifest ( ) -> getModule ( $ name ) ; return $ module ? $ module -> getName ( ) : null ; } , $ restrictToModules ) ) ; // Remove modules foreach ( array_diff ( array_keys ( $ entitiesByModule ) , $ modules ) as $ module ) { unset ( $ entitiesByModule [ $ module ] ) ; } } return $ entitiesByModule ; }
Extract all strings from modules and return these grouped by module name

@param array $restrictToModules
@param bool $mergeWithExisting
@return array
Extract all strings from modules and return these grouped by module name