mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-03-10 03:22:03 +00:00
+ Added support for translations in nav items + Added badge support for collapsable nav items + Initialize the navigation from app.component rather then navigation.service
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import { Component } from '@angular/core';
|
|
import { FuseSplashScreenService } from './core/services/splash-screen.service';
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
import { FuseTranslationLoaderService } from './core/services/translation-loader.service';
|
|
|
|
import { FuseNavigationService } from './core/components/navigation/navigation.service';
|
|
import { FuseNavigationModel } from './navigation/navigation.model';
|
|
import { locale as navigationEnglish } from './navigation/i18n/en';
|
|
import { locale as navigationTurkish } from './navigation/i18n/tr';
|
|
|
|
@Component({
|
|
selector : 'fuse-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls : ['./app.component.scss']
|
|
})
|
|
export class AppComponent
|
|
{
|
|
constructor(
|
|
private fuseNavigationService: FuseNavigationService,
|
|
private fuseSplashScreen: FuseSplashScreenService,
|
|
private translate: TranslateService,
|
|
private translationLoader: FuseTranslationLoaderService
|
|
)
|
|
{
|
|
// Add languages
|
|
this.translate.addLangs(['en', 'tr']);
|
|
|
|
// Set the default language
|
|
this.translate.setDefaultLang('en');
|
|
|
|
// Use a language
|
|
this.translate.use('en');
|
|
|
|
// Set the navigation model
|
|
this.fuseNavigationService.setNavigationModel(new FuseNavigationModel());
|
|
|
|
// Set the navigation translations
|
|
this.translationLoader.loadTranslations(navigationEnglish, navigationTurkish);
|
|
}
|
|
}
|