AppKit automatically appends "Start Dictation..." and "Emoji & Symbols"
menu items, after a separator, to a menu in the menu bar that has the
title "Edit" in the operating system language.
Qt applications might however be translated to some other language, in
which case the "Edit" menu is not recognized by AppKit, and the menu
items won't be added. This is bad for accessibility and for users
wanting to type emojis.
If we have a menu that has the title "Edit" as translated in Qt's i18n
system, then create those items manually. To prevent a duplication of
the system- provided menu items, don't add the items if there already
is one with the action being set to the relevant selector. Otherwise,
perform the selector or call the NSApplication method ourselves. This
then results in the relevant keyboard input through regular code paths.
Fixes: QTBUG-79565
Change-Id: Ifd06036211756277550d398034689aca8e770133
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>