feat(i18n): provide LOCALE_ID and NgLocalization

This commit is contained in:
Victor Berchet
2016-08-12 16:52:55 -07:00
committed by Vikram Subramanian
parent 4df48b202c
commit ce4eae65a7
10 changed files with 162 additions and 122 deletions

View File

@ -26,14 +26,6 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
* ## Example
*
* ```
* class MyLocalization extends NgLocalization {
* getPluralCategory(value: any) {
* if(value > 1) {
* return 'other';
* }
* }
* }
*
* @Component({
* selector: 'app',
* template: `
@ -41,7 +33,8 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
* {{ messages.length | i18nPlural: messageMapping }}
* </div>
* `,
* providers: [{provide: NgLocalization, useClass: MyLocalization}]
* // best practice is to define the locale at the application level
* providers: [{provide: LOCALE_ID, useValue: 'en_US'}]
* })
*
* class MyApp {