Translates keys by using the SiTranslateService . Within Element this pipe should be used instead of ngx-translates translate pipe. Outside Element, this pipe should NOT be used.
A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed. ngOnDestroy: () => void from OnDestroy.ngOnDestroy¶
If the underlying translation library supports switching the language and/or updating the translation texts, this observable will emit. There is no initial emit. get translationChange: Observable<void>¶
Methods
The language to be used as default. Returns The code of the default language. getDefaultLanguage: () => string¶
If supported by the underlying translation library, this method can be used to add a translation for a specific key. It is intended to be used for adding the english default value. It will be called whenever a key within element is resolved. An implementation of this method must check that it does not override an existing translation.
Translates the key(s) by using the underlying translation library. Returns Returns the translated key or an object with the translated keys. Depending on the underlying translation library (sync/async) the result will be wrapped in an Observable.
Parameters
A single translation key or an array of keys. keys: T¶
Translates the key(s) by using the underlying translation library in an asynchronous manner. It will emit each time the active language is changed. Returns Returns the translated key or an object with the translated keys wrapped in an Observable.
Parameters
A single translation key or an array of keys. keys: T¶
Translates the key(s) by using the underlying translation library in a synchronous manner.
Warning: The caller of this function needs to make sure the translation file(s) are already loaded. It is generally not recommended to use this function unless you know exactly what you are doing.
Returns Returns the translated key or an object with the translated keys.
Parameters
A single translation key or an array of keys. keys: T¶