mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 12:35:07 +00:00
30825e7927
+ Added TranslateModule to the NavigationModule so the translate pipe can work + Small tweaks
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
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({
|
|
selector : 'fuse-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls : ['./app.component.scss']
|
|
})
|
|
export class AppComponent
|
|
{
|
|
constructor(
|
|
private translate: TranslateService,
|
|
private fuseNavigationService: FuseNavigationService,
|
|
private fuseSplashScreen: FuseSplashScreenService,
|
|
private fuseTranslationLoader: FuseTranslationLoaderService
|
|
)
|
|
{
|
|
// 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');
|
|
}
|
|
}
|