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

Fix get language session on init

parent f2346aa2
......@@ -10,7 +10,8 @@ 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']);
let language = JSON.parse(sessionStorage.getItem("currentUser")).language;
let currentSession = sessionStorage.getItem("currentUser");
let language = currentSession ? JSON.parse(currentSession).language : 'es';
if (language) {
this.translate.setDefaultLang(language);
} else {
......
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