diff --git a/locales/lumi/en.json b/locales/lumi/en.json index b974def82..5149b062f 100644 --- a/locales/lumi/en.json +++ b/locales/lumi/en.json @@ -133,6 +133,12 @@ "consent_warning": "You need to at least consent to the privacy policy to use this application." }, "menu": { + "mac": { + "services": "Services", + "hide": "Hide Lumi", + "hideothers": "Hide Others", + "unhide": "Show all" + }, "quit": "Quit", "file": { "label": "File", diff --git a/server/src/menu/analyticsMenu.ts b/server/src/menu/analyticsMenu.ts index 01ac24fed..6e60afe8c 100644 --- a/server/src/menu/analyticsMenu.ts +++ b/server/src/menu/analyticsMenu.ts @@ -2,10 +2,12 @@ import electron from 'electron'; import SocketIO from 'socket.io'; import i18next from 'i18next'; +import macMenu from './macMenu'; import helpMenu from './helpMenu'; import editMenu from './editMenu'; export default (window: electron.BrowserWindow, websocket: SocketIO.Server) => [ + ...macMenu(), { label: i18next.t('lumi:menu.file.label'), submenu: [ diff --git a/server/src/menu/h5peditorMenu.ts b/server/src/menu/h5peditorMenu.ts index 6e956bf93..277025ce2 100644 --- a/server/src/menu/h5peditorMenu.ts +++ b/server/src/menu/h5peditorMenu.ts @@ -4,8 +4,10 @@ import i18next from 'i18next'; import helpMenu from './helpMenu'; import editMenu from './editMenu'; +import macMenu from './macMenu'; export default (window: electron.BrowserWindow, websocket: SocketIO.Server) => [ + ...macMenu(), { label: i18next.t('lumi:menu.file.label'), submenu: [ diff --git a/server/src/menu/launchpadMenu.ts b/server/src/menu/launchpadMenu.ts index dd0f7baa2..579b03501 100644 --- a/server/src/menu/launchpadMenu.ts +++ b/server/src/menu/launchpadMenu.ts @@ -2,9 +2,11 @@ import electron from 'electron'; import SocketIO from 'socket.io'; import editMenu from './editMenu'; +import macMenu from './macMenu'; import helpMenu from './helpMenu'; export default (window: electron.BrowserWindow, websocket: SocketIO.Server) => [ + ...macMenu(), editMenu(), helpMenu(window, websocket) ]; diff --git a/server/src/menu/macMenu.ts b/server/src/menu/macMenu.ts new file mode 100644 index 000000000..f8a267750 --- /dev/null +++ b/server/src/menu/macMenu.ts @@ -0,0 +1,38 @@ +import i18next from 'i18next'; +const isMac = process.platform === 'darwin'; + +export default function (): any { + return isMac + ? [ + { + label: 'Lumi', + submenu: [ + { + label: i18next.t('lumi:menu.help.about'), + role: 'about' + }, + { type: 'separator' }, + { + label: i18next.t('lumi:menu.mac.services'), + role: 'services' + }, + { type: 'separator' }, + { label: i18next.t('lumi:menu.mac.hide'), role: 'hide' }, + { + label: i18next.t('lumi:menu.mac.hideothers'), + role: 'hideothers' + }, + { + label: i18next.t('lumi:menu.mac.unhide'), + role: 'unhide' + }, + { type: 'separator' }, + { + label: i18next.t('lumi:menu.quit'), + role: 'quit' + } as any + ] + } + ] + : []; +}