1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 06:43:35 +00:00

[EC-772] Add i18n key typechecking in web (#4023)

This commit is contained in:
Thomas Rittson
2022-12-21 14:27:00 +10:00
committed by GitHub
parent b331f5b329
commit 5a1940f3f4
50 changed files with 176 additions and 109 deletions

View File

@@ -5,10 +5,10 @@ import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
@Pipe({
name: "i18n",
})
export class I18nPipe implements PipeTransform {
constructor(private i18nService: I18nService) {}
export class I18nPipe<TKey = string> implements PipeTransform {
constructor(private i18nService: I18nService<TKey>) {}
transform(id: string, p1?: string | number, p2?: string | number, p3?: string | number): string {
transform(id: TKey, p1?: string | number, p2?: string | number, p3?: string | number): string {
return this.i18nService.t(id, p1, p2, p3);
}
}