Templatable list of all locales

@return ArrayList
426334
public function Locales()
    {
        $data = [];
        foreach (Locale::getCached() as $localeObj) {
            /** @var Locale $localeObj */
            $data[] = $this->owner->LocaleInformation($localeObj->getLocale());
        }
        return ArrayList::create($data);
    }
705319
private function getIso3166Countries(): array
    {
        $countries = $this->country_service->getAllCountries();

        // Get the country names for each language
        $country_to_iso3166 = [];

        foreach (I18N::activeLocales() as $locale) {
            I18N::init($locale->languageTag());

            foreach ($this->country_service->iso3166() as $three => $two) {
                $country_to_iso3166[$three]             = $two;
                $country_to_iso3166[$countries[$three]] = $two;
            }
        }

        return $country_to_iso3166;
    }
1331216
static function fetchLocaleList()
    {
        $languages = eZContentLanguage::fetchList();
        $localeList = array();

        foreach ( $languages as $language )
        {
            $localeList[] = $language->attribute( 'locale' );
        }

        return $localeList;
    }
106226
public List<Locale> getSecondaryTranslationLocales() {

        List<Locale> result = Lists.newArrayList();
        Map<String, String> params = getParameters();
        String value = params.get(PARAM_SECONDARY_LOCALES);
        if (!CmsStringUtil.isEmpty(value)) {
            String[] tokens = value.trim().split(" *, *");
            for (String token : tokens) {
                Locale locale = CmsLocaleManager.getLocale(token);
                if (!result.contains(locale)) {
                    result.add(locale);
                }
            }
        }
        return result;
    }
988883
public List<LocaleBean> getLocales(Locale currentLocale) {
        List<LocaleBean> locales = new ArrayList<>();

        // get the array of locales available from the portal
        List<Locale> portalLocales = localeManagerFactory.getPortalLocales();
        for (Locale locale : portalLocales) {
            if (currentLocale != null) {
                // if a current locale is available, display language names
                // using the current locale
                locales.add(new LocaleBean(locale, currentLocale));
            } else {
                locales.add(new LocaleBean(locale));
            }
        }
        return locales;
    }
219638
public static function getAvailableLocalesInfo()
    {
        $languages = [];
        foreach (static::getAvailableLocales() as $id) {
            $languages[$id] = new Language($id);
        }

        return $languages;
    }
538121
protected function getLocales()
    {
        return \localizer\locales()->reduce(function ($ids, $locale) {
            $ids[] = $locale->id();

            return $ids;
        }, []);
    }
706384
public function getDisplayLocales()
    {
        $locales = array();

        foreach ($this->allowedLocales as $locale) {
            $locales[$locale] = \Locale::getDisplayName($locale);
        }

        return $locales;
    }
1056277
public function availableLocales()
    {
        $locales = $this->getCore()->config('locale.translation-locales');

        if (is_array($locales)) {
            return $locales;
        }

        return $this->getLocaleRepository()->getAvailable();
    }
694937
public function getUsedLocales()
    {
        $queryBuilder = $this->createQueryBuilder('blog')
            ->select('DISTINCT(b_translation.locale) AS locale')
            ->join('blog.translations', 'b_translation');

        $locales = [];
        foreach ($queryBuilder->getQuery()->getResult() as $locale) {
            $locales[] = $locale['locale'];
        }

        return $locales;
    }
379430
public static function languagesLocaleCodes()
    {
        static $list;

        if ($list === null) {
            $list = [];
            foreach (static::codes() as $localeCode) {
                if ($languageCode = static::languageCode($localeCode)) {
                    $list[$languageCode][] = $localeCode;
                }
            }
        }

        return $list;
    }
332591
public static function getAvailableLanguages(){
        $languages = array();
        foreach(common_ext_ExtensionsManager::singleton()->getInstalledExtensions() as $extension){
           $localesDir = $extension->getDir() . 'locales/';
           foreach(glob($localesDir . '*') as  $file){
                if(is_dir($file) && file_exists($file . '/messages.po')){
                    $lang = basename($file);
                    if(!in_array($lang, $languages)){
                        $languages[] = $lang;
                    }
                }
           }
        } 
        return $languages;
    }
769335
protected static function get_target_locales()
    {
        // if locales are explicitly set, use these
        if (is_array(self::config()->locales)) {
            return (array)self::config()->locales;
            // otherwise check the allowed locales. If these have been set, use these
        } else if (is_array(Translatable::get_allowed_locales())) {
            return (array)Translatable::get_allowed_locales();
        }

        // last resort is to take the existing content languages
        return array_keys(Translatable::get_existing_content_languages());
    }
651665
public List<FacesConfigLocaleConfigType<FacesConfigApplicationType<T>>> getAllLocaleConfig()
   {
      List<FacesConfigLocaleConfigType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigLocaleConfigType<FacesConfigApplicationType<T>>>();
      List<Node> nodeList = childNode.get("locale-config");
      for(Node node: nodeList)
      {
         FacesConfigLocaleConfigType<FacesConfigApplicationType<T>>  type = new FacesConfigLocaleConfigTypeImpl<FacesConfigApplicationType<T>>(this, "locale-config", childNode, node);
         list.add(type);
      }
      return list;
   }
325586
public function locales()
    {
        if ($this->locales) {
            return $this->locales;
        }

        $cfg = $this->app()->config();
        $locales = isset($cfg['locales']) ? $cfg['locales'] : [];
        $languages = isset($locales['languages']) ? $locales['languages'] : [];
        $file = isset($locales['file']) ? $locales['file'] : $this->argOrInput('output');
        // Default to FR
        $default = isset($locales['default_language']) ? $locales['default_language'] : 'fr';

        $this->locales = [
            'languages' => $languages,
            'file' => $file,
            'default_language' => $default
        ];
        return $this->locales;
    }
918415
public static function optionsActiveLanguages(): array
    {
        $languages = [];
        foreach (I18N::activeLocales() as $locale) {
            $languages[$locale->languageTag()] = $locale->endonym();
        }

        return $languages;
    }
625970
public function getAllTranslationByLanguage()
    {
        $messages = array();
        foreach ($this->getLanguageList() as $language) {
            $messages[$language] = $this->getTranslationsForLanguage($language);
        }

        return $messages;
    }