core icon indicating copy to clipboard operation
core copied to clipboard

Extend/Override TranslatePipe

Open beig opened this issue 3 years ago • 1 comments

Is it possible to extend the TranslatePipe?

E.g: showing the translation key next to the translation

@Pipe({
  name: 'translate'
})
export class CustomTranslatePipe extends TranslatePipe {

  transform(value: any, ...args: any[]): any {
    let translation = super.transform(value, args);
    if (DEBUG_ENABLED) {
      translation += ` 'KEY: ${value}'`;
    }
    return translation;
  }

}

beig avatar Mar 24 '21 17:03 beig

put override in front of transform

wmwood avatar Jul 31 '22 04:07 wmwood