Skip to content

Commit ddb035f

Browse files
author
Your Name
committed
Angular Core Deep Dive Course
1 parent 9f8bee2 commit ddb035f

File tree

5 files changed

+76
-7
lines changed

5 files changed

+76
-7
lines changed

src/app/app.component.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99

1010
<div class="demo">
1111

12-
<button (click)="onEditCourse()">Edit Course</button>
12+
13+
<button (click)="onEditCourse()" i18n>Edit Course</button>
14+
15+
16+
<div i18n>{ coursesTotal, plural, =0 {No courses available.}
17+
=1 {One course is available.}
18+
other {A total of {{coursesTotal}} courses are available.} }</div>
1319

1420
</div>
1521

1622
<div class="courses">
1723

18-
<course-card *ngFor="let course of courses | filterByCategory: 'BEGINNER' "
24+
<h4 i18n="welcome message.|Greet the user a greeting at the beginning of the course.@@welcomeMessage">
25+
Welcome to the Angular Core Deep Dive Course</h4>
26+
27+
<course-card *ngFor="let course of courses "
1928
(courseChanged)="save($event)"
2029
type="beginner"
2130
[course]="course">

src/app/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export class AppComponent implements OnInit {
1515

1616
courses: Course[] = COURSES;
1717

18+
coursesTotal = this.courses.length;
19+
1820
constructor(
1921
private coursesService: CoursesService,
2022
@Inject(CONFIG_TOKEN) private config: AppConfig) {

src/app/courses/course-card/course-card.component.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@
1414

1515
</div>
1616

17-
<div class="course-category" [ngSwitch]="course.category">
17+
<div class="course-category">
1818

19-
<div class="category" *ngSwitchCase="'BEGINNER'">Beginner</div>
19+
<div class="category" i18n>
2020

21-
<div class="category" *ngSwitchCase="'INTERMEDIATE'">Intermediate</div>
21+
{
22+
course.category,
23+
select,
24+
BEGINNER {Beginner}
25+
INTERMEDIATE {Intermediate}
26+
ADVANCED {Advanced}
27+
}
28+
29+
</div>
2230

23-
<div class="category" *ngSwitchCase="'ADVANCED'">Advanced</div>
2431

2532
</div>
2633

src/db-data.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export const COURSES: any = [
77
description: "Angular Core Deep Dive",
88
iconUrl: 'https://s3-us-west-1.amazonaws.com/angular-university/course-images/angular-core-in-depth-small.png',
99
longDescription: "A detailed walk-through of the most important part of Angular - the Core and Common modules",
10-
lessonsCount: 10
10+
lessonsCount: 10,
11+
category: 'INTERMEDIATE'
1112
},
1213
{
1314
id: 2,

src/messages.xlf

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="ng2.template">
4+
<body>
5+
<trans-unit id="9aeacc4172cc40b2ecb1dd81d3ca17043ffd1f5e" datatype="html">
6+
<source>
7+
8+
<x id="ICU" equiv-text="{
9+
course.category, select, BEGINNER {...} INTERMEDIATE {...} ADVANCED {...}}"/>
10+
11+
</source>
12+
<context-group purpose="location">
13+
<context context-type="sourcefile">app/courses/course-card/course-card.component.html</context>
14+
<context context-type="linenumber">19</context>
15+
</context-group>
16+
</trans-unit>
17+
<trans-unit id="3654d95b03eba8ec9ee0cf68463f50365bf6baa2" datatype="html">
18+
<source>{VAR_SELECT, select, BEGINNER {Beginner} INTERMEDIATE {Intermediate} ADVANCED {Advanced} }</source>
19+
<context-group purpose="location">
20+
<context context-type="sourcefile">app/courses/course-card/course-card.component.html</context>
21+
<context context-type="linenumber">21</context>
22+
</context-group>
23+
</trans-unit>
24+
<trans-unit id="756b2b2744938130877e47fd8e697024cb532092" datatype="html">
25+
<source>Edit Course</source>
26+
<context-group purpose="location">
27+
<context context-type="sourcefile">app/app.component.html</context>
28+
<context context-type="linenumber">13</context>
29+
</context-group>
30+
</trans-unit>
31+
<trans-unit id="ef485631d92fd33527cc7ae600c0b9b07c397825" datatype="html">
32+
<source>{VAR_PLURAL, plural, =0 {No courses available.} =1 {One course is available.} other {A total of <x id="INTERPOLATION" equiv-text="{{coursesTotal}}"/> courses are available.} }</source>
33+
<context-group purpose="location">
34+
<context context-type="sourcefile">app/app.component.html</context>
35+
<context context-type="linenumber">16</context>
36+
</context-group>
37+
</trans-unit>
38+
<trans-unit id="welcomeMessage" datatype="html">
39+
<source>
40+
Welcome to the Angular Core Deep Dive Course</source>
41+
<context-group purpose="location">
42+
<context context-type="sourcefile">app/app.component.html</context>
43+
<context context-type="linenumber">24</context>
44+
</context-group>
45+
<note priority="1" from="description">Greet the user a greeting at the beginning of the course.</note>
46+
<note priority="1" from="meaning">welcome message.</note>
47+
</trans-unit>
48+
</body>
49+
</file>
50+
</xliff>

0 commit comments

Comments
 (0)