Neos\Flow\I18n\Cldr\CldrRepository::findLocaleChain PHP Метод

findLocaleChain() защищенный Метод

For given locale, many CLDR files have to be merged in order to get full set of CLDR data. For example, for 'en_GB' locale, files 'root', 'en', and 'en_GB' should be merged.
protected findLocaleChain ( Locale $locale, string $directoryPath ) : array
$locale Neos\Flow\I18n\Locale A locale
$directoryPath string Relative path to existing CLDR directory which contains one file per locale (see 'main' directory in CLDR for example)
Результат array
    protected function findLocaleChain(I18n\Locale $locale, $directoryPath)
    {
        $filesInHierarchy = [Files::concatenatePaths([$directoryPath, (string) $locale . '.xml'])];
        $localeIdentifier = (string) $locale;
        while ($localeIdentifier = substr($localeIdentifier, 0, (int) strrpos($localeIdentifier, '_'))) {
            $possibleFilename = Files::concatenatePaths([$directoryPath, $localeIdentifier . '.xml']);
            if (file_exists($possibleFilename)) {
                array_unshift($filesInHierarchy, $possibleFilename);
            }
        }
        array_unshift($filesInHierarchy, Files::concatenatePaths([$directoryPath, 'root.xml']));
        return $filesInHierarchy;
    }