Twig/Extension.php
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
public function getAllLangs ( ) : array { $ domainInfo = $ this -> intuition -> getDomainInfo ( $ this -> domain ) ; $ messageFiles = glob ( $ domainInfo [ 'dir' ] . '/*.json' ) ; $ languages = array_values ( array_unique ( array_map ( function ( $ filename ) { return basename ( $ filename , '.json' ) ; } , $ messageFiles ) ) ) ; $ availableLanguages = [ ] ; foreach ( $ languages as $ lang ) { $ availableLanguages [ $ lang ] = $ this -> intuition -> getLangName ( $ lang ) ; } ksort ( $ availableLanguages ) ; return $ availableLanguages ; }
Get all available languages in the i18n directory.
@return string[] Associative array of langKey => langName
Get all available languages in the i18n directory .