Hey guys,
I have some issues which makes me crazy when I try to translate my app
Context
I use @ngx-translate (v8.0.0) with @ngx-translate/http-loader (v2.0.1) and @biesbjerg/ngx-translate-po-http-loader (v2.0.1) with @angular/http (v4.4.6)
Everything is fine:
- On Android in any case
- On iOS if I use ionic view.
The only case it’s not working is on my production app on iOS.
Problem
The HttpClient can’t download ./assets/i18n/en.po
. I tried with assets/i18n/en.po
but same problem.
I thougth the problem has something to do with AOT compilation but it’s working in Ionic View with AOT, so I’m totally lost.
If you have any clue I would be very grateful
Code
import { HttpClientModule, HttpClient } from '@angular/common/http'
import {TranslateModule, TranslateLoader} from '@ngx-translate/core'
import { TranslatePoHttpLoader } from '@biesbjerg/ngx-translate-po-http-loader'
...
export const createTranslateLoader: Function = (httpClient: HttpClient) => new TranslatePoHttpLoader(httpClient, './assets/i18n', '.po')
...
imports: [
...
HttpClientModule,
...
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient]
}
})
],