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

Label names of special menus 'Services', 'Windows' and 'Help' are hardcoded #2348

Closed
mn4367 opened this issue Jul 26, 2015 · 4 comments · Fixed by #2682
Closed

Label names of special menus 'Services', 'Windows' and 'Help' are hardcoded #2348

mn4367 opened this issue Jul 26, 2015 · 4 comments · Fixed by #2682

Comments

@mn4367
Copy link

mn4367 commented Jul 26, 2015

The special menus on OS X are only handled properly if one uses the english names, the comment in the source describes this as a hack. I made another hack ;-) which instead uses the 'sublabel'-property to detect those menus. sublabel seems to do nothing on OS X, so it's maybe a viable solution before a real localization mechanism is available for Electron.

If you like, I'll submit a PR.

@zcbenz
Copy link
Member

zcbenz commented Jul 28, 2015

The sublabel is used on Windows and Linux, so using it as solution doesn't sound a good idea to me, I think we need a new property for that.

@mn4367
Copy link
Author

mn4367 commented Jul 28, 2015

The modification I made is only in code for OSX , so other platforms aren't affected. I have also documented this in the section for building menus on OS X, which already mentions those specal menus.

@mn4367
Copy link
Author

mn4367 commented Jul 28, 2015

Of course if you are using 'Windows' and 'Help' as a label (there is no equivalent for 'Services' on Windows, for example) the this could be a problem, but in my opionion making a multi-platform app always involves creating appropriate menus for each platform separately.

@zcbenz
Copy link
Member

zcbenz commented Jul 29, 2015

The sublabel shows on Windows and Linux, so if you reuse the same menu on different platforms you will see OSX_WINDOW_MENU appearing on Windows and Linux. I agree with you that apps should create different menus for different platforms, but on Electron's side we have to ensure things work when user reuses one menu for all platforms.

Also I think though it is OK to use hacks in implementations, we should not make the API look like a hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants