src/i18n/Data/Sources.php
protected function getLangFiles()
    {
        if (static::$cache_lang_files) {
            return static::$cache_lang_files;
        }

        $locales = [];
        foreach ($this->getLangDirs() as $langPath) {
            $langFiles = scandir($langPath);
            foreach ($langFiles as $langFile) {
                $locale = pathinfo($langFile, PATHINFO_FILENAME);
                $ext = pathinfo($langFile, PATHINFO_EXTENSION);
                if ($locale && $ext === 'yml') {
                    $locales[$locale] = $locale;
                }
            }
        }
        ksort($locales);
        static::$cache_lang_files = $locales;
        return $locales;
    }
protected function getLangFiles()
    {
        if (static::$cache_lang_files) {
            return static::$cache_lang_files;
        }

        $locales = [];
        foreach ($this->getLangDirs() as $langPath) {
            $langFiles = scandir($langPath);
            foreach ($langFiles as $langFile) {
                $locale = pathinfo($langFile, PATHINFO_FILENAME);
                $ext = pathinfo($langFile, PATHINFO_EXTENSION);
                if ($locale && $ext === 'yml') {
                    $locales[$locale] = $locale;
                }
            }
        }
        ksort($locales);
        static::$cache_lang_files = $locales;
        return $locales;
    }
protected function getLangFiles ( ) { if ( static :: $ cache_lang_files ) { return static :: $ cache_lang_files ; } $ locales = [ ] ; foreach ( $ this -> getLangDirs ( ) as $ langPath ) { $ langFiles = scandir ( $ langPath ) ; foreach ( $ langFiles as $ langFile ) { $ locale = pathinfo ( $ langFile , PATHINFO_FILENAME ) ; $ ext = pathinfo ( $ langFile , PATHINFO_EXTENSION ) ; if ( $ locale && $ ext === 'yml' ) { $ locales [ $ locale ] = $ locale ; } } } ksort ( $ locales ) ; static :: $ cache_lang_files = $ locales ; return $ locales ; }
Search directories for list of distinct locale filenames

@return array Map of locale key => key of all distinct localisation file names
Search directories for list of distinct locale filenames