1 | import { Pipe, PipeTransform } from '@angular/core';
|
2 | import { Utils } from "./utils";
|
3 | /**
|
4 | * 本管道用于基于IISP构架实现语言国际化,用法:
|
5 | * {{ key | i18n}} 或
|
6 | * {{ key | i18n: [arg1, arg2...]}}
|
7 | */
|
8 | 'i18n' })
({ name: |
9 | export 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 |