Skip to content

Commit 9608c45

Browse files
committed
docs(test-app): reloadLang
1 parent a78eaf5 commit 9608c45

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

projects/test-app/src/app/app.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
</header>
88

99
<router-outlet></router-outlet>
10+
11+
<button (click)="reloadLang()">reloadLang()</button>

projects/test-app/src/app/app.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,15 @@ export class AppComponent implements OnInit {
3535
const instantTranslation = this.translate.instant("demo.simple.text-as-attribute");
3636
console.info("instant", instantTranslation);
3737
});
38+
39+
this.translate.onTranslationChange.subscribe((event) => {
40+
console.info("onTranslationChange", event);
41+
});
42+
}
43+
44+
reloadLang() {
45+
this.translate.reloadLang(this.translate.getCurrentLang()).subscribe((translations) => {
46+
console.info("reloadLang", translations);
47+
});
3848
}
3949
}

0 commit comments

Comments
 (0)