ios - ngx-translate 不适用于 iOS

标签 ios angular ionic-framework ngx-translate

我虽然它是最近的,但事实证明它不是来 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/

相关文章:

ios - 如何在 uialertview Controller 的 uitext 字段中没有输入时禁用两个 uialertcontroller 按钮

ios - UITableViewCell 的 subview 没有出现

angular - 使用 AngularFire 2 从 Firebase 中删除对象

angular - matSort 在 mat-table Angular 中无法正常工作

javascript - 用于尝试返回 json 数据的 ionic Angular 闭合

ios - didRegisterForRemoteNotificationsWithDeviceToken 不返回 deviceToken

ios - 如何将 MKMapPoint 转换为 CGPoint

angular - 如何在ionic2中重定向

javascript - ionic 推送无法读取未定义的属性 'init'

html - iOS 上 Ionic 中为两个键盘留出的空间