我在 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/