我虽然它是最近的,但事实证明它不是来 self 的应用程序,或者有一个我不知道的特定操作。
ngx-translate 可以在 Android、浏览器和 ionic View 上使用没有问题。但在 iOS 11 上完全没有(无法在旧设备上测试)。 I tried with a super basic app so that no other module conflict
有什么我可以做的来翻译我的应用程序吗?
最佳答案
我发现了两个问题,导致我为此浪费了很多时间和精力。我用来测试 ngx-translate 的基本应用程序可以在模拟器上运行,但不能在设备上运行。为了使其在设备(ios)上工作,我必须更改
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
到
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
但是我需要翻译的应用程序已经在使用这个了! (更头痛)在花费了这么多时间尝试降级所有内容、到处让它工作之后,我发现问题不是来自 ngx-translate 和 iOS,而是来自代码推送和 iOS。
它只是默默地破坏了设备上的 ngx-translate...我删除了它,令人惊讶的是,它工作了。
关于ios - ngx-translate 不适用于 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47418817/