From f4948f18f267f05e4e2e6dc38c3a26bbc65e81a5 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 11 Mar 2018 10:13:37 -0600 Subject: [PATCH] web-ui: Initialize TranslateService --- web-ui/src/app/app.component.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/web-ui/src/app/app.component.ts b/web-ui/src/app/app.component.ts index 68478a8..5089420 100644 --- a/web-ui/src/app/app.component.ts +++ b/web-ui/src/app/app.component.ts @@ -1,9 +1,28 @@ import { Component } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; + +import { DEFAULT_LANG, LanguageService } from './services/language.service'; + @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { + + constructor( + private translate: TranslateService, + private languageService: LanguageService) { + + translate.setDefaultLang(DEFAULT_LANG); + translate.use(languageService.getLang()); + + // define langs + translate.setTranslation('en', this.englishLang()); + } + + englishLang(): Object { + return {}; + } }