get client supported languages from header
eg: `Accept-Language:zh-CN,zh;q=0.8`
@return array
974993
public function getAcceptLanguages(): array
    {
        $ls = [];

        if ($value = $this->getLine('Accept-Language')) {
            if (\strpos($value, ';')) {
                [$value,] = \explode(';', $value, 2);
            }

            $value = \str_replace(' ', '', $value);
            $ls    = \explode(',', $value);
        }

        return $ls;
    }
1026689
public function getLanguages()
    {
        if (!is_array($this->languages)) {
            LanguageDetector::detect($this, $this->getAcceptLanguage());
        }

        return $this->languages;
    }
1357762
private function getHeaders() {
        $headers = array('Accept-Language: '.$this->locale);
        
        if($this->user_authorization) {
            $headers[] = 'Authorization: Bearer '.$this->token;
        } else {
            $headers[] ='Authorization: Token '.$this->token;
        }
        return $headers;
    }
823347
protected function resolveLanguages()
    {
        if (!$this->get('accept_language')) {
            return [];
        }

        $codes = $this->extractHeaders();

        $languages = array();
        foreach ($codes as $lang) {
            if (strpos($lang, '-') !== false) {
                $codes = explode('-', $lang);
                $lang = strtolower($codes[0]);
            }

            if (in_array($lang, $languages)) {
                continue;
            }

            $languages[] = $lang;
        }

        return $languages;
    }
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;
    }
440528
public function getEncodings()
    {
        if (null !== $this->encodings) {
            return $this->encodings;
        }
        $charsets = $this->headers->getParameterListAsObject('ACCEPT_ENCODINGS');

        return $this->encodings = $encodings->getParameterKeys();
    }
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;
    }
963561
public function clientLang()
	{
		if ( isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) {

			$language = explode(',', preg_replace('/(;\s?q=[0-9\.]+)|\s/i', '', strtolower(trim($_SERVER['HTTP_ACCEPT_LANGUAGE']))));
			return strtolower($language[0]);
		}

		return;
	}
212511
public function getDefaultHeaders()
    {
        return [
            'User-Agent' => 'plivo-php/' . implode('.',
                    [Version::MAJOR, Version::MINOR, Version::PATCH])
                    . ' (PHP ' . $this->phpVersion . ')',
            'Accept-Encoding' => '*',
            'Content-type' => 'application/json'
        ];
    }
366986
public function supportedTypes()
    {
        return [
            self::TYPE_FIFO,
            self::TYPE_CHAR,
            self::TYPE_DIR,
            self::TYPE_BLOCK,
            self::TYPE_LINK,
            self::TYPE_FILE,
            self::TYPE_SOCKET,
            self::TYPE_UNKNOWN
        ];
    }
635656
public function getBrowserAcceptLanguages(Request $request)
    {
        $browserLanguages = [];

        if (strlen($request->server->get('HTTP_ACCEPT_LANGUAGE')) == 0) {
            return [];
        }

        $languages = $this->splitHttpAcceptHeader(
            $request->server->get('HTTP_ACCEPT_LANGUAGE')
        );
        foreach ($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]);
                        }
                    }
                }
            }

            $browserLanguages[] = $lang;
        }

        return $browserLanguages;
    }
119087
public function getSupportedLanguages(): array
    {
        if (null === $this->supportedLanguages) {
            $process = $this->createProcess('dump dicts');
            $process->run();
            if (!$process->isSuccessful()) {
                throw new ExternalProgramFailedException(
                    $process->getCommandLine(),
                    $process->getErrorOutput(),
                    $process->getExitCode()
                );
            }

            $languages = [];

            $output = explode(PHP_EOL, $process->getOutput());
            foreach ($output as $line) {
                $name = trim($line);
                if (strpos($name, '-variant') !== false) {
                    // Skip variants
                    continue;
                }
                $languages[$name] = true;
            }

            $languages = array_keys($languages);
            sort($languages);
            $this->supportedLanguages = $languages;
        }

        return $this->supportedLanguages;
    }
829752
public Iterator<Locale> getAcceptLanguages() {
		LinkedList<Locale> ll = new LinkedList<Locale>();
		Iterator<Header> it = (Iterator<Header>) this.message
				.getHeaders(AcceptLanguageHeader.NAME);
		while (it.hasNext()) {
			AcceptLanguageHeader alh = (AcceptLanguageHeader) it.next();
			ll.add(alh.getAcceptLanguage());
		}
		return ll.iterator();
	}
452074
public function getAcceptableLanguages()
    {
        if ($this->_languages === null) {
            if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
                $this->_languages = array_keys(static::parseAcceptHeader($_SERVER['HTTP_ACCEPT_LANGUAGE']));
            } else {
                $this->_languages = [];
            }
        }

        return $this->_languages;
    }
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;
    }
533898
public function getSupportedLanguages()
    {
        return array(
            self::LANG_SR,
            self::LANG_RU,
            self::LANG_BE,
            self::LANG_MK,
            self::LANG_UK,
            self::LANG_BG,
            self::LANG_EL
        );
    }
1161034
public function listLanguages(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/languages', $this->getOwner(),
            $this->getRepo()));
    }