diff --git a/i18n/i18nTextCollector.php b/i18n/i18nTextCollector.php index 5c0b493b0..38079cd04 100644 --- a/i18n/i18nTextCollector.php +++ b/i18n/i18nTextCollector.php @@ -75,21 +75,12 @@ class i18nTextCollector extends Object { public function run($restrictToModules = null) { //Debug::message("Collecting text...", false); - $modules = array(); + $modules = scandir($this->basePath); $themeFolders = array(); // A master string tables array (one mst per module) $entitiesByModule = array(); - //Search for and process existent modules, or use the passed one instead - if($restrictToModules && count($restrictToModules)) { - foreach($restrictToModules as $restrictToModule) { - $modules[] = basename($restrictToModule); - } - } else { - $modules = scandir($this->basePath); - } - foreach($modules as $index => $module){ if($module != 'themes') continue; else { @@ -145,6 +136,13 @@ class i18nTextCollector extends Object { } } + // Restrict modules we update to just the specified ones (if any passed) + if($restrictToModules && count($restrictToModules)) { + foreach (array_diff(array_keys($entitiesByModule), $restrictToModules) as $module) { + unset($entitiesByModule[$module]); + } + } + // Write each module language file if($entitiesByModule) foreach($entitiesByModule as $module => $entities) { $this->getWriter()->write($entities, $this->defaultLocale, $this->baseSavePath . '/' . $module);