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
Add default label and accelerator for menu item roles #6190
Conversation
/cc @sindresorhus 👀 |
Awesome! One of the main benefits of doing this would have been automatic localization. Doesn't look like this PR handles that. From the issue:
|
Nope, that will be handled in a subsequent up pull request. 🌎 |
about: { | ||
get label () { | ||
const {app} = require('electron') | ||
return `About ${app.getName()}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
process.platform === 'linux' ? 'About' : `About ${appName}`
On Linux, they don't include the app name.
// @danhp |
@sindresorhus thanks for the review, I've incorporated your feedback 👍 |
35f0490
to
813e528
Compare
LGTM |
}, | ||
togglefullscreen: { | ||
label: 'Toggle Full Screen', | ||
accelerator: process.platform === 'darwin' ? 'Ctrl+Command+F' : 'F11', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ctrl
-> Control
Aside from the tiny nitpick, it looks good. |
👍 |
Adds fallback labels and accelerators for all
MenuItem
roles.This allows you to use menu item roles like so:
And the accelerators and labels will be automatically provided as so:
Close #2812