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

38 lines
1.2 KiB
TypeScript
Raw Permalink 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';
import { locale as navigationEnglish } from './navigation/i18n/en';
import { locale as navigationTurkish } from './navigation/i18n/tr';
@Component({
2017-08-18 09:31:17 +00:00
selector : 'fuse-root',
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
{
constructor(
private translate: TranslateService,
private fuseNavigationService: FuseNavigationService,
private fuseSplashScreen: FuseSplashScreenService,
private fuseTranslationLoader: FuseTranslationLoaderService
)
2017-07-12 12:35:07 +00:00
{
// Add languages
this.translate.addLangs(['en', 'tr']);
// Set the default language
this.translate.setDefaultLang('en');
// Set the navigation translations
this.fuseTranslationLoader.loadTranslations(navigationEnglish, navigationTurkish);
// Use a language
this.translate.use('en');
2017-07-12 12:35:07 +00:00
}
}