Commit ab3c0578 authored by Diego Rey's avatar Diego Rey
Browse files

Fix default language using the user's session

parent 7ab49d2f
......@@ -10,7 +10,12 @@ import { TranslateService } from '../../node_modules/@ngx-translate/core';
export class AppComponent implements OnInit {
constructor(public router: Router, public translate: TranslateService) {
this.translate.addLangs(['es', 'en']);
this.translate.setDefaultLang('es');
let language = JSON.parse(sessionStorage.getItem("currentUser")).language;
if (language) {
this.translate.setDefaultLang(language);
} else {
this.translate.setDefaultLang('es');
}
}
ngOnInit() {
//this.router.navigate(['/login']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment