C# Class i18n.Tests.TextLocalizer_Mock_SingleMessage

Mock implementation of ITextLocalizer with simplest of logic: · Supports single msgid/msgstr pair passed to cstor. · GetText checks that the UserLanguage spec. matches "en" and if so and msgid matches that passed to cstor, then returns the msgstr passed to cstor. Otherwise returns null.
Inheritance: ITextLocalizer
Mostra file Open project: turquoiseowl/i18n Class Usage Examples

Public Methods

Method Description
AddAppLanguage ( string langtag ) : void
GetAppLanguages ( ) : LanguageTag>.ConcurrentDictionary
GetText ( string msgid, string msgcomment, LanguageItem languages, LanguageTag &o_langtag, int maxPasses = -1 ) : string
TextLocalizer_Mock_SingleMessage ( string msgid, string msgstr ) : System

Method Details

AddAppLanguage() public method

public AddAppLanguage ( string langtag ) : void
langtag string
return void

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_Mock_SingleMessage() public method

public TextLocalizer_Mock_SingleMessage ( string msgid, string msgstr ) : System
msgid string
msgstr string
return System