public function localePrefix($url)
    {
        if (option('url_locale_prefix') &&
            str_starts_with($url, '/') &&
            !preg_match('/^\/' . $this->_localesPattern() . '/', $url)
        ) {
            $url = '/' . I18n::locale() . $url;
        }

        return $url;
    }
public function localePrefix($url)
    {
        if (option('url_locale_prefix') &&
            str_starts_with($url, '/') &&
            !preg_match('/^\/' . $this->_localesPattern() . '/', $url)
        ) {
            $url = '/' . I18n::locale() . $url;
        }

        return $url;
    }
public function localePrefix ( $ url ) { if ( option ( 'url_locale_prefix' ) && str_starts_with ( $ url , '/' ) && ! preg_match ( '/^\/' . $ this -> _localesPattern ( ) . '/' , $ url ) ) { $ url = '/' . I18n :: locale ( ) . $ url ; } return $ url ; }
Prepends language code to the given URL if the "url_locale_prefix" directive
is enabled.

@param string $url The URL to fix
@return string Locale prefixed URL
Prepends language code to the given URL if the url_locale_prefix directive is enabled .