mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°6002 - Update Symfony libs to 5.4.19
This commit is contained in:
@@ -407,6 +407,7 @@ EOF
|
||||
{
|
||||
$extractedCatalogue = new MessageCatalogue($locale);
|
||||
$this->extractor->setPrefix($prefix);
|
||||
$transPaths = $this->filterDuplicateTransPaths($transPaths);
|
||||
foreach ($transPaths as $path) {
|
||||
if (is_dir($path) || is_file($path)) {
|
||||
$this->extractor->extract($path, $extractedCatalogue);
|
||||
@@ -416,6 +417,27 @@ EOF
|
||||
return $extractedCatalogue;
|
||||
}
|
||||
|
||||
private function filterDuplicateTransPaths(array $transPaths): array
|
||||
{
|
||||
$transPaths = array_filter(array_map('realpath', $transPaths));
|
||||
|
||||
sort($transPaths);
|
||||
|
||||
$filteredPaths = [];
|
||||
|
||||
foreach ($transPaths as $path) {
|
||||
foreach ($filteredPaths as $filteredPath) {
|
||||
if (str_starts_with($path, $filteredPath.\DIRECTORY_SEPARATOR)) {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$filteredPaths[] = $path;
|
||||
}
|
||||
|
||||
return $filteredPaths;
|
||||
}
|
||||
|
||||
private function loadCurrentMessages(string $locale, array $transPaths): MessageCatalogue
|
||||
{
|
||||
$currentCatalogue = new MessageCatalogue($locale);
|
||||
|
||||
Reference in New Issue
Block a user