fuse-angular/src/app/app.component.ts

52 lines
1.7 KiB
TypeScript
Raw Normal View History

2017-08-18 09:31:17 +00:00
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
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';
@Component({
selector : 'app',
templateUrl: './app.component.html',
2017-07-12 12:35:07 +00:00
styleUrls : ['./app.component.scss']
})
2017-08-18 09:31:17 +00:00
export class AppComponent
{
2018-05-20 07:12:31 +00:00
navigation: any;
/**
* Constructor
*
* @param {FuseNavigationService} _fuseNavigationService
* @param {FuseSplashScreenService} _fuseSplashScreenService
* @param {FuseTranslationLoaderService} _fuseTranslationLoaderService
* @param {TranslateService} _translateService
*/
constructor(
2018-05-20 07:12:31 +00:00
private _fuseNavigationService: FuseNavigationService,
private _fuseSplashScreenService: FuseSplashScreenService,
private _fuseTranslationLoaderService: FuseTranslationLoaderService,
private _translateService: TranslateService
)
2017-07-12 12:35:07 +00:00
{
2018-05-20 07:12:31 +00:00
// Navigation
this.navigation = navigation;
// Add languages
2018-05-20 07:12:31 +00:00
this._translateService.addLangs(['en', 'tr']);
// Set the default language
2018-05-20 07:12:31 +00:00
this._translateService.setDefaultLang('en');
// Set the navigation translations
2018-05-20 07:12:31 +00:00
this._fuseTranslationLoaderService.loadTranslations(navigationEnglish, navigationTurkish);
// Use a language
2018-05-20 07:12:31 +00:00
this._translateService.use('en');
2017-07-12 12:35:07 +00:00
}
}