来自 Apple Watch modal segue 的标签“Cancel"显示错误的文本 - “abbrechen" [英] The label “Cancel” from modal segue in Apple Watch showing wrong text - "abbrechen"

查看:18
本文介绍了来自 Apple Watch modal segue 的标签“Cancel"显示错误的文本 - “abbrechen"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的 WKInterfaceController 通过按下 menuItem(由self.addMenuItem in mainScreen"设置)弹出时,弹出的 WKInterfaceController 上的标题显示abbrechen" 而不是Cancel".任何人都知道如何修复它以使其显示Cancel"?或者我可能哪里出错了?

When my WKInterfaceController poped up by pressing a menuItem (which was settup by "self.addMenuItem in mainScreen"), the title on the poped WKInterfaceController shows "abbrechen" instead of "Cancel". Anyone know how to fix it to make it showing "Cancel"? Or like where did I probably make a mistake?

//MainScreen.swift
func setContextItems(directToEnabled: Bool) {
        self.clearAllMenuItems()
        self.addMenuItem(with: WKMenuItemIcon.decline, title: "direct", action: #selector(MainScreen.freePressed))
}

线索:

  • 它仅发生在我的 Apple Watch 设备 (WatchOS 3.1) 上.当它运行在模拟器上(Xcode 8.2.1,iPhone 7 plus),显示效果很好取消".
  • 我的语言&地区都是英文.我的 Watch 应用和 iPhone 设置中的Langauge & Region"语言为英语,地区为澳大利亚.
  • abbrechen"在德语中是中止"或取消".
  • 有一个 相关关于 SO 的问题.
  • 也许我在某处更改了语言的一些 plist 设置.
  • 我搜索了我的项目,但找不到诸如德语"、abbrechen"之类的关键字
  • 我确实使用了#if (TARGET_OS_IOS || TARGET_IPHONE_SIMULATOR)",但没有任何相关性.
  • It happens only on my Apple Watch device (WatchOS 3.1). When it runs on the simulator(Xcode 8.2.1, iPhone 7 plus), it works fine showing "Cancel".
  • My Langauge & Region are both English. "Langauge & Region" in my Watch App and my iPhone setting are both English for language and Australian for region.
  • "abbrechen" is "abort" or "cancel" in German.
  • There's a related question on SO.
  • Maybe I changed some plist setting for langauge somewhere.
  • I searched my project, and I can not find keywords like "german", "abbrechen"
  • I did used "#if (TARGET_OS_IOS || TARGET_IPHONE_SIMULATOR)", but there's nothing related.

我想我可能会在某处更改 plist,从而仅在 Apple Watch 上更改区域设置/语言.或者它可能是一个罕见的 WatchOS 错误.以前有人见过类似的问题吗?

I guess I might change a plist somewhere that change the locale/laguage only on the Apple Watch. Or maybe it's a rare WatchOS bug. Anyone saw similar problem before ?

推荐答案

我对你的代码有点困惑?您给它的标题是直接"但期望标题是取消"?

I am a bit confused by you code? You are giving it the title 'direct' but expecting a title of 'Cancel'?

你不应该这样做:

    self.clearAllMenuItems()
    self.addMenuItem(withImageNamed: "imageFileForDirectButton", title: "Direct", action: #selector(TheController.menuDirectButtonPressedFunction))
    self.addMenuItem(with: WKMenuItemIcon.decline, title: "Cancel", action: #selector(TheController.menuCancelButtonPressedFunction))

这篇关于来自 Apple Watch modal segue 的标签“Cancel"显示错误的文本 - “abbrechen"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆