Gets the system languages (IDs) for which Solr connections have been
configured.

@return array Array of system language IDs for which connections have been configured on this site.
346117
public function getAllLanguages(Site $site)
    {
        $siteLanguages = [];
        $servers = $this->getSolrServersFromRegistry();

        foreach ($servers as $connectionKey => $solrConnection) {
            list($siteRootPageId, $systemLanguageId) = explode('|', $connectionKey);

            if ($siteRootPageId == $site->getRootPageId()) {
                $siteLanguages[] = $systemLanguageId;
            }
        }

        return $siteLanguages;
    }
878492
public function getAvailableLanguages()
    {
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());

        // Sending service start event
        $arrayParameters = $this->sendEvent('melisengine_service_get_available_languages_start', $arrayParameters);

        // Service implementation start
        $langTable = $this->getServiceLocator()->get('MelisEngineTableCmsLang');
        $results = $langTable->fetchAll()->toArray();
        // Service implementation end

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $results;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melisengine_service_get_available_languages_end', $arrayParameters);

        return $arrayParameters['results'];
    }
482626
public function getAvailableLanguageCodes()
    {
        $cache = Cache::getTransientCache();
        $cacheId = 'transifex_languagescodes_' . $this->projectSlug;
        $languageCodes = $cache->fetch($cacheId);

        if (empty($languageCodes)) {
            $apiData = $this->getApiResults('project/' . $this->projectSlug . '/languages');
            foreach ($apiData as $languageData) {
                $languageCodes[] = $languageData->language_code;
            }
            $cache->save($cacheId, $languageCodes);
        }
        return $languageCodes;
    }
629133
public function languageString()
    {
        $data = $data1 = $data2 = [];
        $language = $this->getLang();
        if (file_exists(route()->locale."{$language}.php")) {
            $data1 += require route()->locale."{$language}.php";
        }
        $path = route()->com;
        $disk_scan = array_diff(scandir($path), ['..', '.']);
        foreach ($disk_scan as $scans) {
            if (file_exists($path.$scans."/Locale/{$language}.php")) {
                $data2 += require $path.$scans."/Locale/{$language}.php";
            }
        }
        $data = array_merge($data1, $data2);

        return $data;
    }
1029902
public function getSiblingLocales()
    {
        $domain = $this->getDomain();
        $locales = $domain
            ? $domain->getLocales()
            : Locale::getCached();
        return $locales;
    }
1066812
protected function getLanguageHelpers()
    {
        return [
            'lang' => function ($args, $named) {
                return Lang::get($args[0], $named);
            },
            'choice' => function ($args, $named) {
                return Lang::choice($args[0], $args[1], $named);
            }
        ];
    }
942467
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
863498
public static function getPairs(): array
    {
        $languages_from_site = new LanguageEntityRepository();

        // Default language for admin panel
        $default_languages = [
            Constants::ADMIN_LANGUAGE_DEFAULT_SHORT => Constants::ADMIN_LANGUAGE_DEFAULT_FULL
        ];

        return array_merge($default_languages, $languages_from_site->getPairs('full', 'short'));
    }
92157
public static function getLanguageNames($active = false)
    {
        $languageNames = [];
        foreach (self::getLanguages($active, true) as $language) {
            $languageNames[$language['language_id']] = $language['name'];
        }

        return $languageNames;
    }
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;
  }
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;
    }
550285
function languages()
    {
        $languages = array();

        $languageLocaleList = $this->languageLocaleList();
        foreach( $languageLocaleList as $languageLocale )
            $languages[$languageLocale] = eZContentLanguage::fetchByLocale( $languageLocale );

        return $languages;
    }
642990
protected function getPageTypes()
    {
        $pageTypes = array();
        foreach (SiteTree::page_type_classes() as $pageTypeClass) {
            $pageTypes[$pageTypeClass] = SiteTree::singleton($pageTypeClass)->i18n_singular_name();
        }
        asort($pageTypes);
        return $pageTypes;
    }
755274
public function getIndex()
    {
        $supportedLanguages = Request::getLanguages();
        $userLanguage = Config::get('app.locale');

        foreach ($supportedLanguages as $language) {
            $language = str_replace('_', '-', $language);

            if (isset($this->langs[$language])) {
                $userLanguage = $language;
                break;
            }
        }

        // Since .env may already be configured, we should show that data!
        $cacheConfig = [
            'driver' => Config::get('cache.default'),
        ];

        $sessionConfig = [
            'driver' => Config::get('session.driver'),
        ];

        $queueConfig = [
            'driver' => Config::get('queue.default'),
        ];

        $mailConfig = [
            'driver'   => Config::get('mail.driver'),
            'host'     => Config::get('mail.host'),
            'from'     => Config::get('mail.from'),
            'username' => Config::get('mail.username'),
            'password' => Config::get('mail.password'),
        ];

        return View::make('setup.index')
            ->withPageTitle(trans('setup.setup'))
            ->withCacheDrivers($this->cacheDrivers)
            ->withQueueDrivers($this->queueDrivers)
            ->withMailDrivers($this->mailDrivers)
            ->withUserLanguage($userLanguage)
            ->withAppUrl(Request::root())
            ->withCacheConfig($cacheConfig)
            ->withSessionConfig($sessionConfig)
            ->withQueueConfig($queueConfig)
            ->withMailConfig($mailConfig);
    }
280171
public static function getLanguageOptions()
    {
        $languages = array();

        foreach (self::$languages as $language) {
            $strings = array();
            require(PHPCI_DIR . 'PHPCI/Languages/lang.' . $language . '.php');
            $languages[$language] = $strings['language_name'];
        }

        return $languages;
    }
926454
public function getIndexQueueMonitoredTables()
    {
        $monitoredTables = [];

        $indexingConfigurations = $this->getEnabledIndexQueueConfigurationNames();
        foreach ($indexingConfigurations as $indexingConfigurationName) {
            $monitoredTable = $this->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName);
            $monitoredTables[] = $monitoredTable;
            if ($monitoredTable === 'pages') {
                // when monitoring pages, also monitor creation of translations
                $monitoredTables[] = 'pages_language_overlay';
            }
        }

        return array_values(array_unique($monitoredTables));
    }
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;
    }