protected function getLocaleFromUrl(string $url)
    {
        $locale = trim(substr($url, 0, 3), '/');
        if (strlen($locale) > 2 || strlen($locale) < 2) {
            return false;
        }

        return $locale;
    }
protected function getLocaleFromUrl(string $url)
    {
        $locale = trim(substr($url, 0, 3), '/');
        if (strlen($locale) > 2 || strlen($locale) < 2) {
            return false;
        }

        return $locale;
    }
protected function getLocaleFromUrl ( string $ url ) { $ locale = trim ( substr ( $ url , 0 , 3 ) , '/' ) ; if ( strlen ( $ locale ) > 2 || strlen ( $ locale ) < 2 ) { return false ; } return $ locale ; }
Gets the locale out of the url if it's in

return string|false
Gets the locale out of the url if it s in