C# Class i18n.TextLocalizer

A service for retrieving localized text from PO resource files
Inheritance: ITextLocalizer
Mostrar archivo Open project: turquoiseowl/i18n

Public Methods

Method Description
GetAppLanguages ( ) : LanguageTag>.ConcurrentDictionary
GetText ( string msgid, string msgcomment, LanguageItem languages, LanguageTag &o_langtag, int maxPasses = -1 ) : string
TextLocalizer ( i18nSettings settings, ITranslationRepository translationRepository ) : System

Private Methods

Method Description
GetCacheKey ( string langtag ) : string
GetCultureInfoFromLanguage ( string language ) : CultureInfo
IsLanguageValid ( string langtag ) : bool

Assesses whether a language is PO-valid, that is whether or not one or more localized messages exists for the language.

LoadMessagesIntoCache ( string langtag ) : bool
LookupText ( string langtag, string msgkey ) : string
TryGetTextFor ( string langtag, string msgkey ) : string

Lookup whether any messages exist for the passed langtag, and if so attempts to lookup the message for the passed msgid, or if the msgid is null returns indication of whether any messages exist for the langtag.

Method Details

GetAppLanguages() public method

public GetAppLanguages ( ) : LanguageTag>.ConcurrentDictionary
return LanguageTag>.ConcurrentDictionary

GetText() public method

public GetText ( string msgid, string msgcomment, LanguageItem languages, LanguageTag &o_langtag, int maxPasses = -1 ) : string
msgid string
msgcomment string
languages LanguageItem
o_langtag LanguageTag
maxPasses int
return string

TextLocalizer() public method

public TextLocalizer ( i18nSettings settings, ITranslationRepository translationRepository ) : System
settings i18n.Domain.Concrete.i18nSettings
translationRepository ITranslationRepository
return System