Uses the language integration configuration provided by an app to provide language services for a library.
See LanguageIntegrationModule.forRoot()
.
language/src/services/language-integration.service.ts
Properties |
|
Methods |
|
Accessors |
constructor(config?: LanguageIntegrationConfig)
|
||||||||
Creates an instance of LanguageIntegrationService.
Parameters:
|
||||||||
Public alternateLanguagesFor | ||||||||
alternateLanguagesFor(lang: string)
|
||||||||
Retrieves the list of alternative languages to the specified language supported by the integrated app.
Parameters:
Returns:
string[]
An array of alternative languages supported by the integrated app. |
||||||||
Public ensureEnabled |
ensureEnabled()
|
Ensures that the language integration module has been imported and a configuration object has been provided.
Returns:
literal type
|
Public translate | ||||||||||||
translate(value: string, params?: Record
|
||||||||||||
Translates a value (typically a translation id) into the current language used by the integrated app.
Parameters:
Returns:
string
The translation of the specified value and params in the current language used by the integrated app. |
||||||||||||
Public translateProperties | ||||||||||||
translateProperties(data: Record
|
||||||||||||
Dives deep into an object or an array and replaces the indicated properties in-place with their translation. The
Parameters:
Returns:
void
|
||||||||||||
Public Readonly Optional config |
Type: LanguageIntegrationConfig
|
Decorators:
@Optional()
|
The language integration configuration provided using `LanguageIntegrationModule.forRoot()`.
|
enabled |
getenabled()
|
Indicated whether the language integration module has been imported into the app.
If this is |