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;
    }
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;
    }
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 ; }
Retrieves language codes in quality order
Builds array containing two letter language codes sorted by quality codes

@return array
Retrieves language codes in quality order Builds array containing two letter language codes sorted by quality codes