Skip to content
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

Closed
vsccarl opened this issue Mar 29, 2016 · 12 comments
Closed

Inconsistent shortcut key translations in menu vs workbench #4771

vsccarl opened this issue Mar 29, 2016 · 12 comments
Assignees
Labels
electron Issues and items related to Electron l10n-platform Localization platform issues (not wrong translations) upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@vsccarl
Copy link

vsccarl commented Mar 29, 2016

  • VSCode Version: 0.10.12-alpha
  • OS Version: Windows 10 / Ubuntu 15.10

Steps to Reproduce:

  1. Change to another language, I used Spanish.
  2. Hover over the Explorer/Search/Git/Debug icons on the left

Actual:
It is translating the shortcut word Shift. Elsewhere, such as the file menu, it is not translated.
shortcuttranslation

@vsccarl vsccarl added the v-test label Mar 29, 2016
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug l10n-platform Localization platform issues (not wrong translations) labels Mar 31, 2016
@dbaeumer dbaeumer assigned johnliu369 and unassigned dbaeumer Apr 1, 2016
@dbaeumer
Copy link
Member

dbaeumer commented Apr 1, 2016

@johnliu2016 can you please forward to the translation team.

@johnliu369
Copy link

@dbaeumer forwarded to loc team

@dbaeumer
Copy link
Member

dbaeumer commented Apr 1, 2016

Thanks!

@johnliu369
Copy link

loc team says all instances of "Shift" are localized well, after all if we still see unlocalized "Shift", this probably implies localizability issue.
@vsccarl can you attach a s/s of the untranslated "Shift" of the file menu.

@vsccarl
Copy link
Author

vsccarl commented Apr 6, 2016

@johnliu2016
untranslatedshift

untranslatedshift2

untranslatedshift3

untranslatedshift4

@johnliu369
Copy link

@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

@dbaeumer
Copy link
Member

dbaeumer commented Apr 7, 2016

@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 ?

@bpasero
Copy link
Member

bpasero commented Apr 7, 2016

I do not think we control how Electron presents the key bindings in the menus.

@alexdima
Copy link
Member

alexdima commented Apr 7, 2016

ElectronAcceleratorLabelProvider correctly does not use nls localize because these strings are passed to electron which then parses them:

https://github.com/electron/electron/blob/e05804848f98959d63337aacd9047cd579c5b23f/atom/common/keyboard_util.cc#L86

// 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.

@bpasero
Copy link
Member

bpasero commented Apr 7, 2016

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?

@johnliu369 johnliu369 assigned bpasero and unassigned johnliu369 Apr 8, 2016
@bpasero
Copy link
Member

bpasero commented Apr 8, 2016

I reopened electron/electron#1632. I can reproduce the issue on Windows, but interestingly not on Linux.

@bpasero bpasero added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Apr 8, 2016
@bpasero bpasero added this to the Backlog milestone Apr 8, 2016
@egamma egamma removed the v-test label Aug 22, 2016
@bpasero bpasero added workbench and removed bug Issue identified by VS Code Team member as probable bug labels Apr 7, 2017
@bpasero bpasero added electron Issues and items related to Electron workbench-menu and removed workbench labels Nov 12, 2017
@bpasero bpasero changed the title Inconsistent shortcut key translations Inconsistent shortcut key translations in menu vs workbench Nov 12, 2017
@bpasero bpasero removed this from the Backlog milestone Nov 16, 2017
@bpasero
Copy link
Member

bpasero commented Aug 17, 2018

We will change to custom menus on Windows. For now you can set "window.titleBarStyle": "custom".

@bpasero bpasero closed this as completed Aug 17, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
electron Issues and items related to Electron l10n-platform Localization platform issues (not wrong translations) upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

7 participants