Get all languages.

@param bool $hydrate

@return array
10258
public static function languages($hydrate = false)
    {
        if (! isset(static::$languages)) {
            static::$languages = json_decode(static::getFile(__DIR__.'/../resources/languages.json'), true);
        }

        return $hydrate ? array_map(function ($language) {
            return new Language($language);
        }, static::$languages) : static::$languages;
    }
766449
public static function languages(string $locale = 'en') : Collection
    {
        return Collection::make(include __DIR__ . "/../../../umpirsky/language-list/data/{$locale}/language.php")->map(function ($lang) {
            return ucfirst($lang);
        });
    }
1047560
public function getLanguages()
    {
        $url = $this->getGetLanguagesUrl();
        $response = $this->sendRequest(
            'GET',
            $url,
            [
                'version' => $this->serviceProtocolVersion
            ]
        );
        if ($response->getStatusCode() === 200) {
            $languages = $this->parseGetLanguagesResponse($response);
            return $languages;
        }
        return false;
    }
1253315
public function getchangedI18N($locale=null) {
		if(!$locale)
			return array_keys($this->translationschanged);
		elseif(isset($this->translationschanged[$locale]))
			return array_keys($this->translationschanged[$locale]);
		else
			return [];
	}
35581
protected function getHydrationElements($elements)
    {
        $elements = ($elements ?: $this->config->get('hydrate.elements'));

        if (is_string($elements) || is_numeric($elements)) {
            return [$elements => true];
        }

        return $this->checkHydrationElements($elements);
    }
1293440
public function getRules($ruleset)
    {
        if ($ruleset == self::YANDEX) {

            $russianRules = parent::getRules('russian');
            /**
             * @see http://translit-online.ru/yandex.html
             */
            return array_merge($russianRules, [
                //kh после букв c,s,e,h ; в остальных случаях - h
                /*'цх' => 'ckh',
                'ЦХ' => 'CKh',
                'Цх' => 'Ckh',
                'цХ' => 'cKh',

                'сх'  => 'skh',
                'СХ'  => 'SKh',
                'Сх'  => 'Skh',
                'сХ'  => 'sKh',

                //TODO: доделать комбинации больших маленьких букв
                'ех'  => 'еkh',
                'ёх'  => 'еkh',
                'эх'  => 'еkh',

                'чх' => 'chkh',
                'хх' => 'khkh',
                'шх' => 'shkh',
                'щх' => 'shchkh',
                'жх' => 'zhkh',

                'хх' => 'hkh',

                'hх' => 'hkh',*/

                'ё' => 'yo',
                'Ё' => 'Yo',

                'й' => 'j',
                'Й' => 'J',

                /*'х' => 'h',
                'Х' => 'H',*/

                'х' => 'х',
                'Х' => 'Х',

                'ц' => 'c',
                'Ц' => 'C',

                'щ' => 'shch',
                'Щ' => 'Shch',

                'э' => 'eh',
                'Э' => 'Eh',
            ]);
        }

        return parent::getRules($ruleset);
    }
73838
private function getLanguages($options)
    {
        if (!empty($options['lang'])) {
            return Text::getArrayFromString($options['lang']);
        }

        return $this->siteAccessHelper->getLanguages($options['mandatorId'], $options['siteaccess']);
    }
805308
public function getList($area, $locale)
    {
        $model = $this->app->make($this->model());
        $group = str_replace(["\n", "\r", ' '], '', $this->app->make('languages')->getTranslationNamedGroup());

        return $model->where('area', $area)->where(function($query) use($locale, $group) {
                    $query->where('locale', $locale);
                    if (strlen($group) > 0) {
                        $query->where('group', $group);
                    }
                });
    }
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;
    }
102030
public function getSiteLanguages()
    {
        if (empty($this->currentSiteLanguages)) {
            $this->currentSiteLanguages = $this->getSite()['languages'];
        }

        return $this->currentSiteLanguages;
    }
803972
public static function hydrateCollection(array $languages)
    {
        $hydrated = [];

        foreach ($languages as $language) {
            $hydrated[] = self::hydrate($language);
        }

        return $hydrated;
    }
488919
static function fetchByLocale( $locale, $createIfNotExist = false )
    {
        $languages = eZContentLanguage::fetchList();

        foreach ( $languages as $language )
        {
            if ( $language->attribute( 'locale' ) == $locale )
            {
                return $language;
            }
        }

        $language = false;
        if ( $createIfNotExist )
        {
            $language = eZContentLanguage::addLanguage( $locale );
        }

        return $language;
    }
756417
public function getAll(array $queryParams = [])
    {
        $response = $this->api->languages()->getAll($queryParams);

        return new LanguagesResponse($response);
    }
268832
private function fetchLocales($available = true)
    {
        $available_locales = $this->getAvailableLocales();
        $current_locales = $this->translations()->lists('locale')->toArray();

        return array_filter($available_locales, function ($v) use ($current_locales, $available) {
            return $available ? in_array($v, $current_locales) : !in_array($v, $current_locales);
        }, ARRAY_FILTER_USE_BOTH);
    }
1091152
public function get_supported_languages($full_names=false)
    {
        // return array
        $back = array();

        // we walk the lang root
        $dir = dir($this->language_path);

        // foreach entry
        while (false !== ($entry = $dir->read()))
        {
            $full_path = $this->language_path.$entry;

            // Skip all dirs
            if (is_dir($full_path)) {
                continue;
            }

            // we only want lang.php files
            if (!preg_match('/^([^.]+)\.php$/', $entry, $matches)) {
                continue;
            }

            // Raw lang name is here
            $langname = $matches[1];

            // We want the fullname too?
            if ($full_names === true)
            {
                if (false !== ($fullname = $this->get_language_fullname($langname)))
                {
                    $back[$langname] = $fullname; // we go associative
                }
            }
            else
            {
                // just store raw langname
                $back[] = $langname;
            }
        }

        $dir->close();

        return $back;
    }
1064496
protected function getAllLanguagesFromTable(): void
    {
    	foreach($this->translations  as $entry){
    		if(!in_array($entry->language, $this->languages)){
    			array_push($this->languages, $entry->language);
		    }
	    }
	    $this->compareLanguages();
    }
410464
public function german2English($sDate)
    {
        $aDate = explode(".", $sDate);

        if (isset($aDate) && count($aDate) > 1) {
            if (count($aDate) == 2) {
                $sDate = $aDate[1] . "-" . $aDate[0];
            } else {
                $sDate = $aDate[2] . "-" . $aDate[1] . "-" . $aDate[0];
            }
        }

        return $sDate;
    }