C# Class i18n.UrlLocalizer

The i18n default implementaion of the IUrlLocalizer service.
Inheritance: IUrlLocalizer
显示文件 Open project: turquoiseowl/i18n

Public Properties

Property Type Description
QuickUrlExclusionFilter System.Text.RegularExpressions.Regex
UrlLocalizationScheme UrlLocalizationScheme

Public Methods

Method Description
ExtractLangTagFromUrl ( System context, string url, UriKind uriKind, bool incomingUrl, string &urlPatched ) : string
FilterIncoming ( Uri url ) : bool
FilterOutgoing ( string url, Uri currentRequestUrl ) : bool
InsertLangTagIntoVirtualPath ( string langtag, string virtualPath ) : string
SetLangTagInUrlPath ( System context, string url, UriKind uriKind, string langtag ) : string

Protected Methods

Method Description
ExtractAnySiteRootPathFromUrl ( string &url, UriKind uriKind ) : string

Helper for detecting and extracting any site root path string from a URL.

PatchSiteRootPathIntoUrl ( string siteRootPath, string &url, UriKind uriKind ) : void

Private Methods

Method Description
UrlLocalizer ( ) : System

Method Details

ExtractAnySiteRootPathFromUrl() protected method

Helper for detecting and extracting any site root path string from a URL.
protected ExtractAnySiteRootPathFromUrl ( string &url, UriKind uriKind ) : string
url string Subject relative url, trimmed on output if found to be prefixed with site root path.
uriKind UriKind
return string

ExtractLangTagFromUrl() public method

public ExtractLangTagFromUrl ( System context, string url, UriKind uriKind, bool incomingUrl, string &urlPatched ) : string
context System
url string
uriKind UriKind
incomingUrl bool
urlPatched string
return string

FilterIncoming() public method

public FilterIncoming ( Uri url ) : bool
url System.Uri
return bool

FilterOutgoing() public method

public FilterOutgoing ( string url, Uri currentRequestUrl ) : bool
url string
currentRequestUrl System.Uri
return bool

InsertLangTagIntoVirtualPath() public method

public InsertLangTagIntoVirtualPath ( string langtag, string virtualPath ) : string
langtag string
virtualPath string
return string

PatchSiteRootPathIntoUrl() protected method

protected PatchSiteRootPathIntoUrl ( string siteRootPath, string &url, UriKind uriKind ) : void
siteRootPath string
url string
uriKind UriKind
return void

SetLangTagInUrlPath() public method

public SetLangTagInUrlPath ( System context, string url, UriKind uriKind, string langtag ) : string
context System
url string
uriKind UriKind
langtag string
return string

Property Details

QuickUrlExclusionFilter public_oe static_oe property

May be set to a pattern that matches the path component of any url to be explicitly EXCLUDED from localization, both incoming and outgoing.
This filtering in performed in addition to any custom IncomingUrlFilters/OutgoingUrlFilters filters.
public static Regex,System.Text.RegularExpressions QuickUrlExclusionFilter
return System.Text.RegularExpressions.Regex

UrlLocalizationScheme public_oe static_oe property

Specifies the URL localization used by ALL instances of UrlLocalizer. May be changed in application start.
Presently, only Scheme1 and Scheme2 are supported by this class.
public static UrlLocalizationScheme UrlLocalizationScheme
return UrlLocalizationScheme