C# Class i18n.LocalizingService

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

Public Methods

Method Description
GetBestAvailableLanguageFrom ( string languages ) : string

Returns the best matching language for this application's resources, based the provided languages

GetText ( string key, string languages ) : string

Returns localized text for a given default language key, or the default itself, based on the provided languages and application resources

Private Methods

Method Description
CleanCommentLine ( string line ) : string
CreateEmptyMessages ( string culture ) : void
GetCultureInfoFromLanguage ( string language ) : CultureInfo
GetDirectoryAndPath ( string culture, string &directory, string &path ) : void
GetLanguageIfAvailable ( string culture ) : string
GetTextOrDefault ( string culture, string key ) : string
LoadFromDiskAndCache ( string culture, string path ) : void
LoadMessages ( string culture ) : bool
ParseBody ( TextReader fs, string line, StringBuilder sb, i18n.I18NMessage message, Regex quoted ) : void
TryGetTextFor ( string culture, string key ) : string

Method Details

GetBestAvailableLanguageFrom() public method

Returns the best matching language for this application's resources, based the provided languages
public GetBestAvailableLanguageFrom ( string languages ) : string
languages string A sorted list of language preferences
return string

GetText() public method

Returns localized text for a given default language key, or the default itself, based on the provided languages and application resources
public GetText ( string key, string languages ) : string
key string The default language key to search for
languages string A sorted list of language preferences
return string