UNPKG

404 BPlain TextView Raw
1import { Pipe, PipeTransform } from '@angular/core';
2import { Utils } from "./utils";
3/**
4 * 本管道用于基于IISP构架实现语言国际化,用法:
5 * {{ key | i18n}} 或
6 * {{ key | i18n: [arg1, arg2...]}}
7 */
8@Pipe({ name: 'i18n' })
9export class i18nPipe implements PipeTransform {
10 transform(key: string, params?: string[]): string {
11 return Utils.resolveLocalizedMessage(key, params);
12 }
13}
\No newline at end of file