public function handle()
    {
        foreach ($this->loaders as $loader) {
            if ($language = call_user_func($loader)) {
                if (in_array($language, $this->supportedLanguages)) {
                    return $language;
                }

                $special = strpos($language, '-') !== false;
                if ($special && $this->allowFallback &&
                    in_array(substr($language, 0, 2), $this->supportedLanguages)) {
                    return substr($language, 0, 2);
                }

                if ( ! $special && $this->allowAdvance) {
                    foreach ($this->supportedLanguages as $supportedLanguage) {
                        if ($language === substr($supportedLanguage, 0, 2)) {
                            return $supportedLanguage;
                        }
                    }
                }
            }
        }

        return false;
    }
public function handle()
    {
        foreach ($this->loaders as $loader) {
            if ($language = call_user_func($loader)) {
                if (in_array($language, $this->supportedLanguages)) {
                    return $language;
                }

                $special = strpos($language, '-') !== false;
                if ($special && $this->allowFallback &&
                    in_array(substr($language, 0, 2), $this->supportedLanguages)) {
                    return substr($language, 0, 2);
                }

                if ( ! $special && $this->allowAdvance) {
                    foreach ($this->supportedLanguages as $supportedLanguage) {
                        if ($language === substr($supportedLanguage, 0, 2)) {
                            return $supportedLanguage;
                        }
                    }
                }
            }
        }

        return false;
    }
public function handle ( ) { foreach ( $ this -> loaders as $ loader ) { if ( $ language = call_user_func ( $ loader ) ) { if ( in_array ( $ language , $ this -> supportedLanguages ) ) { return $ language ; } $ special = strpos ( $ language , '-' ) !== false ; if ( $ special && $ this -> allowFallback && in_array ( substr ( $ language , 0 , 2 ) , $ this -> supportedLanguages ) ) { return substr ( $ language , 0 , 2 ) ; } if ( ! $ special && $ this -> allowAdvance ) { foreach ( $ this -> supportedLanguages as $ supportedLanguage ) { if ( $ language === substr ( $ supportedLanguage , 0 , 2 ) ) { return $ supportedLanguage ; } } } } } return false ; }
Run all loaders returns a language string or false.

@return bool|string
Run all loaders returns a language string or false .