Finds the system's configured languages.

@return array An array of language IDs
963141
public function findSystemLanguages()
    {
        $languages = [0];

        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(HiddenRestriction::class));
        $languageRecords = $queryBuilder->select('uid')
            ->from($this->table)
            ->execute()->fetchAll();

        if ($languageRecords == false) {
            return $languages;
        }

        foreach ($languageRecords as $languageRecord) {
            $languages[] = $languageRecord['uid'];
        }
        return $languages;
    }
277120
function languages()
    {
        // trust configuration
        $configured = $this->rc->config->get('spellcheck_languages');
        if (!empty($configured) && is_array($configured) && !$configured[0]) {
            return $configured;
        }
        else if (!empty($configured)) {
            $langs = (array)$configured;
        }
        else if ($this->backend) {
            $langs = $this->backend->languages();
        }

        // load index
        @include(RCUBE_LOCALIZATION_DIR . 'index.inc');

        // add correct labels
        $languages = array();
        foreach ($langs as $lang) {
            $langc = strtolower(substr($lang, 0, 2));
            $alias = $rcube_language_aliases[$langc];
            if (!$alias) {
                $alias = $langc.'_'.strtoupper($langc);
            }
            if ($rcube_languages[$lang]) {
                $languages[$lang] = $rcube_languages[$lang];
            }
            else if ($rcube_languages[$alias]) {
                $languages[$lang] = $rcube_languages[$alias];
            }
            else {
                $languages[$lang] = ucfirst($lang);
            }
        }

        // remove possible duplicates (#1489395)
        $languages = array_unique($languages);

        asort($languages);

        return $languages;
    }
1029376
public function getLangNames() {
		// Lazy-load and cache
		if ( $this->langNames === null ) {
			$path = $this->localBaseDir . '/language/mw-classes/Names.php';
			// @codeCoverageIgnoreStart
			if ( !is_readable( $path ) ) {
				$this->errTrigger( 'Names.php is missing', __METHOD__, E_NOTICE );
				$this->langNames = [];
				return [];
			}
			// @codeCoverageIgnoreEnd

			// Load it
			require_once $path;
			$this->langNames = \MediaWiki\Languages\Data\Names::$names;
		}

		return $this->langNames;
	}
1006693
public function getAvailableLanguages()
    {
        $translationSiteAccesses = $this->configResolver->getParameter('translation_siteaccesses');
        $relatedSiteAccesses = $translationSiteAccesses ?: $this->configResolver->getParameter('related_siteaccesses');
        $availableLanguages = array();
        $currentLanguages = $this->configResolver->getParameter('languages');
        $availableLanguages[] = array_shift($currentLanguages);

        foreach ($relatedSiteAccesses as $sa) {
            $languages = $this->configResolver->getParameter('languages', null, $sa);
            $availableLanguages[] = array_shift($languages);
        }

        sort($availableLanguages);

        return array_unique($availableLanguages);
    }
601937
public function getRootPageLanguageIds() : array
    {
        $rootPageLanguageIds = [];
        $rootPageId = $this->getRootPageId();
        $rootPageOverlays = $this->pagesRepository->findTranslationOverlaysByPageId($rootPageId);
        if (count($rootPageOverlays)) {
            foreach ($rootPageOverlays as $rootPageOverlay) {
                $rootPageLanguageIds[] = $rootPageOverlay['sys_language_uid'];
            }
        }
        return $rootPageLanguageIds;
    }
155725
public function getLanguageList() {
		$files = glob($this->getPath().'messages_*.php');
		
		$startAt = strlen('messages_');
		$languages = array();
		foreach ($files as $file) {
			$base = basename($file);
			$languages[] = substr($base, $startAt, strrpos($base, '.php') - $startAt);
		}
		return $languages;
	}
1329391
protected function initLanguages()
    {
        $this->languageIdList[0] = 0;

        $query      = 'SELECT uid
                         FROM sys_language
                        WHERE hidden = 0';
        $langIdList = DatabaseUtility::getColWithIndex($query);

        $this->languageIdList = $langIdList;
    }
188840
public function getAvailableLanguages()
    {
        if (!empty($this->owner->{$this->translationsAttribute})) {
            return array_keys($this->owner->{$this->translationsAttribute});
        }
        return null;
    }
193008
function languages()
    {
        $defaults = array('en');
        $langs = array();

        // get aspell dictionaries
        exec('aspell dump dicts', $dicts);
        if (!empty($dicts)) {
            $seen = array();
            foreach ($dicts as $lang) {
                $lang = preg_replace('/-.*$/', '', $lang);
                $langc = strlen($lang) == 2 ? $lang.'_'.strtoupper($lang) : $lang;
                if (!$seen[$langc]++)
                    $langs[] = $lang;
            }
            $langs = array_unique($langs);
        }
        else {
            $langs = $defaults;
        }

        return $langs;
    }
453517
public function getAvailableLanguages()
    {
        $languages = [];

        $paths = $this->fileSystem->getDirectories($this->getLanguagesPath());

        foreach ($paths as $path) {
            $languages[] = substr($path, strlen($this->getLanguagesPath()) + 1);
        }

        return $languages;
    }
1193857
public function availableLanguages()
    {
        $languages = array();
        $languageObjects = $this->languages();

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

        return $languages;
    }
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);
    }
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;
  }
782513
protected function getLanguage()
    {
        $output = [];
        // Get the language that be for default.
        $default_id = $this->languageManager->getDefaultLanguage()->getId();
        foreach ($this->languageManager->getLanguages() as $key => $value) {
            if ($default_id == $key) {
                $output[] = '';
            } else {
                $output[] = 'language.' . $value->getId();
            }
        }
        return $output;
    }
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;
    }
1259574
def languages
      if default_language != nil
        # Use specified default language as primary language
        [default_language]
      else
        # Calculate the intersection of native development and used languages,
        # fallback to the latter only, if it is empty
        languages = native_dev_languages & used_languages
        if languages.empty?
          used_languages
        else
          languages
        end
      end
    end