gpt4 book ai didi

swift - iWatch 中的 NSLocalizedString

转载 作者:行者123 更新时间:2023-11-30 12:40:50 25 4
gpt4 key购买 nike

我在 iWatch 中将我的应用程序本地化为两种语言。除“复杂功能”和“警报”对话框外,大部分文本均已本地化。

有人可以帮助我吗?

警报代码

    let restartAction = WKAlertAction(title: NSLocalizedString("OK", comment: ""), style: .destructive, handler: {
//some code here
})

let cancelAction = WKAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel, handler: {})

presentAlert(withTitle: NSLocalizedString("Restart the page?", comment: ""), message: "", preferredStyle: .alert, actions: [restartAction, cancelAction])

最佳答案

我解决了问题:

选择 localized.string 文件,然后在文件检查器>目标成员资格中勾选“监视扩展”。

关于swift - iWatch 中的 NSLocalizedString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42240111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com