Return the list of languages from system locales. Regardless of culture.

@return type array("en" => "English", ...)
439064
static public function getAvailableDisplayCulture($symbol = null) {
        $locales = self::getAvailableDisplaySystemLocales(Locale::getDefault());

        $langues = array();
        foreach ($locales as $locale) {

            $symbole = Locale::getPrimaryLanguage($locale) . "_" . Locale::getRegion($locale);
            if ($symbol != null) {
                if (Locale::getPrimaryLanguage($locale) == $symbol) {
                    $langues[$symbole] = Locale::getDisplayRegion($locale);
                }
            } else {
                $langues[$symbole] = Locale::getDisplayRegion($locale);
            }
        }
        
        return array_unique($langues);
    }
769768
public function getLocales()
	{
		$currentLocales = array();
		
		foreach($this->localeCategories as $category) {
			if($category === LC_ALL)
				continue;
			
			$currentLocales[$category] = setlocale($category, 0);
		}
		
		return $currentLocales;
	}
895256
public function fetchAll()
    {
        if (static::$languages === null) {
            static::$languages = $this->driver()->fetchAll();

            static::$languages = array_map(function ($language) {
                return new Locale($language);
            }, static::$languages);
        }

        return static::$languages;
    }
630682
public function getLanguages()
    {
        if ($this->_languages === null) {
            $this->_languages = (new DbQuery())->select(['short_code', 'id'])->indexBy('short_code')->from('admin_lang')->all();
        }

        return $this->_languages;
    }
12914
protected function getLocaleChoices()
    {
        $locale = [];

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

        return $locale;
    }
224387
public List<ULocale> getLocales() {
        List<ULocale> result;
        if (locales == null) {
            result = guessLocales();
        } else {
            result = new ArrayList<ULocale>();
            result.addAll(locales);
        }
        return result;
    }
918415
public static function optionsActiveLanguages(): array
    {
        $languages = [];
        foreach (I18N::activeLocales() as $locale) {
            $languages[$locale->languageTag()] = $locale->endonym();
        }

        return $languages;
    }
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;
    }
1161034
public function listLanguages(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/languages', $this->getOwner(),
            $this->getRepo()));
    }
641364
private static function getLangs() 
  {
    if (self::$langs === null) {

      // Load available languages from `resources/lang`.
      self::$langs = [];
      $langPath = base_path() . '/resources/lang/';
      if (!is_dir($langPath)) {
        error_log("The directory /resources/lang/' doesn't exists.");
        throw new PathNotFoundException();
      }
      $iter = new \FilesystemIterator($langPath);
      foreach ($iter as $fileInfo) {
        if ($fileInfo->isDir()) {
          self::$langs[] = $fileInfo->getFilename();
        }
      } // foreach

    } // if

    return self::$langs;
  }
427794
public function languageNameArray()
    {
        $languageNameArray = array();
        $translations = $this->getTranslations();

        foreach ( $translations as $translation )
        {
            $languageName = $translation->languageName();

            if ( is_array( $languageName ) )
                $languageNameArray[$languageName['locale']] = $languageName['name'];
        }

        return $languageNameArray;
    }
593996
public static function get_content_languages()
    {
        $table = Versioned::current_stage() == 'Live' ? 'SiteTree_Live' : 'SiteTree';

        if (class_exists('SQLSelect')) {
            $query = new SQLSelect("Distinct \"Locale\"", "\"$table\"");
        } else {
            // SS 3.1 compat
            $query = new SQLQuery("Distinct \"Locale\"", array("\"$table\""));
        }

        $query = $query->setGroupBy('"Locale"');
        $dbLangs = $query->execute()->column();

        $langlist = array_merge((array)Translatable::default_locale(), (array)$dbLangs);
        $returnMap = array();
        $allCodes = array_merge(
            Config::inst()->get('i18n', 'all_locales'),
            Config::inst()->get('i18n', 'common_locales')
        );
        foreach ($langlist as $langCode) {
            if ($langCode && isset($allCodes[$langCode])) {
                if (is_array($allCodes[$langCode])) {
                    $returnMap[$langCode] = $allCodes[$langCode]['name'];
                } else {
                    $returnMap[$langCode] = $allCodes[$langCode];
                }
            }
        }
        return $returnMap;
    }
168360
public function getLanguages()
    {
        if (!isset($this->languages))
        {
            $this->_languages = array();

            if($this->_headers->has('Accept-Language'))
            {
                $accept    = $this->_headers->get('Accept-Language');
                $languages = $this->__parseAccept($accept);

                foreach (array_keys($languages) as $lang)
                {
                    if (strstr($lang, '-'))
                    {
                        $codes = explode('-', $lang);
                        if ($codes[0] == 'i')
                        {
                            // Language not listed in ISO 639 that are not variants
                            // of any listed language, which can be registered with the
                            // i-prefix, such as i-cherokee
                            if (count($codes) > 1) {
                                $lang = $codes[1];
                            }
                        }
                        else
                        {
                            for ($i = 0, $max = count($codes); $i < $max; $i++)
                            {
                                if ($i == 0) {
                                    $lang = strtolower($codes[0]);
                                } else {
                                    $lang .= '_'.strtoupper($codes[$i]);
                                }
                            }
                        }
                    }

                    $this->_languages[] = $lang;
                }
            }
        }

        return $this->_languages;
    }
593025
public function languages()
    {
        $languages = [];

        foreach ($this->language->getRegistry() as $language) {
            $languages[ $language->getParameter() ] = $language->getProperties()->name;
        }

        return $languages;
    }
704620
private function getLanguages()
    {
        $directories = glob($this->basePath.'/*', GLOB_ONLYDIR);

        $languages = array_map(function ($dir) {
            $name = basename($dir);

            return in_array($name, $this->excluded, true) ? null : $name;
        }, $directories);

        return array_filter($languages);
    }
1370984
public function getLocales()
    {
        $locales = $this->serviceManager->get('playgroundcore_locale_service')->getLocaleMapper()->findAll();
        $localesForm = array();
        foreach ($locales as $key => $locale) {
            $localesForm[$locale->getLocale()] = $locale->getName(). " (".$locale->getLocale().")";
        }
        return $localesForm;
    }
784589
@Override
    public Enumeration<Locale> getLocales() {
        if (null == this.locales) {
            this.locales = connection.getEncodingUtils().getLocales(this.request.getHeader("Accept-Language"));
        }
        return Collections.enumeration(this.locales);
    }