首页 > 解决方案 > googleCast 框架的本地化不起作用

问题描述

我正在尝试找到一种方法来本地化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 屏幕的语言吗?

亲切的问候,史蒂夫

标签: iosswiftiphonegoogle-castgoogle-cast-sdk

解决方案


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

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

en.lproj、ru.lproj文件夹

Root.strings - 文件


推荐阅读