I have an ionic 3 project and I want to use ngx translate. It works in the browser and the iOS simulator but not on a real device (tested on iPhone SE, iOS 11.1).
app.module.ts
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClient, HttpClientModule } from '@angular/common/http';
export function HttpLoaderFactory (http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
[...],
imports: [
[...]
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (HttpLoaderFactory),
deps: [HttpClient]
}
})
],
[...]
})
export class AppModule { }
My files are here:
src/assets/i18n/DE.json
src/assets/i18n/EN.json
I translate it this way:
<ion-title translate>
{{ 'LOGIN.HEADER' | translate }}
</ion-title>
Does someone know why it won't be translated on a device?