2017-08-18 09:31:17 +00:00
|
|
|
import { Component } from '@angular/core';
|
2017-10-24 12:41:44 +00:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2017-12-06 11:10:48 +00:00
|
|
|
|
2018-02-17 14:21:38 +00:00
|
|
|
import { FuseSplashScreenService } from '@fuse/services/splash-screen.service';
|
|
|
|
import { FuseTranslationLoaderService } from '@fuse/services/translation-loader.service';
|
|
|
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
|
|
|
|
2018-05-20 07:12:31 +00:00
|
|
|
import { navigation } from 'app/navigation/navigation';
|
|
|
|
import { locale as navigationEnglish } from 'app/navigation/i18n/en';
|
|
|
|
import { locale as navigationTurkish } from 'app/navigation/i18n/tr';
|
2017-06-27 08:08:19 +00:00
|
|
|
|
|
|
|
@Component({
|
2017-08-18 09:31:17 +00:00
|
|
|
selector : 'fuse-root',
|
2017-07-08 16:12:52 +00:00
|
|
|
templateUrl: './app.component.html',
|
2017-07-12 12:35:07 +00:00
|
|
|
styleUrls : ['./app.component.scss']
|
2017-06-27 08:08:19 +00:00
|
|
|
})
|
2017-08-18 09:31:17 +00:00
|
|
|
export class AppComponent
|
2017-07-08 16:12:52 +00:00
|
|
|
{
|
2018-05-20 07:12:31 +00:00
|
|
|
navigation: any;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @param {FuseNavigationService} _fuseNavigationService
|
|
|
|
* @param {FuseSplashScreenService} _fuseSplashScreenService
|
|
|
|
* @param {FuseTranslationLoaderService} _fuseTranslationLoaderService
|
|
|
|
* @param {TranslateService} _translateService
|
|
|
|
*/
|
2017-10-24 12:41:44 +00:00
|
|
|
constructor(
|
2018-05-20 07:12:31 +00:00
|
|
|
private _fuseNavigationService: FuseNavigationService,
|
|
|
|
private _fuseSplashScreenService: FuseSplashScreenService,
|
|
|
|
private _fuseTranslationLoaderService: FuseTranslationLoaderService,
|
|
|
|
private _translateService: TranslateService
|
2017-10-24 12:41:44 +00:00
|
|
|
)
|
2017-07-12 12:35:07 +00:00
|
|
|
{
|
2018-05-20 07:12:31 +00:00
|
|
|
// Navigation
|
|
|
|
this.navigation = navigation;
|
|
|
|
|
2017-10-24 12:41:44 +00:00
|
|
|
// Add languages
|
2018-05-20 07:12:31 +00:00
|
|
|
this._translateService.addLangs(['en', 'tr']);
|
2017-10-24 12:41:44 +00:00
|
|
|
|
|
|
|
// Set the default language
|
2018-05-20 07:12:31 +00:00
|
|
|
this._translateService.setDefaultLang('en');
|
2017-10-24 12:41:44 +00:00
|
|
|
|
2018-03-08 09:25:27 +00:00
|
|
|
// Set the navigation translations
|
2018-05-20 07:12:31 +00:00
|
|
|
this._fuseTranslationLoaderService.loadTranslations(navigationEnglish, navigationTurkish);
|
2018-03-08 09:25:27 +00:00
|
|
|
|
2017-10-24 12:41:44 +00:00
|
|
|
// Use a language
|
2018-05-20 07:12:31 +00:00
|
|
|
this._translateService.use('en');
|
2017-07-12 12:35:07 +00:00
|
|
|
}
|
2017-06-27 08:08:19 +00:00
|
|
|
}
|