libs/upp-base/src/modules/language.ts
The service loads translation strings for various modules and supports switching between different languages. It also provides translation functionality with caching mechanisms for optimized performance.
Properties |
|
Methods |
|
Accessors |
constructor(http: HttpClient, langspath: string, route: ActivatedRoute)
|
||||||||||||||||
|
Parameters :
|
| Public GetLanguage | ||||||||
GetLanguage(toUpper)
|
||||||||
|
Parameters :
Returns :
string
The active language code, or the default language if no language is set. |
| Public GetLanguages |
GetLanguages()
|
|
Returns :
{}
An array of supported language objects. |
| Public Async LoadModule | ||||||||
LoadModule(name: string)
|
||||||||
|
Parameters :
Returns :
Promise<boolean>
Resolves to true if the module was successfully loaded; otherwise, false. |
| Public Async SetLanguage | |||||||||||||||
SetLanguage(language: string, global)
|
|||||||||||||||
|
Parameters :
Returns :
Promise<boolean>
Resolves to true if the language was successfully added; otherwise, false. |
| Public StrInfo | ||||||||
StrInfo(id: string)
|
||||||||
|
Parameters :
Returns :
any
Translation information, or null if the string ID is not found. |
| Public tr | ||||||||||||||||||||
tr(id: string, args: ___targs, language: string | null)
|
||||||||||||||||||||
|
Parameters :
Returns :
string
The translated string, or "..." if the language is still loading. |
| Public OnSetLanguage |
Default value : this._onSetLanguage.asObservable()
|
| _strings |
get_strings()
|
|
|