Handling Keyboard Hotkeys and Shortcuts across Multiple Languages

We have a requirement to manage the shortcuts and hotkeys in our application, and have it to be intuitive and support multi-lingual fully. The understanding that we have currently is that most universal shortcuts and hotkeys on MacOS/iOS are expressed using English/Latin characters’ – and now, when a ‘pure foreign language physical or virtual keyboard’ is the ‘input device’ – we are unclear how the user would invoke such a hotkey.

Now, considering cases where other language keyboards have no Latin characters, in these environments, managing shortcuts and hotkeys becomes a rather difficult task. Taking a very simple example, the shortcut for Printing a page is Command/Control + 'P'. This can be an issue on Non English character keyboards like Arabic, where not only are there no letters for P, there is also no equivalent phonetic character as well, since the language itself does not have it.

Also – when we are wanting customizability of a hotkey by the user, how would the user express ‘which is the key combination for a given action they want to perform’.

So, based on these conditions, in order to provide the most comprehensive and optimal experience for the user in their own language, what is it that Apple recommend we do here, for Hotkeys/Shortcuts support in Pure Languages

Generally, non-Latin keyboards like Arabic switch to Latin when ⌘ (Command) is pressed, to allow pressing ⌘P. The letter P is also written on Apple’s keyboards as an indication for this use case.

That said you’re correct, not all shortcuts defined in QWERTY are doable on all other keyboard layouts.
That’s why AppKit, UIKit, and SwiftUI apps automatically localize keyboard shortcuts.

Developers are encouraged to define the shortcuts in QWERTY – English (also called “ABC”), and then at runtime they’ll adapt automatically for the user’s current input method & language directionality.
Many parameters are taken into account to compute the best hotkey equivalent, for hundreds of keyboard layouts, and left-to-right vs. right-to-left.
For instance, ⌘[ is ⌘] in right-to-left, or ⌘^ in ABC – AZERTY.

The system is taking care of localizing menus & shortcut display. There is no API currently for your shortcut customization panel to fetch the localized shortcut display like OS menus do.
You can request an API on https://feedbackassistant.apple.com.

There is currently a workaround if you use NSMenuItem: its keyEquivalent property automatically updates from your QWERTY specification to the localized version.
For instance if you set [ as keyEquivalent, the property will update its value to ^ with ABC – AZERTY shortly after NSMenuItem has been added to an NSMenu.

Handling Keyboard Hotkeys and Shortcuts across Multiple Languages
 
 
Q