public function scanAliases($sourceDir)
    {
        $locales = $this->scanLocales($sourceDir);
        $aliases = [];

        // Delete locales that are no aliases
        foreach ($locales as $locale) {
            $content = file_get_contents($sourceDir.'/'.$locale.'.txt');

            // Aliases contain the text "%%ALIAS" followed by the aliased locale
            if (preg_match('/"%%ALIAS"\{"([^"]+)"\}/', $content, $matches)) {
                $aliases[$locale] = $matches[1];
            }
        }

        return $aliases;
    }
public function scanAliases($sourceDir)
    {
        $locales = $this->scanLocales($sourceDir);
        $aliases = [];

        // Delete locales that are no aliases
        foreach ($locales as $locale) {
            $content = file_get_contents($sourceDir.'/'.$locale.'.txt');

            // Aliases contain the text "%%ALIAS" followed by the aliased locale
            if (preg_match('/"%%ALIAS"\{"([^"]+)"\}/', $content, $matches)) {
                $aliases[$locale] = $matches[1];
            }
        }

        return $aliases;
    }
public function scanAliases ( $ sourceDir ) { $ locales = $ this -> scanLocales ( $ sourceDir ) ; $ aliases = [ ] ; // Delete locales that are no aliases foreach ( $ locales as $ locale ) { $ content = file_get_contents ( $ sourceDir . '/' . $ locale . '.txt' ) ; // Aliases contain the text "%%ALIAS" followed by the aliased locale if ( preg_match ( '/"%%ALIAS"\{"([^"]+)"\}/' , $ content , $ matches ) ) { $ aliases [ $ locale ] = $ matches [ 1 ] ; } } return $ aliases ; }
Returns all locale aliases found in the given directory.

@param string $sourceDir The directory with ICU files

@return array An array with the locale aliases as keys and the aliased
locales as values
Returns all locale aliases found in the given directory .