import { NgModule } from '@angular/core'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native'; export async function createTranslateLoader(nativeService: NativeService) { // tslint:disable-next-line: variable-name const translateLoader = nativeService.getTranslateLoader( './assets/i18n/', '.json' ); // return new TranslateBrowserLoader(nativeService, './assets/i18n/', '.json'); return translateLoader; } @NgModule({ imports: [ TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: createTranslateLoader, deps: [UCAP_NATIVE_SERVICE] } }) ], exports: [] }) export class AppTranslateModule {}