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

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

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

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

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

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