【问题标题】:Localization of the googleCast framework not workinggoogleCast 框架的本地化不起作用
【发布时间】:2020-03-17 03:23:16
【问题描述】:

我正在尝试找到一种方法来本地化google cast sample app。 当我查看文档时,我发现我们需要在创建 sharedInstance 时设置一些启动选项。所以在示例应用程序中,他的 appdelegate 我将 setSharedInstance 部分更改为:

let options = GCKCastOptions(discoveryCriteria: GCKDiscoveryCriteria(applicationID: kReceiverAppID))
options.physicalVolumeButtonsWillControlDeviceVolume = true
let launchOptions = GCKLaunchOptions(languageCode: "fr", relaunchIfRunning: false)
options.launchOptions = launchOptions
GCKCastContext.setSharedInstanceWith(options)

我还尝试了 fr-FR 和其他语言代码,还尝试将“relaunchIfRunning”设置为 true。但似乎这些都不起作用。

有人成功更改了 googlecast 屏幕的语言吗?

亲切的问候, 史蒂夫

【问题讨论】:

  • 其实你的代码是正确的。铸造设备是否支持法语本身?您是否尝试将法语设置为 iOS 设备语言(默认情况下采用该语言)?

标签: ios swift iphone google-cast google-cast-sdk


【解决方案1】:

在您的项目文件中添加对我有用的语言。

【讨论】:

    【解决方案2】:

    您还必须本地化 Setting.bundle。这是使用文本编辑手动完成的:(

    Settings.bundle:
        Root.plist
        en.lproj:
            Root.strings
        fr.lproj:
            Root.strings
    

    en.lproj、ru.lproj 文件夹

    Root.strings - 文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-30
      • 1970-01-01
      • 2021-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-11
      • 1970-01-01
      相关资源
      最近更新 更多