Fixed toggle language text.

This commit is contained in:
Joachim Nielandt 2018-03-25 20:21:34 +02:00
parent 884875ee64
commit 1840873b67
2 changed files with 4 additions and 2 deletions

View File

@ -26,7 +26,7 @@ export class LanguagetoggleComponent implements OnInit {
ngOnInit() {
// start listening to the stateservice for language updates
this.stateService.getLanguageObservable(this.route).subscribe(val => {
this.stateService.getLanguageObservable().subscribe(val => {
console.log('language toggle gets a language update from state service: ' + val);
this.show = (this.language === val);
console.log(' after language update, show: ' + this.show);

View File

@ -81,7 +81,7 @@ export class RootComponent implements OnInit {
// do some translation
let language = this.stateService.getLanguage();
if (s === 'lang') {
if (language == 'nl') {
if (language === 'nl') {
this.mousingOver = 'Taal: Nederlands';
} else if (language = 'en') {
this.mousingOver = 'Language: English';
@ -103,8 +103,10 @@ export class RootComponent implements OnInit {
if (this.stateService.getLanguage() === 'nl') {
console.log(' > toggle switched to en');
this.stateService.setLanguage('en', this.route, this.router);
this.mouseOver('lang');
} else if (this.stateService.getLanguage() === 'en') {
this.stateService.setLanguage('nl', this.route, this.router);
this.mouseOver('lang');
console.log(' > toggle switched to nl');
} else {
console.log(' > Could not toggle the language, pirates stole your tongue.');