UNPKG

bixi

Version:

企业级中后台前端解决方案

12 lines (9 loc) 420 B
import { Inject, Pipe, PipeTransform } from '@angular/core'; import { BixiI18NService, BIXI_I18N_TOKEN } from './service.type'; @Pipe({ name: 'i18n' }) export class I18nPipe implements PipeTransform { constructor(@Inject(BIXI_I18N_TOKEN) private i18n: BixiI18NService) { } transform(key: string, interpolateParams?: {}, isSafe?: boolean): string { return this.i18n.fanyi(key, interpolateParams, isSafe); } }