bitwarden-estensione-browser/libs/angular/src/pipes/i18n.pipe.ts

15 lines
379 B
TypeScript
Raw Normal View History

2021-12-16 13:36:21 +01:00
import { Pipe, PipeTransform } from "@angular/core";
2021-12-16 13:36:21 +01:00
import { I18nService } from "jslib-common/abstractions/i18n.service";
@Pipe({
2021-12-16 13:36:21 +01:00
name: "i18n",
})
export class I18nPipe implements PipeTransform {
2021-12-16 13:36:21 +01:00
constructor(private i18nService: I18nService) {}
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);
}
}