mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-14 15:29:02 +00:00
Added i18n, started working on monitoring
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {TranslateService} from "@ngx-translate/core";
|
||||
import {MatSelectChange} from "@angular/material";
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@@ -6,5 +8,24 @@ import {Component} from '@angular/core';
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'angular';
|
||||
|
||||
langChange(event: MatSelectChange) {
|
||||
this.translate.use(event.value)
|
||||
}
|
||||
|
||||
langList: any[] = [
|
||||
{lang: "fr", display: "Français"},
|
||||
{lang: "en", display: "English"},
|
||||
];
|
||||
|
||||
constructor(private translate: TranslateService) {
|
||||
|
||||
translate.addLangs([
|
||||
"en",
|
||||
"fr"
|
||||
]);
|
||||
|
||||
translate.setDefaultLang("en");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user