Returns all defined languages as a flat array

@return array
10627
public function getAllFlat()
    {
        $aOut       = [];
        $aLanguages = $this->getAll();

        foreach ($aLanguages as $oLanguage) {
            $aOut[$oLanguage->code] = $oLanguage->label;
        }

        return $aOut;
    }
538905
protected function getLanguagesInstall()
    {
        $languages = array();

        foreach ($this->language->getList() as $code => $language) {
            if ($code === 'en' || is_file($this->translation->getFile($code))) {
                $languages[$code] = $language;
            }
        }

        return $languages;
    }
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;
    }
1338537
public function list_languages()
    {
        static $sa_languages = array();

        if (!count($sa_languages)) {
            @include(RCUBE_LOCALIZATION_DIR . 'index.inc');

            if ($dh = @opendir(RCUBE_LOCALIZATION_DIR)) {
                while (($name = readdir($dh)) !== false) {
                    if ($name[0] == '.' || !is_dir(RCUBE_LOCALIZATION_DIR . $name)) {
                        continue;
                    }

                    if ($label = $rcube_languages[$name]) {
                        $sa_languages[$name] = $label;
                    }
                }
                closedir($dh);
            }
        }

        return $sa_languages;
    }
219638
public static function getAvailableLocalesInfo()
    {
        $languages = [];
        foreach (static::getAvailableLocales() as $id) {
            $languages[$id] = new Language($id);
        }

        return $languages;
    }
232078
public function keys()
    {
        $locales = array_map(function (LocaleCollection $locales) {
            $keys = $locales->keys()->toArray();
            return array_combine($keys, $keys);
        }, $this->locales);

        $all = [];

        foreach ($locales as $keys) {
            $all = array_merge($all, $keys);
        }

        return $all;
    }
1161034
public function listLanguages(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/languages', $this->getOwner(),
            $this->getRepo()));
    }
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;
    }
1067868
public static function getLanguages() {
    if(null === self::$languages) {
      // The pattern to match languages.
      $pattern = '/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i';

      // Get a list of languages.
      $languages = explode(',', @trim($_SERVER['HTTP_USER_AGENT']));

      // Any matches?
      $matches = array();
      if(preg_match($pattern, $languages, $matches) && 0 < count($matches[1])) {
        self::$languages = array_combine($matches[1], $matches[4]);
      } else {
        self::$languages = [];
      }
    }
    return self::$languages;
  }
410021
public function getLanguages()
    {
        if (null !== $this->languages) {
            return $this->languages;
        }

        $languages = $this->headers->getParameterListAsObject('Accept-Language');
        //@TODO convert comma seperated list to Array
        $this->languages = [];

        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;
    }
921158
public function toArray()
	{
		$list = parent::toArray();

		$list['locale.languageid'] = $this->getLanguageId();
		$list['locale.currencyid'] = $this->getCurrencyId();
		$list['locale.position'] = $this->getPosition();
		$list['locale.status'] = $this->getStatus();

		return $list;
	}
198653
public function getLanguages()
    {
        if (!empty($this->languages)) {
            return $this->languages;
        }

        $this->languages = array_map(
            function ($record) {
                return $record['_id'];
            },
            $this->languageCollection->find([], ['_id' => 1])->toArray()
        );

        asort($this->languages);

        $this->languages = array_values($this->languages);

        return $this->languages;
    }
66832
public function getAvailableInLangs()
    {
        $languages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames();

        $objFields = $this->_getTableFields(
            getViewName($this->_sCoreTable, -1, -1),
            true
        );
        $multiLangFields = [];

        //selecting all object multilang fields
        foreach ($objFields as $key => $value) {
            //skipping oxactive field
            if (preg_match('/^oxactive(_(\d{1,2}))?$/', $key)) {
                continue;
            }

            $fieldLang = $this->_getFieldLang($key);

            //checking, if field is multilanguage
            if ($this->isMultilingualField($key) || $fieldLang > 0) {
                $newKey = preg_replace('/_(\d{1,2})$/', '', $key);
                $multiLangFields[$newKey][] = (int) $fieldLang;
            }
        }

        // if no multilanguage fields, return default languages array
        if (count($multiLangFields) < 1) {
            return $languages;
        }

        // select from non-multilanguage core view (all ml tables joined to one)
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
        $query = "select * from " . getViewName($this->_sCoreTable, -1, -1) . " where oxid = " . $db->quote($this->getId());
        $rs = $db->getAll($query);

        $notInLang = $languages;

        // checks if object field data is not empty in all available languages
        // and formats not available in languages array
        if (isset($rs[0]) && is_array($rs[0]) && count($rs[0])) {
            foreach ($multiLangFields as $fieldId => $multiLangIds) {
                foreach ($multiLangIds as $multiLangId) {
                    $fieldName = ($multiLangId == 0) ? $fieldId : $fieldId . '_' . $multiLangId;
                    if ($rs[0][strtoupper($fieldName)]) {
                        unset($notInLang[$multiLangId]);
                        continue;
                    }
                }
            }
        }

        return array_diff($languages, $notInLang);
    }
90931
function languages()
    {
        $this->init();

        $langs = array();
        if ($dicts = enchant_broker_list_dicts($this->enchant_broker)) {
            foreach ($dicts as $dict) {
                $langs[] = preg_replace('/-.*$/', '', $dict['lang_tag']);
            }
        }

        return array_unique($langs);
    }
556887
public static function getLocales()
    {
        $localeDir     = __DIR__.'/../locales';
        $languageFiles = scandir($localeDir);
        $locales       = [];
        foreach ($languageFiles as $languageFile) {
            if (in_array($languageFile, ['.', '..'])) {
                continue;
            }
            $extensionPos = strpos($languageFile, '.yml');
            if ($extensionPos !== false) {
                $locale    = substr($languageFile, 0, $extensionPos);
                $locales[] = $locale;
            }
        }
        sort($locales);
        return $locales;
    }
1021056
public function loadLanguages()
    {
        $languages = $this->languageHandler->loadAll();

        $returnArray = array();
        foreach ($languages as $language) {
            $returnArray[] = $this->buildDomainObject($language);
        }

        return $returnArray;
    }
140908
protected function getContentLanguageCodes()
    {
        return array_map(
            function($language) {
                return $language->languageCode;
            },
            array_filter(
                $this->repository->getContentLanguageService()->loadLanguages(),
                function ($language) {
                    return $language->enabled;
                }
            )
        );
    }