Internationnalisation de la page de login
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
|
||||
@Component({
|
||||
selector: "app-login",
|
||||
@@ -6,7 +7,19 @@ import { Component, OnInit } from "@angular/core";
|
||||
styleUrls: ["./login.component.css"]
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
constructor() {}
|
||||
public selectedLanguageFlag: string;
|
||||
private flag: Map<string, string>;
|
||||
|
||||
constructor(private translate: TranslateService) {
|
||||
translate.addLangs(['en', 'fr']);
|
||||
translate.setDefaultLang('en');
|
||||
this.selectedLanguageFlag = "en";
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
public switchLang(event: any) {
|
||||
this.translate.use(event.value);
|
||||
this.selectedLanguageFlag = event.value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user