To reduce code duplication when creating hotkey deprecation notices, create the `get_hotkey_deprecation_notice` function. Also, create a `ui` testing file with a test for the new function. Fix #10004.