#101995 extend tooltip of menu item that defines 'alt' command#116211
#101995 extend tooltip of menu item that defines 'alt' command#116211sbatten merged 4 commits intomicrosoft:mainfrom
Conversation
|
ping @sbatten who commented on the original issue I opened |
|
@sbatten any chance of this merging in time for February release? |
|
@gjsjohnmurray probably no and that's my fault for not coming back to the PR in time. I just did the code review and I think it looks good. As with anything, I'd like to see it in insiders for the month in case there are any surprises. I think we can merge this right after release. /cc @bpasero |
|
@sbatten the key needs to be called "Option" on macOS: https://en.wikipedia.org/wiki/Alt_key#macOS |
|
@gjsjohnmurray I think we need to localize the key though, as the name maybe different in other languages. |
|
@bpasero what is the right way to do this? I used as my model for theisMacintosh test. Does the keylabel text get localized in that instance?
|
|
No, it needs 2 distinct messages. |
|
Based on the keyboard images at https://support.apple.com/en-us/HT201794 most keyboard layouts use Having said that, the Magic Keyboard apparently labels it with Shall we leave it to the translators to decide on a per-language basis? Presumably they'd pick either Are the nls.localize translations file-specific? That is, if I add this in the file I'm changing for this PR const = nls.localize({ key: 'macOSaltKey', comment: ['label or symbol on the Alt / Command key (commonly U+2325)'] }, 'Command')and do the same to fix debugHover.ts, will the translators have to duplicate the translation? If yes, is there a central place to export the string from? |
|
If the (screenshots above simulated on my Windows dev platform) |
|
@bpasero please see my questions at #116211 (comment) It makes sense to me for there to be one place setting the per-OS (and possibly per-language) text or symbol representing the Alt/Option key when it needs to be referred to in display strings. I'd like to get this PR into Insiders soon so it can get good exposure. |
|
I don't fully understand why we have to solve this newly for this case? I am quite sure we already have existing tooltips with the Alt-key as part of them, why can we not reuse what we do there? |
|
This might be the right thing to use vscode/src/vs/base/common/keybindingLabels.ts Lines 61 to 83 in ed5e512 |
|
Thanks @sbatten, this is what I was looking for. I have pushed a change to use it. At the same time I switched to using regular square brackets around the altKey representation. |
|
@sbatten thanks for the feedback. I have pushed the changes you suggested, so I think this is now ready to be merged. |
|
@gjsjohnmurray merged! thanks! |



This PR implements #101995
If a menu item specifies an additional
altcommmand the tooltip gets a second line displaying this when the Alt key is not down.The goal is to improve discoverability of places where two alternative commands exist.