import { Pipe, PipeTransform } from '@angular/core';
import { I18nService } from './i18n.service';

@Pipe({
  name: 'translate',
  pure: false
})
export class TranslatePipe2 implements PipeTransform {
  constructor(private i18n: I18nService) {}

  transform(key: string, params?: { [key: string]: any }): string {
    return this.i18n.translate(key, params);
  }
}
