TranslationPipe
Defined in: src/pipes/translation.pipe.ts:24
Core pipe to translate content inside an Angular Template
Since
1.0.0
Author
Simon Kovtyk
Implements
PipeTransform
Constructors
Constructor
ts
new TranslationPipe(): TranslationPipe;Defined in: src/pipes/translation.pipe.ts:39
Returns
TranslationPipe
Methods
transform()
ts
transform(
value,
token,
scope?,
shouldFallback?): string;Defined in: src/pipes/translation.pipe.ts:71
Transforms a token into its translated value
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | The possible fallback value, if no translation was found. Check the fallback parameter |
token | string | The token to be translated |
scope? | Readonly<string | (string | null)[] | null> | Optional scope(s) to narrow down the translation search |
shouldFallback? | boolean | Optional flag to determine if it should fallback to the source locale when no translation was found. If not provided, TranslationNotDefinedError will be thrown instead. |
Returns
string
The translated token or the fallback value
Since
1.0.0
Author
Simon Kovtyk
Implementation of
ts
PipeTransform.transform