Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer Interface Reference

Interface for localizing string resources. More...

Inheritance diagram for Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer:

Public Member Functions

void Add (string key, string translation)
 Add a key and its translation. More...
 
void Add (string key, IEnumerable< string > list)
 Add a key and a list of translations separated by semi-colon. More...
 
void Add (string prefix, IReadOnlyDictionary< object, DescribeAttribute > dictionary)
 Adds value from dictionary under object if enumeration and prefix;object otherwise. More...
 
void Add (string prefix, IReadOnlyDictionary< object, TermsAttribute > dictionary)
 Adds values from dictionary separated by semi-colons under object if enumeration and prefix;object otherwise. More...
 
void Add (string prefix, IReadOnlyDictionary< TemplateUsage, TemplateAttribute > templates)
 Adds patterns from template separated by semi-colons under prefix;usage. More...
 
void Add (string prefix, TemplateAttribute template)
 Adds patterns from template separated by semi-colons under prefix;usage. More...
 
ILocalizer Load (IDictionaryEnumerator reader, out IEnumerable< string > missing, out IEnumerable< string > extra)
 Load the localizer from a stream. More...
 
bool Lookup (string key, out string value)
 Translate a key to a translation. More...
 
void LookupDictionary (string prefix, IDictionary< object, DescribeAttribute > dictionary)
 Look up prefix;object from dictionary and replace value from localizer. More...
 
void LookupDictionary (string prefix, IDictionary< object, TermsAttribute > dictionary)
 Look up prefix;object from dictionary and replace values from localizer. More...
 
void LookupTemplates (string prefix, IDictionary< TemplateUsage, TemplateAttribute > templates)
 Looks up prefix;usage and replace patterns in template from localizer. More...
 
bool LookupValues (string key, out string[] values)
 Translate a key to an array of values. More...
 
void Remove (string key)
 Remove a key from the localizer. More...
 
void Save (IResourceWriter writer)
 Save localizer resources to stream. More...
 

Properties

CultureInfo Culture [get, set]
 Return the localizer culture. More...
 

Detailed Description

Interface for localizing string resources.

Definition at line 44 of file ILocalizer.cs.

Member Function Documentation

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Add ( string  key,
string  translation 
)

Add a key and its translation.

Parameters
keyKey for indexing translation.
translationTranslation for key.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Add ( string  key,
IEnumerable< string >  list 
)

Add a key and a list of translations separated by semi-colon.

Parameters
keyKey for indexing translation list.
listList of translated terms.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Add ( string  prefix,
IReadOnlyDictionary< object, DescribeAttribute dictionary 
)

Adds value from dictionary under object if enumeration and prefix;object otherwise.

Parameters
prefixThe resource prefix.
dictionaryThe dictionary to add.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Add ( string  prefix,
IReadOnlyDictionary< object, TermsAttribute dictionary 
)

Adds values from dictionary separated by semi-colons under object if enumeration and prefix;object otherwise.

Parameters
prefixThe resource prefix.
dictionaryThe dictionary to add.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Add ( string  prefix,
IReadOnlyDictionary< TemplateUsage, TemplateAttribute templates 
)

Adds patterns from template separated by semi-colons under prefix;usage.

Parameters
prefixThe resource prefix.
templatesThe template dictionary to add.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Add ( string  prefix,
TemplateAttribute  template 
)

Adds patterns from template separated by semi-colons under prefix;usage.

Parameters
prefixThe resource prefix.
templateThe template to add.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

ILocalizer Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Load ( IDictionaryEnumerator  reader,
out IEnumerable< string >  missing,
out IEnumerable< string >  extra 
)

Load the localizer from a stream.

Parameters
readerDictionary with resources.
missingKeys found in current localizer that are not in loaded localizer.
extraKeys found in loaded localizer that were not in current localizer.
Returns
New localizer from reader.

Save(IResourceWriter) to see resource format.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

bool Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Lookup ( string  key,
out string  value 
)

Translate a key to a translation.

Parameters
keyKey to lookup.
valueValue to set if present.
Returns
True if value is found.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.LookupDictionary ( string  prefix,
IDictionary< object, DescribeAttribute dictionary 
)

Look up prefix;object from dictionary and replace value from localizer.

Parameters
prefixThe prefix.
dictionaryDictionary with existing values.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.LookupDictionary ( string  prefix,
IDictionary< object, TermsAttribute dictionary 
)

Look up prefix;object from dictionary and replace values from localizer.

Parameters
prefixThe prefix.
dictionaryDictionary with existing values.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.LookupTemplates ( string  prefix,
IDictionary< TemplateUsage, TemplateAttribute templates 
)

Looks up prefix;usage and replace patterns in template from localizer.

Parameters
prefixThe prefix.
templatesTemplate dictionary with existing values.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

bool Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.LookupValues ( string  key,
out string[]  values 
)

Translate a key to an array of values.

Parameters
keyKey to lookup.
valuesArray value to set if present.
Returns
True if value is found.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Remove ( string  key)

Remove a key from the localizer.

Parameters
keyKey to remove.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

void Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Save ( IResourceWriter  writer)

Save localizer resources to stream.

Parameters
writerWhere to write resources.

Resource values are all strings. The key and value can have different parts separated by semi-colons.

Key Value Description
key;VALUE string Simple value.
key;LIST string[;string]* List of values.
usage;field[;field]*;TEMPLATE pattern[;pattern]* List of template patterns. Key includes fields that use template.

Implemented in Microsoft.Bot.Builder.FormFlow.Advanced.Localizer.

Property Documentation

CultureInfo Microsoft.Bot.Builder.FormFlow.Advanced.ILocalizer.Culture
getset

Return the localizer culture.

Returns
Current culture.

Definition at line 50 of file ILocalizer.cs.


The documentation for this interface was generated from the following file: