front end version 2 de framadate, un gestionnaire de sondage
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
918 B

import { Component, DoCheck, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Language } from '../../../../core/enums/language.enum';
import { StorageService } from '../../../../core/services/storage.service';
import { LanguageService } from '../../../../core/services/language.service';
@Component({
selector: 'app-language-selector',
templateUrl: './language-selector.component.html',
styleUrls: ['./language-selector.component.scss'],
})
export class LanguageSelectorComponent implements OnInit {
public currentLang: Language;
public availableLanguages: string[] = [];
constructor(private languageService: LanguageService) {}
ngOnInit(): void {
this.availableLanguages = this.languageService.getAvailableLanguages();
this.currentLang = this.languageService.getLangage();
}
setLang(): void {
this.languageService.setLanguage(this.currentLang);
}
}