Ngx-translate not working with ios device

It IS working on ionic serve (all device with chrome), ionic view (ios device and android device), android device (cordova run android) but NOT on iOS device. Keys are displayed instead of translations. Most pages are not lazy loaded.

app.module.ts :

export function createTranslateLoader(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
...
imports: [...,
HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (createTranslateLoader),
        deps: [HttpClient]
      }
    })
]

Since its working on everything but an iOS device, I doubt it’s a implementation in my code problem but I’d really like to make it work and not redo everything with a wonky pipe :confused:

I have the same issue. Did you resolve this issue?

I actually did :slight_smile: But maybe not the way I wanted : ngx-translate wasn’t broken by iOS but because of another module in my project Code-push. I removed code-push and ngx-translate started working on iOS. If I recall correctly, it was a somewhat known issue with code-push which broke iOS engine.

If you aren’t using code-push, check how you export the httpLoaderFactory.

This was NOT working:

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http);
}

This was working:

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}