简体   繁体   中英

ngx-translate NOT working on iOS

I though it was recent but turns out it's not coming from my app, or there is a particular manipulation to do that I am not aware of.

ngx-translate work with NO Problems on android, on browser and through ionic view . But Not At All on iOS 11 (can't test on older device). I tried with a super basic app so that no other module conflict

Is there anything I can do to get my app translated ?

I found 2 issue that resulted in me loosing so many hours and nerves on this. The basic app I used to test ngx-translate worked on simulator but not device. To make it work on device (ios), I had to change

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

to

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

But the app I needed to translate was already using this ! (more headache) After so many hours lost trying to downgrade everything, everywhere to make it work, I found out the issue was not coming from ngx-translate and iOS but code-push and iOS.

It was silently breaking ngx-translate on device only... I removed it, and surprise, it work.

I installed your basic app on my android device and it works fine.

It also works fine on ios simulator (ios 11 - iPhone 8 simulator):

您在iOS 11上的应用-iPhone 8模拟器

Can't you have some logs?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM