ios - 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 屏幕的语言吗?
亲切的问候,史蒂夫
解决方案
您还必须本地化 Setting.bundle。这是使用文本编辑手动完成的:(
Settings.bundle:
Root.plist
en.lproj:
Root.strings
fr.lproj:
Root.strings
en.lproj、ru.lproj文件夹
Root.strings - 文件
推荐阅读
- c - 使用 CTC++ 代码覆盖工具的 C 语言单元测试代码覆盖率
- github - github:在没有拉取请求的情况下启动代码审查?
- python - 计算用元组填充的行数
- c# - ImageMagick 会耗尽内存,直到应用程序最终崩溃
- ruby-on-rails - 此系统上当前未安装 Rails - High Sierra,rbenv
- mysql - Ruby on Rails - 迁移数据库时出现套接字错误
- swift - Swift - 在整个结构中搜索字符串
- ms-access - 查询设计视图访问中的范围
- mysql - 将每个选定的行乘以某个值,然后在单个查询中对所有内容求和
- reactjs - 根据从另一个操作收到的 redux 道具调用操作