Merge branch '4.12' into 4

This commit is contained in:
Guy Sartorelli 2023-03-01 12:54:30 +13:00
commit 58ca426f11
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A

View File

@ -457,7 +457,7 @@ class i18nTextCollector
$this->getWriter()->write( $this->getWriter()->write(
$entities, $entities,
$this->defaultLocale, $this->defaultLocale,
$this->baseSavePath . '/' . $module->getRelativePath() $this->baseSavePath . DIRECTORY_SEPARATOR . $module->getRelativePath()
); );
return $this; return $this;
} }
@ -511,25 +511,25 @@ class i18nTextCollector
$modulePath = $module->getPath(); $modulePath = $module->getPath();
// Search all .ss files in themes // Search all .ss files in themes
if (stripos($module->getRelativePath() ?? '', 'themes/') === 0) { if (stripos($module->getRelativePath() ?? '', 'themes' . DIRECTORY_SEPARATOR) === 0) {
return $this->getFilesRecursive($modulePath, null, 'ss'); return $this->getFilesRecursive($modulePath, null, 'ss');
} }
// If non-standard module structure, search all root files // If non-standard module structure, search all root files
if (!is_dir("{$modulePath}/code") && !is_dir("{$modulePath}/src")) { if (!is_dir($modulePath . DIRECTORY_SEPARATOR . 'code') && !is_dir($modulePath . DIRECTORY_SEPARATOR . 'src')) {
return $this->getFilesRecursive($modulePath); return $this->getFilesRecursive($modulePath);
} }
// Get code files // Get code files
if (is_dir("{$modulePath}/src")) { if (is_dir($modulePath . DIRECTORY_SEPARATOR . 'src')) {
$files = $this->getFilesRecursive("{$modulePath}/src", null, 'php'); $files = $this->getFilesRecursive($modulePath . DIRECTORY_SEPARATOR . 'src', null, 'php');
} else { } else {
$files = $this->getFilesRecursive("{$modulePath}/code", null, 'php'); $files = $this->getFilesRecursive($modulePath . DIRECTORY_SEPARATOR . 'code', null, 'php');
} }
// Search for templates in this module // Search for templates in this module
if (is_dir("{$modulePath}/templates")) { if (is_dir($modulePath . DIRECTORY_SEPARATOR . 'templates')) {
$templateFiles = $this->getFilesRecursive("{$modulePath}/templates", null, 'ss'); $templateFiles = $this->getFilesRecursive($modulePath . DIRECTORY_SEPARATOR . 'templates', null, 'ss');
} else { } else {
$templateFiles = $this->getFilesRecursive($modulePath, null, 'ss'); $templateFiles = $this->getFilesRecursive($modulePath, null, 'ss');
} }
@ -970,7 +970,7 @@ class i18nTextCollector
$fileList = []; $fileList = [];
} }
// Skip ignored folders // Skip ignored folders
if (is_file("{$folder}/_manifest_exclude") || preg_match($folderExclude ?? '', $folder ?? '')) { if (is_file($folder . DIRECTORY_SEPARATOR . '_manifest_exclude') || preg_match($folderExclude ?? '', $folder ?? '')) {
return $fileList; return $fileList;
} }