2021-12-16 13:36:21 +01:00
|
|
|
import { Pipe, PipeTransform } from "@angular/core";
|
2018-04-04 14:22:55 +02:00
|
|
|
|
2021-12-16 13:36:21 +01:00
|
|
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
2018-04-04 14:22:55 +02:00
|
|
|
|
|
|
|
@Pipe({
|
2021-12-16 13:36:21 +01:00
|
|
|
name: "i18n",
|
2018-04-04 14:22:55 +02:00
|
|
|
})
|
|
|
|
export class I18nPipe implements PipeTransform {
|
2021-12-16 13:36:21 +01:00
|
|
|
constructor(private i18nService: I18nService) {}
|
2018-04-04 14:22:55 +02:00
|
|
|
|
2021-12-16 13:36:21 +01:00
|
|
|
transform(id: string, p1?: string, p2?: string, p3?: string): string {
|
|
|
|
return this.i18nService.t(id, p1, p2, p3);
|
|
|
|
}
|
2018-04-04 14:22:55 +02:00
|
|
|
}
|