C# 클래스 Sitecore.SharedSource.Commons.Utilities.LanguageUtil

Utilities for dealing with languages and multilingual content in Sitecore
파일 보기 프로젝트 열기: Velir/Sitecore-Commons

공개 메소드들

메소드 설명
CheckItemForLanguage ( string itemGuid, System.Language language, Database db ) : bool

Checks to see if the passed in item has a version in the specified language.

GetAvailableLanguagesForItem ( System.Item item, Database db ) : List

Gets the available languages for an item.

GetLanguage ( string languageName, bool fallBackToDefaultLanguage ) : System.Language

Tries to get the passed in language, if it is not found the default language will be returned.

GetLanguageUrlForItem ( System.Item item, System.Language language ) : string

Contructs a URL for a passed in Item that contains the parameter which will cause Sitecore to switch the current language.

GetLanguageUrlForUrl ( string baseUrl, System.Language language ) : string

Contructs a URL for a passed in URL that contains the parameter which will cause Sitecore to switch the current language.

GetLanguageUrlForUrl ( string baseUrl, string languageName ) : string

Contructs a URL for a passed in URL that contains the parameter which will cause Sitecore to switch the current language.

SwitchCurrentLanguage ( System.Language language ) : void

Switches the current language in Sitecore.Context

SwitchCurrentLanguage ( string languageName, bool fallBackToDefaultLanguage ) : void

Switches the current language in Sitecore.Context

메소드 상세

CheckItemForLanguage() 공개 정적인 메소드

Checks to see if the passed in item has a version in the specified language.
db is null language is null itemGuid is null or empty
public static CheckItemForLanguage ( string itemGuid, System.Language language, Database db ) : bool
itemGuid string The guid of the item to check.
language System.Language The language to check for.
db Database The Sitecore db to use.
리턴 bool

GetAvailableLanguagesForItem() 공개 정적인 메소드

Gets the available languages for an item.
public static GetAvailableLanguagesForItem ( System.Item item, Database db ) : List
item System.Item The item.
db Database The db.
리턴 List

GetLanguage() 공개 정적인 메소드

Tries to get the passed in language, if it is not found the default language will be returned.
public static GetLanguage ( string languageName, bool fallBackToDefaultLanguage ) : System.Language
languageName string Name of the language.
fallBackToDefaultLanguage bool if set to true the default language will be returned if any problems occur /// in retrieving the passed in language.
리턴 System.Language

GetLanguageUrlForItem() 공개 정적인 메소드

Contructs a URL for a passed in Item that contains the parameter which will cause Sitecore to switch the current language.
public static GetLanguageUrlForItem ( System.Item item, System.Language language ) : string
item System.Item The item to link to.
language System.Language The language to switch to.
리턴 string

GetLanguageUrlForUrl() 공개 정적인 메소드

Contructs a URL for a passed in URL that contains the parameter which will cause Sitecore to switch the current language.
public static GetLanguageUrlForUrl ( string baseUrl, System.Language language ) : string
baseUrl string The base URL.
language System.Language The language to switch to.
리턴 string

GetLanguageUrlForUrl() 공개 정적인 메소드

Contructs a URL for a passed in URL that contains the parameter which will cause Sitecore to switch the current language.
public static GetLanguageUrlForUrl ( string baseUrl, string languageName ) : string
baseUrl string The base URL.
languageName string The name of the language to switch to.
리턴 string

SwitchCurrentLanguage() 공개 정적인 메소드

Switches the current language in Sitecore.Context
public static SwitchCurrentLanguage ( System.Language language ) : void
language System.Language The language to switch to.
리턴 void

SwitchCurrentLanguage() 공개 정적인 메소드

Switches the current language in Sitecore.Context
public static SwitchCurrentLanguage ( string languageName, bool fallBackToDefaultLanguage ) : void
languageName string Name of the language to switch to.
fallBackToDefaultLanguage bool if set to true the default language will be returned if any problems occur /// in retrieving the passed in language
리턴 void