feat(i18n): pass translation config directly into ngc (#10622)

This commit is contained in:
Matias Niemelä
2016-08-12 14:45:36 -07:00
committed by vikerman
parent 04c6b2fe85
commit 6580d67875
20 changed files with 187 additions and 56 deletions
@@ -2,3 +2,4 @@
<form><input type="button" [(ngModel)]="ctxProp" name="first"/></form>
<my-comp *ngIf="ctxBool"></my-comp>
<div *ngFor="let x of ctxArr" [attr.value]="x"></div>
<p id="welcomeMessage"><!--i18n-->Welcome<!--/i18n--></p>
@@ -7,7 +7,7 @@
*/
import {NgFor, NgIf} from '@angular/common';
import {Component, Inject} from '@angular/core';
import {Component, Inject, LOCALE_ID, TRANSLATIONS_FORMAT} from '@angular/core';
import {FORM_DIRECTIVES} from '@angular/forms';
import {MultipleComponentsMyComp} from './a/multiple_components';
@@ -23,5 +23,9 @@ export class BasicComp {
ctxProp: string;
ctxBool: boolean;
ctxArr: any[] = [];
constructor() { this.ctxProp = 'initialValue'; }
constructor(
@Inject(LOCALE_ID) public localeId: string,
@Inject(TRANSLATIONS_FORMAT) public translationsFormat: string) {
this.ctxProp = 'initialValue';
}
}
@@ -0,0 +1,4 @@
<translationbundle>
<translation id="76e1eccb1b772fa9f294ef9c146ea6d0efa8a2d4">käännä teksti</translation>
<translation id="65cc4ab3b4c438e07c89be2b677d08369fb62da2">tervetuloa</translation>
</translationbundle>