feat(i18n): Add NgLocaleLocalization which returns plural cases given a locale (#10744)

This commit is contained in:
Victor Berchet
2016-08-12 14:46:06 -07:00
committed by vikerman
parent 6580d67875
commit 161a4dd15f
8 changed files with 841 additions and 5 deletions

View File

@ -36,6 +36,9 @@ export declare class DecimalPipe implements PipeTransform {
transform(value: any, digits?: string): string;
}
/** @experimental */
export declare function getPluralCase(locale: string, nLike: number | string): Plural;
/** @stable */
export declare class HashLocationStrategy extends LocationStrategy {
constructor(_platformLocation: PlatformLocation, _baseHref?: string);
@ -129,6 +132,12 @@ export declare class NgIf {
constructor(_viewContainer: ViewContainerRef, _templateRef: TemplateRef<Object>);
}
/** @experimental */
export declare class NgLocaleLocalization extends NgLocalization {
constructor(_locale: string);
getPluralCategory(value: any): string;
}
/** @experimental */
export declare abstract class NgLocalization {
abstract getPluralCategory(value: any): string;
@ -213,6 +222,16 @@ export declare abstract class PlatformLocation {
abstract replaceState(state: any, title: string, url: string): void;
}
/** @experimental */
export declare enum Plural {
Zero = 0,
One = 1,
Two = 2,
Few = 3,
Many = 4,
Other = 5,
}
/** @deprecated */
export declare class ReplacePipe implements PipeTransform {
transform(value: any, pattern: string | RegExp, replacement: Function | string): any;