C# Class Cats.Localization.Services.LocalizationService

Inheritance: ILocalizationService
Mostra file Open project: edgecomputing/cats

Public Methods

Method Description
AddLanguage ( Language language ) : bool
AddLanguage ( Language language, bool populateDefaultValues ) : bool
AddPage ( Page page ) : bool
DeleteLanguage ( Language language, bool cascadeDelete = true ) : bool
DeletePage ( Page page ) : bool
Dispose ( ) : void
GetLocalizedTextDictionaryForPage ( string pageName, string language ) : string>.Dictionary
GetLocalizedTextForPage ( Page page, string language = "EN" ) : List
GetLocalizedTextForPage ( string pageName, string language = "EN" ) : List
LocalizationService ( IUnitOfWork unitOfWork ) : System
TranslatePage ( string page, string>.Dictionary translations, string language = "EN" ) : bool

Adds new entries into the localized phrases table for all phrases in the 'translation' dictionary. It also associates the page 'page' with the list of translated phrases

UpdateLanguage ( Language language ) : bool
UpdatePage ( Page page ) : bool

Private Methods

Method Description
LocalizedTextForPage ( int pageId, string language ) : IEnumerable
TranslatePage ( Page page, string>.Dictionary translations, string language = "EN" ) : void

Adds new entries into the localized phrases table for all phrases in the 'translation' dictionary. It also associates the page 'page' with the list of translated phrases

TranslatedTextFromDictionaryOrDefault ( string phrase, string>.Dictionary translations ) : string

Checks if a corresponding translated entry exist inside translations dictionary. If no match if found then it will return the language neutral phrase (the one passed as parameter).

Method Details

AddLanguage() public method

public AddLanguage ( Language language ) : bool
language Language
return bool

AddLanguage() public method

public AddLanguage ( Language language, bool populateDefaultValues ) : bool
language Language
populateDefaultValues bool
return bool

AddPage() public method

public AddPage ( Page page ) : bool
page Cats.Localization.Models.Page
return bool

DeleteLanguage() public method

public DeleteLanguage ( Language language, bool cascadeDelete = true ) : bool
language Language
cascadeDelete bool
return bool

DeletePage() public method

public DeletePage ( Page page ) : bool
page Cats.Localization.Models.Page
return bool

Dispose() public method

public Dispose ( ) : void
return void

GetLocalizedTextDictionaryForPage() public method

public GetLocalizedTextDictionaryForPage ( string pageName, string language ) : string>.Dictionary
pageName string
language string
return string>.Dictionary

GetLocalizedTextForPage() public method

public GetLocalizedTextForPage ( Page page, string language = "EN" ) : List
page Cats.Localization.Models.Page
language string
return List

GetLocalizedTextForPage() public method

public GetLocalizedTextForPage ( string pageName, string language = "EN" ) : List
pageName string
language string
return List

LocalizationService() public method

public LocalizationService ( IUnitOfWork unitOfWork ) : System
unitOfWork IUnitOfWork
return System

TranslatePage() public method

Adds new entries into the localized phrases table for all phrases in the 'translation' dictionary. It also associates the page 'page' with the list of translated phrases
public TranslatePage ( string page, string>.Dictionary translations, string language = "EN" ) : bool
page string Name of the page to translate
translations string>.Dictionary Dictionary of translation terms [Phrase][TranslatedPhrase]
language string Language to translate to
return bool

UpdateLanguage() public method

public UpdateLanguage ( Language language ) : bool
language Language
return bool

UpdatePage() public method

public UpdatePage ( Page page ) : bool
page Cats.Localization.Models.Page
return bool