diff --git a/lib/src/module.ts b/lib/src/module.ts index 88b9a60764..7eb8695de6 100644 --- a/lib/src/module.ts +++ b/lib/src/module.ts @@ -1,5 +1,8 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; +import { Http } from '@angular/http'; import { MaterialModule } from '@angular/material'; +import { TranslateModule, TranslateLoader, + TranslateStaticLoader } from 'ng2-translate'; import 'rxjs/add/operator/debounceTime.js'; import 'rxjs/add/operator/distinctUntilChanged'; @@ -22,6 +25,10 @@ import { IgoQueryModule } from './query/index'; import { IgoSearchModule } from './search/index'; import { IgoSharedModule } from './shared/index'; +export function createTranslateLoader(http: Http) { + return new TranslateStaticLoader(http, './locale', '.json'); +} + const IGO_MODULES = [ IgoLanguageModule, IgoFeatureModule, @@ -37,6 +44,11 @@ const IGO_MODULES = [ @NgModule({ imports: [ MaterialModule.forRoot(), + TranslateModule.forRoot({ + provide: TranslateLoader, + useFactory: createTranslateLoader, + deps: [Http] + }), IgoCoreModule.forRoot(), IgoLanguageModule.forRoot(),