ResourceMultiLanguageGenerator class
Uses resourceExplorer to mount root lg and all language variants as a multi language generator.
- Extends
Remarks
Given file name like "foo.lg" this will generate a map of foo.{LOCALE}.lg files.
Constructors
Resource |
Initializes a new instance of the ResourceMultiLanguageGenerator class. |
Properties
$kind | |
resource |
Resource id of LG file. |
Inherited Properties
language |
Language policy required by language generator. |
Methods
try |
Implementation of lookup by locale. |
Inherited Methods
configure(Record<string, unknown>) | Fluent method for configuring the object. |
generate(Dialog |
Find a language generator that matches the current context locale. |
get |
Constructor Details
ResourceMultiLanguageGenerator(string)
Initializes a new instance of the ResourceMultiLanguageGenerator class.
new ResourceMultiLanguageGenerator(resourceId?: string)
Parameters
- resourceId
-
string
Resource id of LG file.
Property Details
$kind
static $kind: string
Property Value
string
resourceId
Resource id of LG file.
resourceId: string
Property Value
string
Inherited Property Details
languagePolicy
Language policy required by language generator.
languagePolicy: LanguagePolicy
Property Value
Inherited From MultiLanguageGeneratorBase.languagePolicy
Method Details
tryGetGenerator(DialogContext, string)
Implementation of lookup by locale.
function tryGetGenerator(dialogContext: DialogContext, locale: string): { exist: boolean, result: LanguageGenerator<T, D> }
Parameters
- dialogContext
-
DialogContext
Context for the current turn of conversation.
- locale
-
string
Locale to lookup.
Returns
{ exist: boolean, result: LanguageGenerator<T, D> }
An object with a boolean showing existence and the language generator.
Inherited Method Details
configure(Record<string, unknown>)
Fluent method for configuring the object.
function configure(config: Record<string, unknown>): this
Parameters
- config
-
Record<string, unknown>
Configuration settings to apply.
Returns
this
The Configurable after the operation is complete.
Inherited From Configurable.configure
generate(DialogContext, string, D)
Find a language generator that matches the current context locale.
function generate(dialogContext: DialogContext, template: string, data: D): Promise<T>
Parameters
- dialogContext
-
DialogContext
Context for the current turn of conversation.
- template
-
string
Template to use.
- data
-
D
Data to bind to.
Returns
Promise<T>
A promise representing the asynchronous operation.
Inherited From MultiLanguageGeneratorBase.generate
getConverter(Object)
function getConverter(property: Object): Converter | ConverterFactory
Parameters
- property
-
Object
The key of the conditional selector configuration.
Returns
Converter | ConverterFactory
The converter for the selector configuration.
Inherited From MultiLanguageGeneratorBase.getConverter