src/i18n/Data/Intl/IntlLocales.php
public function getLanguages()
    {
        // Cache by locale
        $locale = i18n::get_locale();
        if (!empty(static::$cache_languages[$locale])) {
            return static::$cache_languages[$locale];
        }

        // Localise all languages
        $languages = $this->config()->get('languages');
        $localised = [];
        foreach ($languages as $code => $default) {
            $localised[$code] = $this->languageName($code);
        }

        // Save cache
        static::$cache_languages[$locale] = $localised;
        return $localised;
    }
public function getLanguages()
    {
        // Cache by locale
        $locale = i18n::get_locale();
        if (!empty(static::$cache_languages[$locale])) {
            return static::$cache_languages[$locale];
        }

        // Localise all languages
        $languages = $this->config()->get('languages');
        $localised = [];
        foreach ($languages as $code => $default) {
            $localised[$code] = $this->languageName($code);
        }

        // Save cache
        static::$cache_languages[$locale] = $localised;
        return $localised;
    }
public function getLanguages ( ) { // Cache by locale $ locale = i18n :: get_locale ( ) ; if ( ! empty ( static :: $ cache_languages [ $ locale ] ) ) { return static :: $ cache_languages [ $ locale ] ; } // Localise all languages $ languages = $ this -> config ( ) -> get ( 'languages' ) ; $ localised = [ ] ; foreach ( $ languages as $ code => $ default ) { $ localised [ $ code ] = $ this -> languageName ( $ code ) ; } // Save cache static :: $ cache_languages [ $ locale ] = $ localised ; return $ localised ; }
Get all language codes and names

@return array Map of language code => name
Get all language codes and names