Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matefun
Frontend
Commits
f0e3cccd
Commit
f0e3cccd
authored
Nov 25, 2018
by
Diego Rey
Browse files
Fix get language session on init
parent
f2346aa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/src/app/app.component.ts
View file @
f0e3cccd
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment