import { LocalizeParser , LocalizeRouterSettings } from '@gilsdav/ngx-translate-router' ; import { TranslateService } from '@ngx-translate/core' ; import { HttpClient } from '@angular/common/http' ; import { Routes } from '@angular/router' ; import { Location } from '@angular/common' ; /**
 * Config interface
 */ export interface ILocalizeRouterParserConfig { locales : Array < string > ; prefix ? : string ; escapePrefix ? : string ; } export class LocalizeRouterHttpLoader extends LocalizeParser { param translate param location param settings param http param path constructor ( translate , location , settings , private http , private path = 'assets/locales.json' ) { super ( translate , location , settings ) ; } param routes load ( routes ) { return new Promise ( ( resolve ) => { this . http . get ( `${ this . path }` ) . subscribe ( ( data ) => { this . locales = data . locales ; this . prefix = data . prefix || '' ; this . escapePrefix = data . escapePrefix || '' ; this . init ( routes ) . then ( resolve ) ; } ) ; } ) ; } }