1 import { Component, OnInit, OnDestroy } from "@angular/core";
2 import { Router } from '@angular/router';
3 //TODO import {TranslateService} from "ng2-translate";
7 templateUrl: './app/app.component.html',
8 styleUrls: ['./app/app.component.css']
11 export class AppComponent implements OnInit, OnDestroy {
12 private defaultLanguage: string = 'en';
14 // I initialize the app component.
15 //TODO constructor(private translate: TranslateService) {
16 constructor(public router: Router) {
22 this.translate.addLangs(["en", "fr"]);
23 this.translate.setDefaultLang(this.defaultLanguage);
25 let browserLang = this.translate.getBrowserLang();
26 this.translate.use(browserLang.match(/en|fr/) ? browserLang : this.defaultLanguage);