import { Injectable } from '@angular/core';
import {TranslateService} from "@ngx-translate/core";

@Injectable({
  providedIn: 'root'
})
export class LanguageService {

  constructor(private translateService: TranslateService) { }

  setLanguage(lang: string) {
    sessionStorage.setItem("lang", lang);
    this.translateService.use(lang);
  }

  getLanguage() {
    return sessionStorage.getItem("lang");
  }
}
