Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 7a4da88

Browse files
committed
docs(i18n): add new features - Ward's touches
1 parent c58b114 commit 7a4da88

File tree

7 files changed

+159
-128
lines changed

7 files changed

+159
-128
lines changed

public/docs/_examples/cb-i18n/e2e-spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ describe('i18n E2E Tests', () => {
2323
});
2424

2525
it('should display the plural of: a horde of wolves', function () {
26-
expect(element.all(by.css('div')).get(0).getText()).toBe('una horda de lobos');
26+
expect(element.all(by.css('span')).get(0).getText()).toBe('ningún lobo');
2727
});
2828

29-
it('should display the select of sex', function () {
30-
expect(element.all(by.css('div')).get(1).getText()).toBe('El heroe es mujer');
29+
it('should display the select of gender', function () {
30+
expect(element.all(by.css('span')).get(1).getText()).toBe('El heroe es mujer');
3131
});
3232

3333
});

public/docs/_examples/cb-i18n/ts/app/app.component.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ <h1 i18n="User welcome|An introduction header for this sample">Hello i18n!</h1>
2020
<!--#docregion i18n-alt-translate-->
2121
<img [src]="logo" i18n-alt alt="Angular 2 logo" />
2222
<!--#enddocregion i18n-alt-translate-->
23-
23+
<br>
24+
<button (click)="inc(1)">+</button> <button (click)="inc(-1)">-</button>
2425
<!--#docregion i18n-plural-->
25-
<div i18n>{wolves, plural, zero {no wolves} =1 {one wolf} two {two wolves} other {a horde of wolves}}</div>
26+
<span i18n>{wolves, plural, zero {no wolves} =1 {one wolf} two {two wolves} other {a wolf pack}}</span>
2627
<!--#enddocregion i18n-plural-->
27-
28+
<span>({{wolves}})</span>
29+
<br><br>
30+
<button (click)="male()">&#9794;</button> <button (click)="female()">&#9792;</button>
2831
<!--#docregion i18n-select-->
29-
<div i18n>The hero is {sex, select, m {male} f {female}}</div>
32+
<span i18n>The hero is {gender, select, m {male} f {female}}</span>
3033
<!--#enddocregion i18n-select-->
34+
<br>

public/docs/_examples/cb-i18n/ts/app/app.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ import { Component } from '@angular/core';
77
templateUrl: 'app.component.html'
88
})
99
export class AppComponent {
10-
wolves = 5;
11-
sex = 'f';
10+
wolves = 0;
11+
gender = 'f';
1212
fly = true;
1313
logo = 'https://angular.io/resources/images/logos/angular2/angular.png';
14+
inc(i: number) {
15+
this.wolves = Math.min(5, Math.max(0, this.wolves + i));
16+
}
17+
male() { this.gender = 'm'; }
18+
female() { this.gender = 'f'; }
1419
}
1520

public/docs/_examples/cb-i18n/ts/locale/messages.es.xlf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ I don&apos;t output any element either
2424
<source>Angular 2 logo</source>
2525
<target>Logo de Angular 2</target>
2626
</trans-unit>
27-
<trans-unit id="fd3463eb234ef776cae5f7d9a8efa19c3fd3f959" datatype="html">
27+
<trans-unit id="38658218c31a8342093978c7e1b2de2e63fd55c6" datatype="html">
2828
<source/>
29-
<target>{wolves, plural, zero {ningún lobo} =1 {un lobo} two {dos lobos} other {una horda de lobos}}</target>
29+
<target>{wolves, plural, =0 {ningún lobo} =1 {un lobo} =2 {dos lobos} other {una horda de lobos}}</target>
3030
</trans-unit>
31-
<trans-unit id="989a4716b006c7bd26c4dfd9bc45dc6c792e34b1" datatype="html">
31+
<trans-unit id="61cafedb85466ab789b3ae817bba1a545468ee1c" datatype="html">
3232
<source>The hero is <x id="ICU"/></source>
3333
<target>El heroe es <x id="ICU"/></target>
3434
</trans-unit>
35-
<trans-unit id="c0ca5e58fe954d528bbfa516007a5a11690a7e99" datatype="html">
35+
<trans-unit id="14c7055d67771a3b7b6888d282ac092896be06b6" datatype="html">
3636
<source/>
37-
<target>{sex, select, m {hombre} f {mujer}}</target>
37+
<target>{gender, select, m {hombre} f {mujer}}</target>
3838
</trans-unit>
3939
</body>
4040
</file>

public/docs/_examples/cb-i18n/ts/locale/messages.es.xlf.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,24 @@
2929
</trans-unit>
3030
<!-- #enddocregion translated-other-nodes -->
3131
<!-- #docregion translated-plural -->
32-
<trans-unit id="fd3463eb234ef776cae5f7d9a8efa19c3fd3f959" datatype="html">
32+
<trans-unit id="38658218c31a8342093978c7e1b2de2e63fd55c6" datatype="html">
3333
<source/>
34-
<target>{wolves, plural, zero {ningún lobo} =1 {un lobo} two {dos lobos} other {una horda de lobos}}</target>
34+
<target>{wolves, plural, =0 {ningún lobo} =1 {un lobo} =2 {dos lobos} other {una horda de lobos}}</target>
3535
</trans-unit>
3636
<!-- #enddocregion translated-plural -->
3737
<!-- #docregion translated-select -->
38-
<trans-unit id="989a4716b006c7bd26c4dfd9bc45dc6c792e34b1" datatype="html">
38+
<!-- #docregion translate-select-1 -->
39+
<trans-unit id="61cafedb85466ab789b3ae817bba1a545468ee1c" datatype="html">
3940
<source>The hero is <x id="ICU"/></source>
4041
<target>El heroe es <x id="ICU"/></target>
4142
</trans-unit>
42-
<trans-unit id="c0ca5e58fe954d528bbfa516007a5a11690a7e99" datatype="html">
43+
<!-- #enddocregion translate-select-1 -->
44+
<!-- #docregion translate-select-2 -->
45+
<trans-unit id="14c7055d67771a3b7b6888d282ac092896be06b6" datatype="html">
4346
<source/>
44-
<target>{sex, select, m {hombre} f {mujer}}</target>
47+
<target>{gender, select, m {hombre} f {mujer}}</target>
4548
</trans-unit>
49+
<!-- #enddocregion translate-select-2 -->
4650
<!-- #enddocregion translated-select -->
4751
</body>
4852
</file>

public/docs/_examples/cb-i18n/ts/locale/trans-unit.html

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)