-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent shortcut key translations in menu vs workbench #4771
Comments
@johnliu2016 can you please forward to the translation team. |
@dbaeumer forwarded to loc team |
Thanks! |
loc team says all instances of "Shift" are localized well, after all if we still see unlocalized "Shift", this probably implies localizability issue. |
@dbaeumer can you help understand the shortcut accelerator of key combination display on such main menu, we found no single matching case in loc files |
@bpasero @alexandrudima I looked at the code and it looks like the resolving of a key binding to a user presentable string is done in keytCodes.ts and none of the code there is externalized (ElectronAcceleratorLabelProvider). Is this in oversight ? |
I do not think we control how Electron presents the key bindings in the menus. |
ElectronAcceleratorLabelProvider correctly does not use nls localize because these strings are passed to electron which then parses them: // Return key code represented by |str|.
ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s,
bool* shifted) {
std::string str = base::ToLowerASCII(s);
if (str == "ctrl" || str == "control") {
return ui::VKEY_CONTROL;
} else if (str == "super" || str == "cmd" || str == "command" ||
str == "meta") {
return ui::VKEY_COMMAND;
} else if (str == "commandorcontrol" || str == "cmdorctrl") {
#if defined(OS_MACOSX)
return ui::VKEY_COMMAND;
#else
return ui::VKEY_CONTROL;
#endif
} else if (str == "alt" || str == "option") {
return ui::VKEY_MENU;
} else if (str == "shift") {
return ui::VKEY_SHIFT;
} it is then Electron that renders them in the top level menu without any control from our side. |
I think we have to distinguish between Electron menu and hover: In the hover imho we can provide translated labels, for Electron we should follow up with them. I found electron/electron#1632 though I cannot remember we talked to them about this? |
I reopened electron/electron#1632. I can reproduce the issue on Windows, but interestingly not on Linux. |
We will change to custom menus on Windows. For now you can set |
Steps to Reproduce:
Actual:
It is translating the shortcut word Shift. Elsewhere, such as the file menu, it is not translated.
The text was updated successfully, but these errors were encountered: