libs/upp-base/src/modules/language.ts
This class observes language changes and provides methods for translating strings with caching and argument support.
Properties |
Methods |
|
constructor(lang: languageService, chng: ChangeDetectorRef | null)
|
||||||||||||
|
and binds the provided
Parameters :
|
| Public _chng |
Type : ChangeDetectorRef | null
|
Default value : null
|
| Public _lang |
Type : languageService
|
| Public language |
Type : string | null
|
Default value : null
|
| OnDestroy |
OnDestroy()
|
|
Returns :
void
|
| Public Async SetLanguage | ||||||||
SetLanguage(language: string)
|
||||||||
|
Clears the cache and triggers a view update if a new language is set.
Parameters :
Returns :
any
Resolves once the language is set and view updated. |
| Public tr | |||||||||||||||
tr(id: string, args: ___targs)
|
|||||||||||||||
|
If no arguments are provided, the translation is cached for optimized future access.
Parameters :
Returns :
string
The translated string. |