public function segment($locale = null): ?string
    {
        if (is_null($locale)) {
            return $this->activeSegment();
        }

        return ($key = array_search($locale, $this->locales)) ? $key : null;
    }
public function segment($locale = null): ?string
    {
        if (is_null($locale)) {
            return $this->activeSegment();
        }

        return ($key = array_search($locale, $this->locales)) ? $key : null;
    }
public function segment ( $ locale = null ) : ? string { if ( is_null ( $ locale ) ) { return $ this -> activeSegment ( ) ; } return ( $ key = array_search ( $ locale , $ this -> locales ) ) ? $ key : null ; }
Get the url segment which corresponds with the passed locale.

@param null $locale

@return null|string
Get the url segment which corresponds with the passed locale .