# new DecafTranslatePipe()
The DecafTranslatePipe provides a mechanism to translate text keys into localized
strings based on the current language settings. It integrates with the TranslateService
to fetch translations dynamically and supports fallback rendering for untranslated keys.
Angular pipe for translating text using the @ngx-translate/core library.
- Implements:
- PipeTransform
Members
TranslateService
# translate
Injected instance of the TranslateService for handling translations.
Injected instance of the TranslateService for handling translations.
TranslateService
# translate
Injected instance of the TranslateService for handling translations.
Injected instance of the TranslateService for handling translations.
Methods
# transform(value, …args) → {string}
Uses the TranslateService to fetch the translated string for the provided key.
If translations are disabled or the key is not found, it returns a fallback HTML-wrapped key.
Transforms a text key into its localized string representation.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
string
|
The translation key to be transformed. |
|
args |
Array.<any>
|
<repeatable> |
Optional arguments to interpolate within the translation string. |
The translated string or a fallback HTML-wrapped key.
string
Example
```html
{{ 'HELLO_WORLD' | translate }}
```