MultiLanguageLG class
Multi locale Template Manager for language generation. This template manager will enumerate multi-locale LG files and will select the appropriate template using the current culture to perform template evaluation.
Constructors
Multi |
Initializes a new instance of the MultiLanguageLG class. |
Properties
language |
|
lg |
Methods
generate(string, object, string) | Generate template evaluate result. |
Constructor Details
MultiLanguageLG(Map<string, Templates> | undefined, Map<string, string> | undefined, string)
Initializes a new instance of the MultiLanguageLG class.
new MultiLanguageLG(templatesPerLocale: Map<string, Templates> | undefined, filePerLocale: Map<string, string> | undefined, defaultLanguage?: string)
Parameters
- templatesPerLocale
-
Map<string, Templates> | undefined
A map of LG file templates per locale.
- filePerLocale
-
Map<string, string> | undefined
A map of locale and LG file.
- defaultLanguage
-
string
Default language.
Property Details
languagePolicy
languagePolicy: Map<string, string[]>
Property Value
Map<string, string[]>
lgPerLocale
Method Details
generate(string, object, string)
Generate template evaluate result.
function generate(template: string, data?: object, locale?: string): any
Parameters
- template
-
string
Template name.
- data
-
object
Scope data.
- locale
-
string
Locale info.
Returns
any
The evaluated template result.